当前位置: 首页>>代码示例>>C#>>正文


C# PaginatedList类代码示例

本文整理汇总了C#中PaginatedList的典型用法代码示例。如果您正苦于以下问题:C# PaginatedList类的具体用法?C# PaginatedList怎么用?C# PaginatedList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PaginatedList类属于命名空间,在下文中一共展示了PaginatedList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetTransactions

        private TransactionList GetTransactions(DateTime startDate, 
                                                DateTime endDate, 
                                                string msisdn, 
                                                string gameTitle, 
                                                int portalId, 
                                                int? page)
        {
            if (page == null) page = 0;

            TransactionRepository transactionRepository = new TransactionRepository();
            var transactions = transactionRepository.GetTransactions(startDate,
                                                                     endDate,
                                                                     msisdn,
                                                                     gameTitle,
                                                                     portalId);

            var paginatedTransactions = new PaginatedList<Transaction>(transactions,
                                                                       (int)page,
                                                                       Settings.PageSize);

            // Khoa.Nguyen: Get GetInstallLastNotify in Store Procedure
            //foreach (Transaction trx in paginatedTransactions)
            //    trx.InstallStatus = transactionRepository.GetInstallLastNotify(trx.ID);

            var model = new TransactionList(paginatedTransactions,
                                            startDate,
                                            endDate,
                                            msisdn,
                                            gameTitle);
            model.PortalId = portalId;
            //return
            return model;
        }
开发者ID:khoa8e,项目名称:study,代码行数:33,代码来源:TransactionsController.cs

示例2: View

        public ActionResult @New(int? page, string domainname, string ext, string sortingmode)
        {
            //sortingmode: new, contraversial, hot, etc
            ViewBag.SortingMode = sortingmode;

            if (!sortingmode.Equals("new")) return RedirectToAction("Index", "Home");
            ViewBag.SelectedSubverse = "domains";
            ViewBag.SelectedDomain = domainname + "." + ext;

            const int pageSize = 25;
            int pageNumber = (page ?? 0);

            if (pageNumber < 0)
            {
                return View("~/Views/Errors/Error_404.cshtml");
            }

            //check if at least one submission for given domain was found, if not, send to a page not found error
            //IQueryable<Message> submissions = _db.Messages
            //    .Where(x => x.Name != "deleted" & x.Type == 2 & x.MessageContent.ToLower().Contains(domainname + "." + ext))
            //    .OrderByDescending(s => s.Date);

            IQueryable<Message> submissions = (from m in _db.Messages
                                               join s in _db.Subverses on m.Subverse equals s.name
                                               where !s.admin_disabled.Value && !m.IsDeleted & m.Type == 2 & m.MessageContent.ToLower().Contains(domainname + "." + ext)
                                               orderby m.Date descending
                                               select m);

            var paginatedSubmissions = new PaginatedList<Message>(submissions, page ?? 0, pageSize);

            ViewBag.Title = "Showing all newest submissions which link to " + domainname;
            return View("Index", paginatedSubmissions);
        }
开发者ID:Rumel,项目名称:voat,代码行数:33,代码来源:DomainsController.cs

示例3: Index

        // GET: Domains
        // GET: all submissions which link to given domain
        public ActionResult Index(int? page, string domainname, string ext, string sortingmode)
        {
            const int pageSize = 25;
            int pageNumber = (page ?? 0);

            if (pageNumber < 0)
            {
                return View("~/Views/Errors/Error_404.cshtml");
            }

            ViewBag.SelectedSubverse = "domains";
            ViewBag.SelectedDomain = domainname + "." + ext;

            // check if at least one submission for given domain was found, if not, send to a page not found error
            //IQueryable<Message> submissions = 
            //    _db.Messages
            //    .Where(
            //        x => x.Name != "deleted" & x.Type == 2 & x.MessageContent.ToLower().Contains(domainname + "." + ext))
            //    .OrderByDescending(s => s.Rank)
            //    .ThenByDescending(s => s.Date);

            //restrict disabled subs from result list
            IQueryable<Submission> submissions = (from m in _db.Submissions
                                                  join s in _db.Subverses on m.Subverse equals s.Name
                                               where !s.IsAdminDisabled.Value && !m.IsDeleted & m.Type == 2 & m.Content.ToLower().Contains(domainname + "." + ext)
                                               orderby m.Rank descending, m.CreationDate descending
                                               select m);

            var paginatedSubmissions = new PaginatedList<Submission>(submissions, page ?? 0, pageSize);

            ViewBag.Title = "Showing all submissions which link to " + domainname;
            return View("Index", paginatedSubmissions);
        }
