コード例 #1
0
        public async Task <IActionResult> Edit(Guid id, [Bind("CartProductID,CartId,ProductID,ProductQuantityOrdered,ProductPrice,AddressId,TotalAmount,LastModifiedDateTime")] CartProduct cartProduct)
        {
            if (id != cartProduct.CartProductID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cartProduct);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CartProductExists(cartProduct.CartProductID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cartProduct));
        }
コード例 #2
0
        public async Task <IActionResult> Edit(Guid id, [Bind("ProductID,ProductName,ProductColor,ProductSize,ProductMaterial,Category,ProductPrice,CreationDateTime,LastModifiedDateTime")] Product product)
        {
            if (id != product.ProductID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(product);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProductExists(product.ProductID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(product));
        }
コード例 #3
0
        public async Task <IActionResult> Edit(Guid id, [Bind("OrderDetailId,OrderId,IsCancelled,ProductID,ProductQuantityOrdered,ProductPrice,AddressId,TotalAmount,LastModifiedDateTime,DateOfOrder,OrderSerial")] OrderDetail orderDetail)
        {
            if (id != orderDetail.OrderDetailId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(orderDetail);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrderDetailExists(orderDetail.OrderDetailId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(orderDetail));
        }
コード例 #4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,CategoryName")] Category category)
        {
            if (id != category.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(category);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CategoryExists(category.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(category));
        }
コード例 #5
0
        public async Task <IActionResult> Edit(Guid id, [Bind("AdminID,AdminName,Email,Password,CreationDateTime,LastModifiedDateTime")] Admin admin)
        {
            if (id != admin.AdminID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(admin);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AdminExists(admin.AdminID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(admin));
        }
コード例 #6
0
        public async Task <IActionResult> Edit(Guid id, [Bind("CartId,AddressID,CustomerID,TotalQuantity,TotalAmount")] Cart cart)
        {
            if (id != cart.CartId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cart);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CartExists(cart.CartId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cart));
        }
コード例 #7
0
        public async Task <IActionResult> Edit(Guid id, [Bind("OrderCancelID,CartProductID,QuantityToBeCancelled,RefundAmount")] OrderCancel orderCancel)
        {
            if (id != orderCancel.OrderCancelID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(orderCancel);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrderCancelExists(orderCancel.OrderCancelID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(orderCancel));
        }
コード例 #8
0
        public async Task <IActionResult> Edit(Guid id, [Bind("CustomerID,CustomerName,Email,Password,CustomerMobile,CreationDateTime,LastModifiedDateTime")] Customer customer)
        {
            if (id != customer.CustomerID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(customer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CustomerExists(customer.CustomerID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer));
        }
コード例 #9
0
        public async Task <IActionResult> Edit(Guid id, [Bind("AddressID,AddressLine1,AddressLine2,Landmark,City,State,PinCode,CustomerID,CreationDateTime,LastModifiedDateTime")] Address address)
        {
            if (id != address.AddressID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(address);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AddressExists(address.AddressID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(address));
        }
コード例 #10
0
        public async Task <IActionResult> Edit(Guid id, [Bind("OrderId,CustomerID,DateOfOrder,TotalQuantity,LastModifiedDateTime,OrderAmount,OrderNumber")] Order order)
        {
            if (id != order.OrderId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(order);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrderExists(order.OrderId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(order));
        }
コード例 #11
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,ProductName,ProductDescription,ProductImageUrl")] Product product)
        {
            if (id != product.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(product);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProductExists(product.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(product));
        }