public async Task <IActionResult> Create([Bind("CusId,CusName,CusPhone,CusEmail,CusAddress,CusPostalCode")] Customer customer) { if (ModelState.IsValid) { _context.Add(customer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(customer)); }
public async Task <IActionResult> Create([Bind("ProdId,ProdType,ProdSize,ProdMaterial,ProdQuantity,ProductBriefDescription")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(product)); }
public async Task <IActionResult> Create([Bind("EmpId,EmpName,EmpPhone,EmpEmail,EmpAddress,EmpPostalCode")] Employee employee) { if (ModelState.IsValid) { _context.Add(employee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(employee)); }
public async Task <IActionResult> Create([Bind("PaymentId,CreditCardId")] Payment payment) { if (ModelState.IsValid) { _context.Add(payment); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CreditCardId"] = new SelectList(_context.CreditCard, "CreditCardId", "CreditCardId", payment.CreditCardId); return(View(payment)); }
public async Task <IActionResult> Create([Bind("EmployeeLoginId,EmpId,Pass")] EmployeeLogin employeeLogin) { if (ModelState.IsValid) { _context.Add(employeeLogin); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EmpId"] = new SelectList(_context.Employee, "EmpId", "EmpId", employeeLogin.EmpId); return(View(employeeLogin)); }
public async Task <IActionResult> Create([Bind("CreditCardId,CusId,CreditCardNumber,CreditCardProvider,CreditCardHolderName,CreditCardSecurityCode")] CreditCard creditCard) { if (ModelState.IsValid) { _context.Add(creditCard); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CusId"] = new SelectList(_context.Customer, "CusId", "CusId", creditCard.CusId); return(View(creditCard)); }
public async Task <IActionResult> Create([Bind("OrderId,PaymentId,EmpId,ProdId,StatusUpdate")] Orders orders) { if (ModelState.IsValid) { _context.Add(orders); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EmpId"] = new SelectList(_context.Employee, "EmpId", "EmpId", orders.EmpId); ViewData["PaymentId"] = new SelectList(_context.Payment, "PaymentId", "PaymentId", orders.PaymentId); ViewData["ProdId"] = new SelectList(_context.Product, "ProdId", "ProdId", orders.ProdId); return(View(orders)); }