protected PagedTableModel(string defaultSort, string defaultDirection)
 {
     Pager = new PagerModel2(Count)
     {
         Sort = defaultSort, Direction = defaultDirection
     };
 }
示例#2
0
 public SavedQueryModel()
 {
     onlyMine        = DbUtil.Db.UserPreference("savedSearchOnlyMine", "true").ToBool();
     Pager           = new PagerModel2(Count);
     Pager.Direction = "asc";
     Pager.Sort      = "Name";
 }
示例#3
0
 public SavedQueryModel()
 {
     onlyMine = DbUtil.Db.UserPreference("savedSearchOnlyMine", "true").ToBool();
     Pager = new PagerModel2(Count);
     Pager.Direction = "asc";
     Pager.Sort = "Description";
 }
示例#4
0
 public FamilyModel(int id)
 {
     Person = DbUtil.Db.LoadPersonById(id);
     Pager = new PagerModel2(Count);
     Pager.pagesize = 10;
     Pager.ShowPageSize = false;
 }
示例#5
0
 public SMSModel()
 {
     Pager = new PagerModel2(DbUtil.Db)
     {
         GetCount = Count
     };
 }
示例#6
0
 public TransactionsModel()
 {
     Pager           = new PagerModel2(Count);
     Pager.Sort      = "Date";
     Pager.Direction = "desc";
     finance         = HttpContext.Current.User.IsInRole("Finance");
     admin           = HttpContext.Current.User.IsInRole("Admin") || HttpContext.Current.User.IsInRole("ManageTransactions");
 }
示例#7
0
 public TransactionsModel()
 {
     Pager = new PagerModel2(Count);
     Pager.Sort = "Date";
     Pager.Direction = "desc";
     finance = HttpContext.Current.User.IsInRole("Finance");
     admin = HttpContext.Current.User.IsInRole("Admin") || HttpContext.Current.User.IsInRole("ManageTransactions");
 }
示例#8
0
 public TransactionsModel()
 {
     Pager = new PagerModel2(Count);
     Pager.Sort = "Date";
     Pager.Direction = "desc";
     finance = HttpContext.Current.User.IsInRole("Finance");
     isSage = OnlineRegModel.GetTransactionGateway() == "sage";
     admin = HttpContext.Current.User.IsInRole("Admin") || HttpContext.Current.User.IsInRole("ManageTransactions");
 }
示例#9
0
 public EmailsModel()
 {
     Pager = new PagerModel2(DbUtil.Db)
     {
         GetCount  = Count,
         Sort      = "Sent/Scheduled",
         Direction = "desc",
     };
 }
示例#10
0
 public TransactionsModel()
 {
     Pager           = new PagerModel2(Count);
     Pager.Sort      = "Date";
     Pager.Direction = "desc";
     finance         = HttpContext.Current.User.IsInRole("Finance");
     isSage          = OnlineRegModel.GetTransactionGateway() == "sage";
     admin           = HttpContext.Current.User.IsInRole("Admin") || HttpContext.Current.User.IsInRole("ManageTransactions");
 }
示例#11
0
 public CheckinTimeModel()
 {
     Pager = new PagerModel2();
     Pager.setCountDelegate(Count);
     Pager.Direction = "desc";
     Pager.Sort = "Date/Time";
     var locs = Locations();
     location = DbUtil.Db.UserPreference("checkintimes-location", locs.FirstOrDefault());
 }
示例#12
0
 private void SetPager(int?page, int?pageSize)
 {
     Pager = new PagerModel2(Count);
     if (pageSize.HasValue)
     {
         Pager.PageSize = pageSize.Value;
     }
     Pager.Page = page;
 }
示例#13
0
        public CheckinTimeModel()
        {
            Pager = new PagerModel2();
            Pager.setCountDelegate(Count);
            Pager.Direction = "desc";
            Pager.Sort      = "Date/Time";
            var locs = Locations();

            location = DbUtil.Db.UserPreference("checkintimes-location", locs.FirstOrDefault());
        }
示例#14
0
        private void SetPager(int?page, int?pageSize)
        {
            Pager = new PagerModel2(DbUtil.Db)
            {
                GetCount = Count
            };
            if (pageSize.HasValue)
            {
                Pager.PageSize = pageSize.Value;
            }

            Pager.Page = page;
        }
