示例#1
0
        public async Task AddQuantityToItem(AddQuantityToProductBindingModel input)
        {
            var product = await this.context.Products.FirstOrDefaultAsync(p => p.Id == input.Id);

            product.Quantity += input.Quantity;

            await context.SaveChangesAsync();
        }
示例#2
0
        public async Task <IActionResult> ProductSingleOrder(AddQuantityToProductBindingModel input)
        {
            if (!this.ModelState.IsValid)
            {
                return(await this.ProductSingleOrder());
            }

            await this.productService.AddQuantityToItem(input);

            return(this.Redirect("/Admin/ProductOrder"));
        }