Пример #1
0
        // GET: Courier/Orders
        public ActionResult Orders()
        {
            IDateDao datesDb = DatesTableConnection.Instance;

            ViewBag.Dates = datesDb.GetAllDates();

            IOrderDao    ordersDb = OrdersTableConnection.Instance;
            List <Order> orders   = ordersDb.GetAllOrders().OrderBy(x => datesDb.GetDateById(x.DateId).Date).ToList();


            IPlayDao playsDb = PlaysTableConnection.Instance;

            ViewBag.Plays = playsDb.GetAllPlays();

            ILoginDao loginsDb = LoginsTableConnection.Instance;

            ViewBag.Logins = loginsDb.GetAllLogins();

            return(View(orders));
        }
Пример #2
0
        // GET: Courier/Orders
        public ActionResult Orders(int page = 1)
        {
            ViewBag.Dates = datesDb.GetAllDates();

            List <Order> filterOrder = (TempData["OrderList"] as List <Order>);
            List <Order> orders      = (filterOrder ?? ordersDb.GetAllOrders()).Where(order => order.Status != StatusOrder.Completed)
                                       .OrderBy(x => datesDb.GetDateById(x.DateId).Date).ToList();

            int sizeForPage = pageSize;

            pageSize = normalyPageSize;

            page = truePage(page, (int)Math.Ceiling((double)orders.Count / sizeForPage));

            ViewBag.Plays = playsDb.GetAllPlays();

            ViewBag.Logins = loginsDb.GetAllLogins();

            return(View(orders.ToPagedList(page, sizeForPage)));
        }
Пример #3
0
        public ActionResult Cart(int page = 1)
        {
            ViewBag.Dates = datesDb.GetAllDates();

            List <Order> filterOrder = (TempData["OrderList"] as List <Order>);

            List <Order> orders = filterOrder ?? ordersDb.GetOrdersByIdLogin(CurrentUserService.GetCurrentUser().Id)
                                  .OrderBy(x => datesDb.GetDateById(x.DateId).Date).ToList();

            ViewBag.Plays = playsDb.GetAllPlays();

            int sizeForPage = pageSize;

            pageSize = normalyPageSize;

            page = truePage(page, (int)Math.Ceiling((double)orders.Count / sizeForPage));

            ViewBag.Plays = playsDb.GetAllPlays();

            ViewBag.Logins = loginsDb.GetAllLogins();

            return(View(orders.ToPagedList(page, sizeForPage)));
        }