开发者ID:CuteThalia,项目名称:voat,代码行数:35,代码来源:DomainsController.cs

示例4: BankAccountInformationList

 public List<AccountInformation> BankAccountInformationList(int pageIndex, int pageSize, string sortName, string sortOrder, ref int totalRows, int investorId)
 {
     using (DeepBlueEntities context = new DeepBlueEntities()) {
         IQueryable<AccountInformation> query = (from account in context.InvestorAccountsTable
                                                 where account.InvestorID == investorId
                                                 select new AccountInformation {
                                                     ABANumber = account.Routing,
                                                     AccountNumber = account.Account,
                                                     Attention = account.Attention,
                                                     AccountOf = account.AccountOf,
                                                     BankName = account.BankName,
                                                     ByOrderOf = account.ByOrderOf,
                                                     FFC = account.FFC,
                                                     FFCNumber = account.FFCNumber,
                                                     AccountId = account.InvestorAccountID,
                                                     IBAN = account.IBAN,
                                                     Reference = account.Reference,
                                                     Swift = account.SWIFT,
                                                     InvestorId = account.InvestorID
                                                 });
         query = query.OrderBy(sortName, (sortOrder == "asc"));
         PaginatedList<AccountInformation> paginatedList = new PaginatedList<AccountInformation>(query, pageIndex, pageSize);
         totalRows = paginatedList.TotalCount;
         return paginatedList;
     }
 }
开发者ID:jsingh,项目名称:DeepBlue,代码行数:26,代码来源:InvestorRepository.cs

示例5: GetCertificateDetail

        /// <summary>
        /// Get the certificate data with its documents paginated
        /// </summary>
        /// <param name="certificateId">Certificate id</param>
        /// <param name="searchHeader">Flag to know if it is required to get the certificate information or only the documents</param>
        public void GetCertificateDetail(int certificateId, bool searchHeader)
        {
            PaginatedList<Document> result = new PaginatedList<Document>();
            using (VocEntities db = new VocEntities())
            {
                //Get the certificate data detail
                if (searchHeader)
                {
                    Certificate =
                    (from certificate in db.Certificates.Include("EntryPoint")
                     where certificate.CertificateId == certificateId
                     select certificate).FirstOrDefault();
                }

                //Get the documents related to the certificate
                var querydocs = (from documents in db.Documents
                                 where documents.CertificateId == certificateId && documents.IsDeleted == false
                                 orderby documents.Certificate.IssuanceDate descending
                                 select documents);

                result.TotalCount = querydocs.Count();

                var supportDocument = querydocs.Where(doc => doc.DocumentType == DocumentTypeEnum.SupportingDocument).ToList();
                var releaseNotes = querydocs.Where(doc => doc.DocumentType == DocumentTypeEnum.ReleaseNote).ToList();
                supportDocument.AddRange(releaseNotes);

                var certificatDoc = querydocs.Where(doc => doc.DocumentType == DocumentTypeEnum.Certificate).FirstOrDefault();
                if (certificatDoc != null) supportDocument.Insert(0, certificatDoc);

                result.Collection = supportDocument;

                Documents = result;

            }
        }
开发者ID:ramirobr,项目名称:VOCIraq,代码行数:40,代码来源:CertificateDetailModel.cs

