using System; using System.Collections.Generic; using System.Linq; using System.Web; using NHibernate; using NHibernate.Linq; using Sleis.Models; using Sleis.Infrastructure; namespace Sleis.Data { public class RepudiationData : BaseData { public int GetPendingRepudiationsCount() { using (ISession session = GetSession()) { return session.Query().Count(r => r.ClosedByUserId == null && r.ClosedDate == null); } } public List GetPendingRepudiations() { using (ISession session = GetSession()) { return session.Query().Where(r=>r.ClosedByUserId==null && r.ClosedDate==null).ToList(); } } public int GetPendingRepudiationsCount(int reportId) { using (ISession session = GetSession()) { return (from d in session.Query() where d.ReportId == reportId && d.Status == SubmissionDocumentStatus.RepudiationRequested select d.Id).Distinct().Count(); } } } }