Пример #1
0
 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);
 }