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


C# List.ToPagedList方法代码示例

本文整理汇总了C#中iTextSharp.text.List.ToPagedList方法的典型用法代码示例。如果您正苦于以下问题:C# List.ToPagedList方法的具体用法?C# List.ToPagedList怎么用?C# List.ToPagedList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在iTextSharp.text.List的用法示例。


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

示例1: NeverLogin

        public ActionResult NeverLogin(int? page, string searchTerm = null)
        {
            int pageNumber = (page ?? 1);
            var auditorList = _context.Users.OrderByDescending(s => s.LastLogin).
                Where(
                    p =>
                        (searchTerm == null || p.UserName.StartsWith(searchTerm)) &&
                        (p.LastLogin.Equals(p.OsysDateTime)));
            var indexViewModel = new List<UserReportModel1>();
            foreach (var n in auditorList)
            {
                if (n.Status == MyEnums.StatusOptions.Approved)
                {
                    var model = new UserReportModel1
                    {
                        Fullnames = n.FirstName +' '+ n.LastName,
                        Username = n.UserName,
                        CreatedOn = n.OsysDateTime,
                        Email = n.Email,
                        PhoneNumber = n.PhoneNumber,
                        Country = n.Country,
                        Enabled = n.Enabled,
                        StatusOptions = true

                    };
                    indexViewModel.Add(model);
                }
                else
                {
                    var model = new UserReportModel1
                    {
                        Fullnames = n.FirstName +' '+ n.LastName,
                        Username = n.UserName,
                        CreatedOn = n.OsysDateTime,
                        Email = n.Email,
                        PhoneNumber = n.PhoneNumber,
                        Country = n.Country,
                        Enabled = n.Enabled,
                        StatusOptions = false

                    };
                    indexViewModel.Add(model);
                }
            }
            _getVals.LogAudit(User.Identity.GetUserName(), "Viewed", Request.UserHostName, "Viewed Last Login Report ",
                "ISA", "UserManagement");
            return View(indexViewModel.ToPagedList(pageNumber, pageSize));
        }
开发者ID:ongeri,项目名称:citieuc,代码行数:48,代码来源:AccountReportsController.cs

示例2: SelectSalesOrder


//.........这里部分代码省略.........
            List<SalesOrder> SalesOrderList = new List<SalesOrder>();

            if (string.IsNullOrEmpty(searchOrderNo) && string.IsNullOrEmpty(searchCustomer) && string.IsNullOrEmpty(searchEmail))
            {
                qrySalesOrder = db.SalesOrders.OrderBy(slor => slor.SalesOrderNo);
                if (qrySalesOrder.Count() > 0)
                {
                    foreach (var item in qrySalesOrder)
                    {
                        bStatus = VerifyInvoiceSalesOrder(item);
                        if (bStatus == false)
                        {
                            SalesOrderList.Add(item);
                        }
                    }
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(searchEmail))
                {
                    ViewBag.SearchEmail = searchEmail;

                    qryAddress = db.CustomersContactAddresses.Where(ctad => ctad.Email.StartsWith(searchEmail));
                    if (qryAddress.Count() > 0)
                    {
                        foreach (var item in qryAddress)
                        {
                            nHas = Convert.ToInt32(item.CustomerId);
                            if (nHas > 0)
                            {
                                customerIdsList.Add(nHas);
                            }
                        }
                    }
                }

                if (!string.IsNullOrEmpty(searchCustomer))
                {
                    ViewBag.SearchCustomer = searchCustomer;

                    qryAddress = db.CustomersContactAddresses.Where(ctad => ctad.CompanyName.StartsWith(searchCustomer));
                    if (qryAddress.Count() > 0)
                    {
                        foreach (var item in qryAddress)
                        {
                            nHas = Convert.ToInt32(item.CustomerId);
                            if (nHas > 0)
                            {
                                customerIdsList.Add(nHas);
                            }
                        }
                    }
                }

                if (customerIdsList.Count > 0)
                {
                    foreach (var itemCustomer in customerIdsList)
                    {
                        qrySalesOrder = db.SalesOrders.Where(slor => slor.CustomerId == itemCustomer).OrderBy(slor => slor.SalesOrderNo);
                        if (qrySalesOrder.Count() > 0)
                        {
                            foreach (var item in qrySalesOrder)
                            {
                                SalesOrderList.Add(item);
                            }
                        }
                    }
                }

                if (!string.IsNullOrEmpty(searchOrderNo))
                {
                    ViewBag.SearchOrderNo = searchOrderNo;

                    qrySalesOrder = db.SalesOrders.Where(slor => slor.SalesOrderNo.StartsWith(searchOrderNo)).OrderBy(slor => slor.SalesOrderNo);
                    if (qrySalesOrder.Count() > 0)
                    {
                        foreach (var item in qrySalesOrder)
                        {
                            SalesOrderList.Add(item);
                        }
                    }

                }
            }

            //Set the page
            if (page == null)
            {
                pageIndex = 1;
            }
            else
            {
                pageIndex = Convert.ToInt32(page);
            }

            var onePageOfData = SalesOrderList.ToPagedList(pageIndex, pageSize);
            ViewBag.OnePageOfData = onePageOfData;
            return PartialView(SalesOrderList.ToPagedList(pageIndex, pageSize));
        }