示例6: Index

        //
        // GET: /QuocGia/
        public ActionResult Index(int? page, string TuNgaySearch, string DenNgaySearch, string tenTaiKhoan)
        {
            int currentPageIndex = page.HasValue ? page.Value : 0;

            const int pageSize = 10;
            IFormatProvider provider = new System.Globalization.CultureInfo("en-CA", true);
            String datetime = TuNgaySearch;
            DateTime tn = new DateTime(1975, 1, 1);

            DateTime dn = DateTime.Now;
            if (TuNgaySearch != null && TuNgaySearch != "")
            {
                tn = DateTime.Parse(datetime, provider, System.Globalization.DateTimeStyles.NoCurrentDateDefault);
                //tnStr = tn.ToString("MM/dd/yyyy");
            }
            datetime = DenNgaySearch;
            if (DenNgaySearch != null && DenNgaySearch != "")
            {
                dn = DateTime.Parse(datetime, provider, System.Globalization.DateTimeStyles.NoCurrentDateDefault);
                //dnStr = dn.ToString("MM/dd/yyyy");
            }

            var objs = HistoryRes.FindAll(tenTaiKhoan, tn, dn);
            var paginatedAccounts = new PaginatedList<Histories>(objs, currentPageIndex, pageSize);

            return View(paginatedAccounts);
        }
开发者ID:hamedAly,项目名称:thuong-nghiep,代码行数:29,代码来源:HistoryController.cs

示例7: BookList

        public ActionResult BookList(int? pageIndex)
        {
            IQueryable<Book> books = unitOfWork.BookRepository.Get(orderBy: q => q.OrderBy(d => d.BookId));

            var bookList = new PaginatedList<Book>(books, pageIndex ?? 0, PAGESIZE);
            return View("BookList", bookList);
        }
开发者ID:kinpauln,项目名称:SMS,代码行数:7,代码来源:BooksController.cs

示例8: SearchUsers

        public PaginatedList<Common.User> SearchUsers(string query, int pageNumber, int pageSize)
        {
            var finalQuery = (from u in this.context.Users
                         select u);

            if (!string.IsNullOrWhiteSpace(query))
            {
                finalQuery = (from u in finalQuery
                              where u.Username.Contains(query) ||
                              u.Email.Contains(query) ||
                              u.FirstName.Contains(query) ||
                              u.LastName.Contains(query)
                              orderby u.CreateDateUtc descending
                              select u);
            }
            else
            {
                finalQuery = (from u in finalQuery
                              orderby u.CreateDateUtc descending
                              select u);
            }

            // convert to business paginated list with entity framework
            var list1 = new PaginatedList<User>(finalQuery, pageNumber, pageSize);
            var move = (from m in list1 select m.ToBusinessUser()).AsQueryable();
            return new PaginatedList<Common.User>(move, pageNumber, pageSize, list1.TotalCount);
        }
开发者ID:wes-cutting,项目名称:Sandbox-V2,代码行数:27,代码来源:SqlUserQueries.cs

示例9: CatalogueValueSearchModel

 public CatalogueValueSearchModel()
 {
     CatalogueSelectedName = string.Empty;
     BusinessApplicatioName = string.Empty;
     CatalogueSelectedId = Guid.Empty;
     SearchResult = new PaginatedList<CatalogueValue>();
 }
开发者ID:ramirobr,项目名称:VestalisV3,代码行数:7,代码来源:CatalogueValueSearchModel.cs

示例10: Index

        // GET: /Dinners/
        public ActionResult Index(int? page)
        {
            const int pageSize = 3;

            var upcomingDinners = dinnerRepository.FindUpcomingDinners();
            var paginatedDinners = new PaginatedList<Dinner>(upcomingDinners, page ?? 0, pageSize);
            return View("Index", paginatedDinners);
        }
开发者ID:brntsllvn,项目名称:NerdDinner,代码行数:9,代码来源:DinnersController.cs

示例11: SubscriptionList

 public SubscriptionList(PaginatedList<SubscriptionActivity> paginatedList, 
                         string msisdn, 
                         List<Subscriber> subscriber)
 {
     Msisdn = msisdn;
     PaginatedList = paginatedList;
     Subscriber = subscriber;
 }
开发者ID:khoa8e,项目名称:study,代码行数:8,代码来源:SubscriptionList.cs

