コード例 #1
0
        public IActionResult ListAll()
        {
            var result = new OrderListingViewModel {
                Orders = this._orders.All("")
            };

            return(View(result));
        }
コード例 #2
0
        public IActionResult List()
        {
            var userId = this.userManager.GetUserId(User);

            var result = new OrderListingViewModel {
                Orders = this.orders.All(userId)
            };

            return(View(result));
        }
コード例 #3
0
        public async Task <IActionResult> All(string orderBy = "Id", string orderDirection = "descending", int page = 1, int pageSize = 4)
        {
            var model = new OrderListingViewModel
            {
                Orders      = await this.orders.AllAsync(orderBy, orderDirection, page, pageSize),
                TotalOrders = await this.orders.TotalAsync(),
                CurrentPage = page,
                PageSize    = pageSize
            };

            return(View(model));
        }
コード例 #4
0
        public async Task <IActionResult> OrdersFromMe(string orderBy = "Id", string orderDirection = "Descending", int page = 1, int pageSize = 4)
        {
            var userId = this.userManager.GetUserId(User);

            var orders = await this.orders.OrdersFomMeAsync(userId, orderBy, orderDirection, page, pageSize);

            if (orders == null)
            {
                return(NotFound());
            }

            var model = new OrderListingViewModel
            {
                Orders      = orders,
                CurrentPage = page,
                PageSize    = pageSize,
                TotalOrders = await this.orders.TotalByUserAsync(userId)
            };

            return(View(model));
        }