开发者ID:andycarmona,项目名称:TimelyDepotUps,代码行数:101,代码来源:InvoiceController.cs

示例3: LastLogin

 public ActionResult LastLogin(int? page, string searchTerm = null)
 {
     int pageNumber = (page ?? 1);
     var auditorList = _context.Users.OrderByDescending(s => s.LastLogin).
         Where(p => searchTerm == null || p.UserName.StartsWith(searchTerm));
     var indexViewModel = new List<UserReportModel>();
     foreach (var n in auditorList)
     {
         var mygroup = _repository.Find<Group>(n.GroupId);
         //var days = n.LastLogin.Subtract(DateTime.Now).Days;
         var days = DateTime.Now.Subtract(n.LastLogin).Days;
         var model = new UserReportModel
         {
             Fullnames = n.FirstName +' '+ n.LastName,
             Username = n.UserName,
             Lastlogin = n.LastLogin,
             DaysLastLogin = days,
             Enabled = n.Enabled,
             StatusOptions = n.Status
         };
         indexViewModel.Add(model);
     }
     _getVals.LogAudit(User.Identity.GetUserName(), "Viewed", Request.UserHostName, "Viewed Last Login Report ",
         "ISA", "UserManagement");
     return View(indexViewModel.ToPagedList(pageNumber, pageSize));
 }
开发者ID:ongeri,项目名称:citieuc,代码行数:26,代码来源:AccountReportsController.cs

示例4: InvoiceList

        public PartialViewResult InvoiceList(int? page)
        {
            int pageIndex = 0;
            int pageSize = PageSize;

            TimelyDepotContext db01 = new TimelyDepotContext();

            InvoiceList theinvoicelist = null;
            List<InvoiceList> invoiceList = new List<InvoiceList>();

            var qrySalesOrder = db.CustomersContactAddresses.Join(db.Invoices, ctad => ctad.CustomerId, slod => slod.CustomerId, (ctad, slod)
                => new { ctad, slod }).OrderBy(cact => cact.slod.SalesOrderId);
            if (qrySalesOrder.Count() > 0)
            {
                foreach (var item in qrySalesOrder)
                {
                    theinvoicelist = new InvoiceList();
                    theinvoicelist.InvoiceId = item.slod.InvoiceId;
                    theinvoicelist.InvoiceNo = item.slod.InvoiceNo;
                    theinvoicelist.SODate = item.slod.ShipDate;
                    theinvoicelist.CustomerNo = GetCustomerDataInvoice(db01, item.ctad.CustomerId.ToString());
                    theinvoicelist.CompanyName = item.ctad.CompanyName;
                    theinvoicelist.PurchaseOrderNo = item.slod.PurchaseOrderNo;
                    theinvoicelist.SalesOrderNo = item.slod.SalesOrderNo;
                    theinvoicelist.PaymentAmount = GetInvoiceAmount(db01, item.slod.InvoiceId);

                    invoiceList.Add(theinvoicelist);
                }
            }

            //Set the page
            if (page == null)
            {
                pageIndex = 1;
            }
            else
            {
                pageIndex = Convert.ToInt32(page);
            }

            var onePageOfData = invoiceList.ToPagedList(pageIndex, pageSize);
            ViewBag.OnePageOfData = onePageOfData;
            return PartialView(invoiceList.ToPagedList(pageIndex, pageSize));
        }
