Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("UserId,UserName,MobileNumber,Address,Email,Password")] Users users)
        {
            if (id != users.UserId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(users);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UsersExists(users.UserId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(users));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("ShipmentId,DateStamp")] Shipments shipments)
        {
            if (id != shipments.ShipmentId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shipments);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ShipmentsExists(shipments.ShipmentId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(shipments));
        }
        public async Task <IActionResult> Edit(int id, [Bind("OrderNumber,OrderId,SellerId,Quantity,TotalPrice,Tax,DateStamp,Freight")] OrderDetails orderDetails)
        {
            if (id != orderDetails.OrderNumber)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(orderDetails);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrderDetailsExists(orderDetails.OrderNumber))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(orderDetails));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Edit(int id, [Bind("ProductId,SellerId,ProductName,MRP,SellingPrice,Discount,Vendor,CategoryId,Description")] Products products)
        {
            if (id != products.ProductId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(products);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProductsExists(products.ProductId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CategoryId"] = new SelectList(_context.Categories, "CategoryId", "CategoryName", products.CategoryId);
            ViewData["SellerId"]   = new SelectList(_context.Sellers, "SellerId", "Address", products.SellerId);
            return(View(products));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Edit(int id, [Bind("OrderId,ProductId,SellerId,UserId,OrderNumber,ShipmentId,PaymentId,DateStamp,EstimatedDeliveryDate")] Orders orders)
        {
            if (id != orders.OrderId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(orders);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrdersExists(orders.OrderId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["OrderNumber"] = new SelectList(_context.OrderDetails, "OrderNumber", "OrderNumber", orders.OrderNumber);
            ViewData["PaymentId"]   = new SelectList(_context.Payments, "PaymentId", "ModeOfPayment", orders.PaymentId);
            ViewData["ProductId"]   = new SelectList(_context.Products, "ProductId", "Description", orders.ProductId);
            ViewData["ShipmentId"]  = new SelectList(_context.Shipments, "ShipmentId", "ShipmentId", orders.ShipmentId);
            ViewData["UserId"]      = new SelectList(_context.Users, "UserId", "Address", orders.UserId);
            return(View(orders));
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> Edit(int id, [Bind("PaymentId,UserId,ModeOfPayment,DateStamp,Amount")] Payments payments)
        {
            if (id != payments.PaymentId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(payments);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PaymentsExists(payments.PaymentId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(payments));
        }
Ejemplo n.º 7
0
        public async Task <IActionResult> Edit(int id, [Bind("AccountNumber,SellerId,BankName,IFSC,MobileNumber")] SellerAccounts sellerAccounts)
        {
            if (id != sellerAccounts.AccountNumber)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sellerAccounts);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SellerAccountsExists(sellerAccounts.AccountNumber))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(sellerAccounts));
        }
Ejemplo n.º 8
0
        public async Task <IActionResult> Edit(int id, [Bind("CategoryId,Description,CategoryName")] Categories categories)
        {
            if (id != categories.CategoryId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(categories);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CategoriesExists(categories.CategoryId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(categories));
        }
Ejemplo n.º 9
0
        public async Task <IActionResult> Edit(int id, [Bind("SellerId,SellerName,MobileNumber,Address,Email,GSTNumber,AccountNumber")] Sellers sellers)
        {
            if (id != sellers.SellerId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sellers);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SellersExists(sellers.SellerId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AccountNumber"] = new SelectList(_context.SellerAccounts, "AccountNumber", "BankName", sellers.AccountNumber);
            return(View(sellers));
        }