示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("ProductId,ProductName,ProductQuantity,ProductPrice,ProductReceivedDate,ProductReceivedBy,ProductReturnDate,ProductReturnBy,ProductUpdatedDate,ProductUpdatedBy,SupplierId")] 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)));
            }
            ViewData["SupplierId"] = new SelectList(_context.SupplierRegistration, "SupplierId", "SupplierId", product.SupplierId);
            return(View(product));
        }
        public async Task <IActionResult> Edit(int id, [Bind("SaleId,OrderId,Date,ProductId,ProductName,ProductSoldOut,ProductRemain,SaleReportCreatedBy,SaleReportCreatedDate,SaleReportModifiedBy,SaleReportModifiedDate,AdminId")] Sale sale)
        {
            if (id != sale.SaleId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sale);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SaleExists(sale.SaleId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AdminId"]   = new SelectList(_context.Admin, "AdminId", "AdminId", sale.AdminId);
            ViewData["OrderId"]   = new SelectList(_context.Order, "OrderId", "OrderId", sale.OrderId);
            ViewData["ProductId"] = new SelectList(_context.Product, "ProductId", "ProductId", sale.ProductId);
            return(View(sale));
        }
        public async Task <IActionResult> Edit(int id, [Bind("OrderId,TableId,MenuId")] 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)));
            }
            ViewData["MenuId"]  = new SelectList(_context.OrderMenu, "MenuId", "MenuId", order.MenuId);
            ViewData["TableId"] = new SelectList(_context.OrderTable, "TableId", "TableId", order.TableId);
            return(View(order));
        }
        public async Task <IActionResult> Edit(int id, [Bind("CustomerId,CustomerName,CustomerPhoneNumber,TableId")] CustomerRegistration customerRegistration)
        {
            if (id != customerRegistration.CustomerId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(customerRegistration);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CustomerRegistrationExists(customerRegistration.CustomerId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TableId"] = new SelectList(_context.OrderTable, "TableId", "TableId", customerRegistration.TableId);
            return(View(customerRegistration));
        }
        public async Task <IActionResult> Edit(int id, [Bind("SupplierId,SupplierName,SupplierPhoneNumber,SupplierCompany,AdminId")] SupplierRegistration supplierRegistration)
        {
            if (id != supplierRegistration.SupplierId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(supplierRegistration);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SupplierRegistrationExists(supplierRegistration.SupplierId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AdminId"] = new SelectList(_context.Admin, "AdminId", "AdminId", supplierRegistration.AdminId);
            return(View(supplierRegistration));
        }
        public async Task <IActionResult> Edit(int id, [Bind("StaffId,StaffName,StaffAddress,StaffCnic,StaffPhoneNumber,StaffJobStartDate,StaffJobEndDate,StaffRole,StaffShiftTime,AdminId")] StaffRegistration staffRegistration)
        {
            if (id != staffRegistration.StaffId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(staffRegistration);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StaffRegistrationExists(staffRegistration.StaffId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AdminId"] = new SelectList(_context.Admin, "AdminId", "AdminId", staffRegistration.AdminId);
            return(View(staffRegistration));
        }
        public async Task <IActionResult> Edit(int id, [Bind("PaymentId,SupplierId,Date,Credit,Cash")] Payment payment)
        {
            if (id != payment.PaymentId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(payment);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PaymentExists(payment.PaymentId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["SupplierId"] = new SelectList(_context.SupplierRegistration, "SupplierId", "SupplierId", payment.SupplierId);
            return(View(payment));
        }
        public async Task <IActionResult> Edit(int id, [Bind("MenuId,MenuName,MenuDescription,MenuPriceHalf,MenuPriceFull,MenuQuantity,TableId")] OrderMenu orderMenu)
        {
            if (id != orderMenu.MenuId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(orderMenu);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrderMenuExists(orderMenu.MenuId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TableId"] = new SelectList(_context.OrderTable, "TableId", "TableId", orderMenu.TableId);
            return(View(orderMenu));
        }
示例#9
0
        public async Task <IActionResult> Edit(int id, [Bind("AdminId,UserName,Password")] 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));
        }
示例#10
0
        public async Task <IActionResult> Edit(int id, [Bind("TableId,TableNumber")] OrderTable orderTable)
        {
            if (id != orderTable.TableId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(orderTable);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrderTableExists(orderTable.TableId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(orderTable));
        }
        public async Task <IActionResult> Edit(int id, [Bind("FeedBackId,FeedBackDescription,FeedBackEnvironment,FeedBackStaffBehaviour,CustomerId")] FeedBack feedBack)
        {
            if (id != feedBack.FeedBackId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(feedBack);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FeedBackExists(feedBack.FeedBackId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CustomerId"] = new SelectList(_context.CustomerRegistration, "CustomerId", "CustomerId", feedBack.CustomerId);
            return(View(feedBack));
        }
        public async Task <IActionResult> Edit(int id, [Bind("MenuId,MenuName,MenuDescription,MenuPriceHalf,MenuPriceFull,MenuUpdatedDate,MenuUpdatedBy,MenuCreatedDate,MenuCreatedBy,MenuStatus,AdminId")] MenuAdd menuAdd)
        {
            if (id != menuAdd.MenuId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(menuAdd);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MenuAddExists(menuAdd.MenuId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AdminId"] = new SelectList(_context.Admin, "AdminId", "AdminId", menuAdd.AdminId);
            return(View(menuAdd));
        }
        public async Task <IActionResult> Edit(int id, [Bind("StockId,SupplierId,ProductId,AdminId,StockAddedBy,StockAddedDate,StockModifiedDate,StockModifiedBy,UnitPrice,TotalAmount,ProductType,CurrentStock")] Stock stock)
        {
            if (id != stock.StockId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(stock);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StockExists(stock.StockId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AdminId"]    = new SelectList(_context.Admin, "AdminId", "AdminId", stock.AdminId);
            ViewData["ProductId"]  = new SelectList(_context.Product, "ProductId", "ProductId", stock.ProductId);
            ViewData["SupplierId"] = new SelectList(_context.SupplierRegistration, "SupplierId", "SupplierId", stock.SupplierId);
            return(View(stock));
        }