开发者ID:andycarmona,项目名称:TimelyDepotUps,代码行数:44,代码来源:InvoiceController.cs

示例5: Index


//.........这里部分代码省略.........
                        qryInvoice = db.Invoices.Where(vd => vd.SalesOrderNo.StartsWith(searchItem)).OrderBy(vd => vd.SalesOrderNo);
                    }
                    else
                    {
                        qryInvoice = db.Invoices.Where(vd => vd.SalesOrderNo.StartsWith(searchItem)).OrderBy(vd => vd.SalesOrderNo);
                    }
                }

                if (ckCriteria == "shippeddate")
                {
                    szFecha = searchItem.Split('/');
                    if (szFecha != null)
                    {
                        nYear = Convert.ToInt32(szFecha[0]);
                        nMonth = Convert.ToInt32(szFecha[1]);
                        nDay = Convert.ToInt32(szFecha[2]);
                        dFecha = new DateTime(nYear, nMonth, nDay);
                    }

                    if (ckActive == "true")
                    {
                        qryInvoice = db.Invoices.Where(vd => vd.ShipDate >= dFecha).OrderBy(vd => vd.SalesOrderNo);
                    }
                    else
                    {
                        qryInvoice = db.Invoices.Where(vd => vd.ShipDate >= dFecha).OrderBy(vd => vd.SalesOrderNo);
                    }
                }

                if (ckCriteria == "customerpo")
                {
                    if (ckActive == "true")
                    {
                        qryInvoice = db.Invoices.Where(vd => vd.PurchaseOrderNo.StartsWith(searchItem)).OrderBy(vd => vd.PurchaseOrderNo);
                    }
                    else
                    {
                        qryInvoice = db.Invoices.Where(vd => vd.PurchaseOrderNo.StartsWith(searchItem)).OrderBy(vd => vd.PurchaseOrderNo);
                    }
                }

                if (ckCriteria == "customername")
                {
                    if (ckActive == "true")
                    {
                        var qryMainContact = db.Invoices.Join(db.CustomersContactAddresses, ctc => ctc.CustomerId, cus => cus.CustomerId, (ctc, cus)
                             => new { ctc, cus }).Where(Nctcs => Nctcs.cus.CompanyName.StartsWith(searchItem)).OrderBy(Nctcs => Nctcs.cus.CompanyName);
                        if (qryMainContact.Count() > 0)
                        {
                            foreach (var item in qryMainContact)
                            {
                                InvoiceList.Add(item.ctc);
                            }
                        }
                    }
                    else
                    {
                        var qryMainContact = db.Invoices.Join(db.CustomersContactAddresses, ctc => ctc.CustomerId, cus => cus.CustomerId, (ctc, cus)
                             => new { ctc, cus }).Where(Nctcs => Nctcs.cus.CompanyName.StartsWith(searchItem)).OrderBy(Nctcs => Nctcs.cus.CompanyName);
                        if (qryMainContact.Count() > 0)
                        {
                            foreach (var item in qryMainContact)
                            {
                                InvoiceList.Add(item.ctc);
                            }
                        }
                    }
                    bHasData = false;
                }
            }

            if (bHasData)
            {
                if (qryInvoice != null)
                {
                    if (qryInvoice.Count() > 0)
                    {
                        foreach (var item in qryInvoice)
                        {
                            InvoiceList.Add(item);
                        }
                    }

                }
            }
            //Set the page
            if (page == null)
            {
                pageIndex = 1;
            }
            else
            {
                pageIndex = Convert.ToInt32(page);
            }

            var onePageOfData = InvoiceList.ToPagedList(pageIndex, pageSize);
            ViewBag.OnePageOfData = onePageOfData;
            return View(InvoiceList.ToPagedList(pageIndex, pageSize));
            //return View(db.Invoices.ToList());
        }
开发者ID:andycarmona,项目名称:TimelyDepotUps,代码行数:101,代码来源:InvoiceController.cs

示例6: GetSalesDetailsSRC


