Пример #1
0
        public async Task OnGetAsync()
        {
            MainLayout.ShoppingBasket = BasketHelper.GetBasket(HttpContext.Session);
            ViewData["MainLayout"]    = MainLayout;
            var userID = _um.GetUserId(User);
            var q      = await _ds.GetAllOrdersAsync();

            Orders = q.Where(o => o.UserID == userID);
            if (OrderId != 0)
            {
                Order = _ds.GetOrder(OrderId);
            }
        }
 public void OnGet(int?orderId)
 {
     if (orderId != null)
     {
         Order = _ds.GetOrder(orderId.Value);
     }
 }
Пример #3
0
        public async Task OnGetAsync()
        {
            var q = await _ds.GetAllOrdersAsync();

            UnProcessedOrders = q.Where(o => !o.IsProcessed).Count();
            TotalRevenue      = q.Where(o => o.IsProcessed).Select(o => _ds.GetOrder(o.Id).TotalPrice)
                                .Sum();
            FinishedOrders = q.Where(o => o.IsProcessed).Count();
        }
Пример #4
0
 public void OnGet()
 {
     if (OrderId != 0)
     {
         Order = _ds.GetOrder(OrderId);
         if (Order != null)
         {
             User = _userManager.Users.Where(u => u.Id == Order.UserID).FirstOrDefault();
         }
     }
 }