示例#15
0
        private void LoadRecipients(int?page = null, int?pageSize = null)
        {
            var     cn     = DbUtil.Db.Connection;
            dynamic counts = cn.Query(@"
SELECT
	COUNT(*) AS Total
	,(SELECT COUNT(DISTINCT PeopleId) FROM dbo.EmailResponses WHERE EmailQueueId = @emailQueueId) AS NumberOpened
	,(SELECT COUNT(*) FROM dbo.EmailQueueToFail WHERE Id = @emailQueueId) AS NumberFailed
FROM dbo.EmailQueueTo eqt
WHERE eqt.Id = @emailQueueId
", new { emailQueueId = Id }).Single();

            CountOfAllRecipients       = counts.Total;
            CountOfOpenedRecipients    = counts.NumberOpened;
            CountOfFailedRecipients    = counts.NumberFailed;
            CountOfNotOpenedRecipients = CountOfAllRecipients - CountOfOpenedRecipients;

            switch (FilterType)
            {
            case FilterType.All:
                _count = CountOfAllRecipients;
                break;

            case FilterType.Opened:
                _count = CountOfOpenedRecipients;
                break;

            case FilterType.NotOpened:
                _count = CountOfNotOpenedRecipients;
                break;

            case FilterType.Failed:
                _count = CountOfFailedRecipients;
                break;

            default:
                _count = CountOfAllRecipients;
                Pager  = new PagerModel2(DbUtil.Db)
                {
                    GetCount = Count
                };
                break;
            }

            SetPager(page, pageSize);
            Recipients = GetRecipients();
        }
示例#16
0
 public EmailsModel()
 {
     Pager = new PagerModel2(Count);
     Pager.Sort = "Sent/Scheduled";
     Pager.Direction = "desc";
 }
示例#17
0
        private void LoadRecipients(int? page = null, int? pageSize = null)
        {
            var cn = DbUtil.Db.Connection;
            dynamic counts = cn.Query(@"
SELECT
	COUNT(*) AS Total
	,(SELECT COUNT(DISTINCT PeopleId) FROM dbo.EmailResponses WHERE EmailQueueId = @emailQueueId) AS NumberOpened
	,(SELECT COUNT(*) FROM dbo.EmailQueueToFail WHERE Id = @emailQueueId) AS NumberFailed
FROM dbo.EmailQueueTo eqt
WHERE eqt.Id = @emailQueueId
", new { emailQueueId = Id }).Single();

            CountOfAllRecipients = counts.Total;
            CountOfOpenedRecipients = counts.NumberOpened;
            CountOfFailedRecipients = counts.NumberFailed;
            CountOfNotOpenedRecipients = CountOfAllRecipients - CountOfOpenedRecipients;

            switch (FilterType)
            {
                case FilterType.All:
                    _count = CountOfAllRecipients;
                    break;
                case FilterType.Opened:
                    _count = CountOfOpenedRecipients;
                    break;
                case FilterType.NotOpened:
                    _count = CountOfNotOpenedRecipients;
                    break;
                case FilterType.Failed:
                    _count = CountOfFailedRecipients;
                    break;
                default:
                    _count = CountOfAllRecipients;
                    Pager = new PagerModel2(Count);
                    break;
            }

            SetPager(page, pageSize);
            Recipients = GetRecipients();
        }
示例#18
0
 private void SetPager(int? page, int? pageSize)
 {
     Pager = new PagerModel2(Count);
     if (pageSize.HasValue)
         Pager.PageSize = pageSize.Value;
     Pager.Page = page;
 }
示例#19
0
 private void Populate()
 {
     Pager = new PagerModel2(Count);
     var i = (from mm in DbUtil.Db.OrganizationMembers
              where mm.OrganizationId == OrgId && mm.PeopleId == PeopleId
              select new
                  {
                      mm,
                      mm.Person.Name,
                      mm.Organization.OrganizationName,
                  }).SingleOrDefault();
     Name = i.Name;
     OrgName = i.OrganizationName;
 }
示例#20
0
 public SMSModel()
 {
     Pager = new PagerModel2(Count);
 }
示例#21
0
 public SavedQueryModel()
 {
     Pager = new PagerModel2(Count);
     Pager.Direction = "asc";
     Pager.Sort = "Name";
 }
示例#22
0
 public EmailModel()
 {
     Pager  = new PagerModel2(Count);
     filter = "All";
 }
示例#23
0
 public EmailsModel()
 {
     Pager           = new PagerModel2(Count);
     Pager.Sort      = "Sent/Scheduled";
     Pager.Direction = "desc";
 }
示例#24
0
 public EmailModel()
 {
     Pager = new PagerModel2(Count);
     filter = "All";
 }
示例#25
0
 public OrgSearchModel()
 {
     Pager = new PagerModel2();
     Pager.GetCount = Count;
 }
示例#26
0
 public SearchAddModel()
 {
     Pager = new PagerModel2(Count);
     Pager.ShowPageSize = false;
 }
示例#27
0
 public SMSModel()
 {
     Pager = new PagerModel2(Count);
 }