//.........这里部分代码省略.........
            InvoiceDetail runcharge = null;
            InvoiceDetailSRC salesorderdetailSRC = null;
            ShipmentDetails shipped = null;

            List<InvoiceDetailSRC> salesdetailsList = new List<InvoiceDetailSRC>();
            List<KeyValuePair<string, string>> listSelector = new List<KeyValuePair<string, string>>();

            //qrysalesdetails = db.SalesOrderDetails.Where(sldt => sldt.SalesOrderId == nSalesOrderid).OrderBy(sldt => sldt.Sub_ItemID).ThenBy(sldt => sldt.ItemOrder);
            qrysalesdetails = db.InvoiceDetails.Where(sldt => sldt.InvoiceId == nSalesOrderid && sldt.ItemID != "").OrderBy(sldt => sldt.ItemPosition).ThenBy(sldt => sldt.ItemOrder);
            if (qrysalesdetails.Count() > 0)
            {
                foreach (var item in qrysalesdetails)
                {
                    salesorderdetailSRC = new InvoiceDetailSRC();
                    salesorderdetailSRC.BackOrderQuantity = item.BackOrderQuantity;
                    salesorderdetailSRC.Description = item.Description;
                    salesorderdetailSRC.Id = item.Id;
                    salesorderdetailSRC.ImprintMethod = item.ImprintMethod;
                    salesorderdetailSRC.ItemID = item.ItemID;
                    salesorderdetailSRC.ItemOrder = item.ItemOrder;
                    salesorderdetailSRC.ItemPosition = item.ItemPosition;
                    salesorderdetailSRC.Logo = item.Logo;
                    salesorderdetailSRC.Quantity = item.Quantity;
                    salesorderdetailSRC.SalesOrderId = item.InvoiceId;
                    salesorderdetailSRC.ShipQuantity = item.ShipQuantity;
                    salesorderdetailSRC.Sub_ItemID = item.Sub_ItemID;
                    salesorderdetailSRC.Tax = item.Tax;
                    salesorderdetailSRC.UnitPrice = item.UnitPrice;
                    salesorderdetailSRC.QuantitySC = 0;
                    salesorderdetailSRC.UnitPricSRC = 0;
                    salesorderdetailSRC.QuantityRC = 0;
                    salesorderdetailSRC.UnitPriceRC = 0;

                    //Set Up Charge
                    szSalesOredidHlp = string.Format("Set up Charge {0} {1}", salesorderdetailSRC.SalesOrderId.ToString(), salesorderdetailSRC.ItemID);
                    setupcharge = db01.InvoiceDetails.Where(stup => stup.InvoiceId == item.InvoiceId && stup.Description == szSalesOredidHlp).FirstOrDefault<InvoiceDetail>();
                    if (setupcharge != null)
                    {
                        salesorderdetailSRC.QuantitySC = setupcharge.Quantity;
                        salesorderdetailSRC.UnitPricSRC = setupcharge.UnitPrice;
                    }
                    //Run Charge
                    szSalesOredidHlp = string.Format("Run Charge {0} {1}", salesorderdetailSRC.SalesOrderId.ToString(), salesorderdetailSRC.ItemID);
                    runcharge = db01.InvoiceDetails.Where(stup => stup.InvoiceId == item.InvoiceId && stup.Description == szSalesOredidHlp).FirstOrDefault<InvoiceDetail>();
                    if (runcharge != null)
                    {
                        salesorderdetailSRC.QuantityRC = runcharge.Quantity;
                        salesorderdetailSRC.UnitPriceRC = runcharge.UnitPrice;
                    }

                    salesdetailsList.Add(salesorderdetailSRC);

                    //Get the shipped items
                    shipped = db01.ShipmentDetails.Where(shpdtl => shpdtl.DetailId == item.Id).FirstOrDefault<ShipmentDetails>();
                    if (shipped != null)
                    {
                        if (string.IsNullOrEmpty(szShipped))
                        {
                            szShipped = string.Format("lkshiped_{0}", item.Id);
                        }
                        else
                        {
                            szShipped = string.Format("{0};lkshiped_{1}", szShipped ,item.Id);
                        }
                    }

                }
            }
            ViewBag.SalesOrderId = salesorderid;
            if (!string.IsNullOrEmpty(szShipped))
            {
                ViewBag.ShippedItems = szShipped;
            }

            //Get the imprint methods
            qryImprint = db.ImprintMethods.OrderBy(trd => trd.Description);
            if (qryImprint.Count() > 0)
            {
                foreach (var item in qryImprint)
                {
                    listSelector.Add(new KeyValuePair<string, string>(item.Description, item.Description));
                }
            }
            SelectList imprintlist = new SelectList(listSelector, "Key", "Value");
            ViewBag.ImprintList = imprintlist;

            //Set the page
            if (page == null)
            {
                pageIndex = 1;
            }
            else
            {
                pageIndex = Convert.ToInt32(page);
            }

            var onePageOfData = salesdetailsList.ToPagedList(pageIndex, pageSize);
            ViewBag.OnePageOfData = onePageOfData;
            return PartialView(salesdetailsList.ToPagedList(pageIndex, pageSize));
        }
