public void Load(PageView pageView)
        {
            Records = SerializeUtils.Deserialize(path) as List<RecordView>;

            int skipCount = pageView.PageSize * (pageView.CurrPage - 1);
            pageView.Total = Records.Count();
            pageView.SetPageCount();
            if (pageView.PageCount == 0)
                pageView.CurrPage = 0;
            pageView.Records = Records.OrderByDescending(n => n.CreateDate).Skip(skipCount).Take(pageView.PageSize).ToList();
        }
        public void Load(PageView pageView)
        {
            int skipCount = pageView.PageSize * (pageView.CurrPage - 1);

            var query = from r in Context.Records
                        select new RecordView
                        {
                            Id = r.Id,
                            Account = r.Account,
                            Type = r.Type,
                            Creator = r.Users.Id,
                            CreateDate = r.CreateDate,
                            LastModifyDate = r.LastModifyDate,
                            Remark = r.Remark
                        };

            pageView.Total = query.Count();
            pageView.SetPageCount();
            if (pageView.PageCount == 0)
                pageView.CurrPage = 0;
            pageView.Records = query.ToList().Skip(skipCount).Take(pageView.PageSize).ToList();
        }
Beispiel #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            string dbType = ConfigurationSettings.AppSettings["DBType"];

            if (dbType.Equals("Filesystem", StringComparison.CurrentCultureIgnoreCase))
            {
                RecordLogic = new PersonalCenter.Service.Impl.Filesystem.Record.RecordLogic();
                UserLogic = new PersonalCenter.Service.Impl.Filesystem.User.UserLogic();
            }
            else
            {
                RecordLogic = new PersonalCenter.Service.Impl.Database.Record.RecordLogic();
                UserLogic = new PersonalCenter.Service.Impl.Database.User.UserLogic();
            }

            Pager = new PageView();

            Init();

            siStatus.Caption = string.Format("����,{0}��", CurrUser.Uname);
            siDate.Caption = string.Format(DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToShortTimeString());
        }