public async Task <IActionResult> Create([Bind("AdminId,UserName,Password")] Admin admin) { if (ModelState.IsValid) { _context.Add(admin); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(admin)); }
public async Task <IActionResult> Create([Bind("TableId,TableNumber")] OrderTable orderTable) { if (ModelState.IsValid) { _context.Add(orderTable); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(orderTable)); }
public async Task <IActionResult> Create([Bind("ProductId,ProductName,ProductQuantity,ProductPrice,ProductReceivedDate,ProductReceivedBy,ProductReturnDate,ProductReturnBy,ProductUpdatedDate,ProductUpdatedBy,SupplierId")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["SupplierId"] = new SelectList(_context.SupplierRegistration, "SupplierId", "SupplierId", product.SupplierId); return(View(product)); }
public async Task <IActionResult> Create([Bind("CustomerId,CustomerName,CustomerPhoneNumber,TableId")] CustomerRegistration customerRegistration) { if (ModelState.IsValid) { _context.Add(customerRegistration); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["TableId"] = new SelectList(_context.OrderTable, "TableId", "TableId", customerRegistration.TableId); return(View(customerRegistration)); }
public async Task <IActionResult> Create([Bind("StaffId,StaffName,StaffAddress,StaffCnic,StaffPhoneNumber,StaffJobStartDate,StaffJobEndDate,StaffRole,StaffShiftTime,AdminId")] StaffRegistration staffRegistration) { if (ModelState.IsValid) { _context.Add(staffRegistration); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AdminId"] = new SelectList(_context.Admin, "AdminId", "AdminId", staffRegistration.AdminId); return(View(staffRegistration)); }
public async Task <IActionResult> Create([Bind("SupplierId,SupplierName,SupplierPhoneNumber,SupplierCompany,AdminId")] SupplierRegistration supplierRegistration) { if (ModelState.IsValid) { _context.Add(supplierRegistration); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AdminId"] = new SelectList(_context.Admin, "AdminId", "AdminId", supplierRegistration.AdminId); return(View(supplierRegistration)); }
public async Task <IActionResult> Create([Bind("MenuId,MenuName,MenuDescription,MenuPriceHalf,MenuPriceFull,MenuQuantity,TableId")] OrderMenu orderMenu) { if (ModelState.IsValid) { _context.Add(orderMenu); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["TableId"] = new SelectList(_context.OrderTable, "TableId", "TableId", orderMenu.TableId); return(View(orderMenu)); }
public async Task <IActionResult> Create([Bind("PaymentId,SupplierId,Date,Credit,Cash")] Payment payment) { if (ModelState.IsValid) { _context.Add(payment); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["SupplierId"] = new SelectList(_context.SupplierRegistration, "SupplierId", "SupplierId", payment.SupplierId); return(View(payment)); }
public async Task <IActionResult> Create([Bind("FeedBackId,FeedBackDescription,FeedBackEnvironment,FeedBackStaffBehaviour,CustomerId")] FeedBack feedBack) { if (ModelState.IsValid) { _context.Add(feedBack); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CustomerId"] = new SelectList(_context.CustomerRegistration, "CustomerId", "CustomerId", feedBack.CustomerId); return(View(feedBack)); }
public async Task <IActionResult> Create([Bind("MenuId,MenuName,MenuDescription,MenuPriceHalf,MenuPriceFull,MenuUpdatedDate,MenuUpdatedBy,MenuCreatedDate,MenuCreatedBy,MenuStatus,AdminId")] MenuAdd menuAdd) { if (ModelState.IsValid) { _context.Add(menuAdd); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AdminId"] = new SelectList(_context.Admin, "AdminId", "AdminId", menuAdd.AdminId); return(View(menuAdd)); }
public async Task <IActionResult> Create([Bind("OrderId,TableId,MenuId")] Order order) { if (ModelState.IsValid) { _context.Add(order); await _context.SaveChangesAsync(); 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> Create([Bind("SaleId,OrderId,Date,ProductId,ProductName,ProductSoldOut,ProductRemain,SaleReportCreatedBy,SaleReportCreatedDate,SaleReportModifiedBy,SaleReportModifiedDate,AdminId")] Sale sale) { if (ModelState.IsValid) { _context.Add(sale); await _context.SaveChangesAsync(); 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> Create([Bind("StockId,SupplierId,ProductId,AdminId,StockAddedBy,StockAddedDate,StockModifiedDate,StockModifiedBy,UnitPrice,TotalAmount,ProductType,CurrentStock")] Stock stock) { if (ModelState.IsValid) { _context.Add(stock); await _context.SaveChangesAsync(); 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)); }