开发者ID:andycarmona,项目名称:TimelyDepotUps,代码行数:101,代码来源:InvoiceController.cs

示例7: GetSalesDetails

        public PartialViewResult GetSalesDetails(int? page, string salesorderid)
        {
            int pageIndex = 0;
            int pageSize = PageSize;
            pageSize = 10;
            int nSalesOrderid = Convert.ToInt32(salesorderid);

            IQueryable<InvoiceDetail> qrysalesdetails = null;

            List<InvoiceDetail> salesdetailsList = new List<InvoiceDetail>();

            //qrysalesdetails = db.SalesOrderDetails.Where(sldt => sldt.SalesOrderId == nSalesOrderid).OrderBy(sldt => sldt.Sub_ItemID).ThenBy(sldt => sldt.ItemOrder);
            qrysalesdetails = db.InvoiceDetails.Where(sldt => sldt.InvoiceId == nSalesOrderid).OrderBy(sldt => sldt.ItemPosition).ThenBy(sldt => sldt.ItemOrder);
            if (qrysalesdetails.Count() > 0)
            {
                foreach (var item in qrysalesdetails)
                {
                    salesdetailsList.Add(item);
                }
            }
            ViewBag.SalesOrderId = salesorderid;

            //Set the page
            if (page == null)
            {
                pageIndex = 1;
            }
            else
            {
                pageIndex = Convert.ToInt32(page);
            }

            var onePageOfData = salesdetailsList.ToPagedList(pageIndex, pageSize);
            ViewBag.OnePageOfData = onePageOfData;
            return PartialView(salesdetailsList.ToPagedList(pageIndex, pageSize));
        }
开发者ID:andycarmona,项目名称:TimelyDepotUps,代码行数:36,代码来源:InvoiceController.cs

示例8: AddDetail

        public PartialViewResult AddDetail(string searchitem, string itemOrder, int? page, int salesorderid = 0, int itemPos = 0)
        {
            int pageIndex = 0;
            int pageSize = PageSize;
            pageSize = 15;

            IQueryable<SUB_ITEM> qrysubitem = null;

            List<SUB_ITEM> subitemList = new List<SUB_ITEM>();

            if (string.IsNullOrEmpty(searchitem))
            {
                qrysubitem = db.SUB_ITEM.OrderBy(sbit => sbit.Sub_ItemID);
            }
            else
            {
                ViewBag.SearchItem = searchitem;
                qrysubitem = db.SUB_ITEM.Where(sbit => sbit.Sub_ItemID.StartsWith(searchitem)).OrderBy(sbit => sbit.Sub_ItemID);
            }

            if (qrysubitem.Count() > 0)
            {
                foreach (var item in qrysubitem)
                {
                    subitemList.Add(item);
                }
            }

            ViewBag.SalesOrderId = salesorderid;
            ViewBag.ItemPos = itemPos;
            ViewBag.ItemOrder = itemOrder;

            //Set the page
            if (page == null)
            {
                pageIndex = 1;
            }
            else
            {
                pageIndex = Convert.ToInt32(page);
            }

            var onePageOfData = subitemList.ToPagedList(pageIndex, pageSize);
            ViewBag.OnePageOfData = onePageOfData;

            return PartialView(subitemList.ToPagedList(pageIndex, pageSize));
        }
开发者ID:andycarmona,项目名称:TimelyDepotUps,代码行数:47,代码来源:InvoiceController.cs


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