コード例 #1
0
        public ActionResult Index(int page = 1, string sort = "Name", string sortDir = "Ascending")
        {
            int totalRecords = 10;
            IEnumerable<NewOrder> orders = new List<NewOrder>() { new NewOrder {
                                                                          ID = 123,
                                                                          Auto="auto1",
                                                                          ClientName="Client1",
                                                                          Email="test1@gmail",
                                                                          Phone="380671112233",
                                                                          Status = e_StatusOrder.NotProcessed},
                                                              new NewOrder {
                                                                          ID = 321,
                                                                          Auto="auto2",
                                                                          ClientName="Client2",
                                                                          Email="test2@gmail",
                                                                          Phone="380671112233",
                                                                          Status = e_StatusOrder.Processed},
                                                                          };

            PagedOrdersModel<NewOrder> model = new PagedOrdersModel<NewOrder>
            {
                PageSize = pageSize,
                PageNumber = page,
                Orders = orders,
                TotalRows = totalRecords
            };

            if (Request.IsAjaxRequest())
            { return PartialView("AjaxOrders_Grid", model); }

            return View(model);
        }
コード例 #2
0
        public ActionResult OrdersHistory(int page = 1, string sort = "OrderDate", string sortDir = "Ascending")
        {
            int totalRecords = 10;
            IEnumerable<OrdersHistory> orders = new List<OrdersHistory>() {
                                                                        new OrdersHistory { OrderDate=10102010,
                                                                                           Auto="Mecredes",
                                                                                           OrderType= OrderType.InsuranceContract,
                                                                                           Mileage=123,
                                                                                           Cost=1200,
                                                                                           State="IsMade"
                                                                                         },
                                                                         new OrdersHistory { OrderDate=10052011,
                                                                                            Auto="Ford",
                                                                                            OrderType= OrderType.InsuranceContract,
                                                                                            Mileage=5243,
                                                                                            Cost=10000,
                                                                                             State="IsMade"},
                                                                          new OrdersHistory { OrderDate=10052011,
                                                                                             Auto="Ford",
                                                                                             OrderType= OrderType.InsuranceContract,
                                                                                             Mileage=5243,
                                                                                             Cost=10000,
                                                                                             State="Performed"}
            };

            PagedOrdersModel<OrdersHistory> model = new PagedOrdersModel<OrdersHistory>
            {
                PageSize = pageSize,
                PageNumber = page,
                Orders = orders,
                TotalRows = totalRecords
            };

            if (Request.IsAjaxRequest())
            { return PartialView("AjaxOrdersHistory_Grid", model); }

            return View(model);
        }