示例12: GetTopicsFromCategory

        /// <summary>
        /// Gets all the topics from the parent category
        /// </summary>
        private void GetTopicsFromCategory()
        {
            // Before anything see if the category has been marked as private, if so make sure user is loggged in
            var currentCategory = Mapper.MapForumCategory(CurrentNode);
            var userHasAccess = true;
            if (MembershipHelper.IsAuthenticated())
            {
                // Member is logged in so it doesn't matter if forum is private or not,
                // now check they have enough karma to view this category and hide if not
                if (CurrentMember.MemberKarmaAmount < currentCategory.KarmaAccessAmount)
                {
                    userHasAccess = false;
                }
            }
            else
            {
                if (currentCategory.IsPrivate)
                {
                    userHasAccess = false;
                }
            }

            // Check to see if user has access
            if(!userHasAccess)
            {
                Response.Redirect(string.Concat(Settings.Url, "?m=", library.GetDictionaryItem("NoPermissionToViewPage")));
            }

            // Get the paging variable
            int? p = null;
            if (Request.QueryString["p"] != null)
                p = Convert.ToInt32(Request.QueryString["p"]);

            // Set cache variables
            var useNodeFactory = Request.QueryString["nf"] != null;
            var maintopics = from t in Factory.ReturnAllTopicsInCategory(CurrentNode.Id, true, useNodeFactory)
                             where !t.IsSticky
                             select t;

            if(!ShowAll)
            {
                maintopics = maintopics.Take(2);
                btnShowAll.Visible = true;
            }

            // Pass to my pager helper
            var pagedResults = new PaginatedList<ForumTopic>(maintopics, p ?? 0, Convert.ToInt32(Settings.TopicsPerPage));

            // Decide whether to show pager or not
            if (pagedResults.TotalPages > 1)
            {
                litPager.Text = pagedResults.ReturnPager();
            }

            // Now bind
            rptTopicList.DataSource = pagedResults;
            rptTopicList.DataBind();
        }
开发者ID:wakkomail,项目名称:community-framework,代码行数:61,代码来源:Discussions.ascx.cs

示例13: FindAll

        public ViewResult FindAll(int? page)
        {
            const int howManyRowsPerPage = 8;

            var petsSubset = _petRepository.FindAll().AsQueryable();
            var paginatedPets = new PaginatedList<Pet>(petsSubset, page ?? 0, howManyRowsPerPage);

            return View(paginatedPets);
        }
开发者ID:dgadd,项目名称:Vetrinarian-Administrator-Demo,代码行数:9,代码来源:PetManagementController.cs

示例14: UserSubmissions

        public ActionResult UserSubmissions(string id, int? page, string whattodisplay)
        {
                var userSubmissions = from b in _db.Submissions.OrderByDescending(s => s.CreationDate)
                                      where (b.UserName.Equals(id) && b.IsAnonymized == false) && (b.UserName.Equals(id) && b.Subverse1.IsAnonymized == false)
                                      select b;

                PaginatedList<Submission> paginatedUserSubmissions = new PaginatedList<Submission>(userSubmissions, page ?? 0, pageSize);

                return View("~/Views/Home/UserSubmitted.cshtml", paginatedUserSubmissions);
        }
开发者ID:CuteThalia,项目名称:voat,代码行数:10,代码来源:UserController.cs

示例15: UserComments

        public ActionResult UserComments(string id, int? page, string whattodisplay)
        {
                var userComments = from c in _db.Comments.OrderByDescending(c => c.CreationDate)
                                   where (c.UserName.Equals(id) && c.Submission.IsAnonymized == false) && (c.UserName.Equals(id) && c.Submission.Subverse1.IsAnonymized == false)
                                   select c;

                PaginatedList<Comment> paginatedUserComments = new PaginatedList<Comment>(userComments, page ?? 0, pageSize);

                return View("~/Views/Home/UserComments.cshtml", paginatedUserComments);
        }
开发者ID:CuteThalia,项目名称:voat,代码行数:10,代码来源:UserController.cs


注:本文中的PaginatedList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。