public async Task <IActionResult> Create([Bind("Id,InvoiceDate,Address,EmployeeId,UserId,Total")] Invoice invoice) { if (ModelState.IsValid) { _context.Add(invoice); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(invoice)); }
public async Task <IActionResult> Create([Bind("UserId,Email,Password,FullName,Gender,Dob,Phonenumber,Address,Image")] StoreUser storeUser) { if (ModelState.IsValid) { _context.Add(storeUser); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(storeUser)); }
public async Task <IActionResult> Create([Bind("ProductId,CategoryId,ProductCategory,ProductName,Image,Description,SalePrice,TimesBooked,Quantity")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(product)); }
public async Task <IActionResult> Create([Bind("Id_Invoice,ProductId,Quantity")] InvoiceDetail invoiceDetail) { if (ModelState.IsValid) { _context.Add(invoiceDetail); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(invoiceDetail)); }
public async Task <IActionResult> Create([Bind("ProductCategory_ID,PD_Name,PD_Description")] ProductCategory productCategory) { if (ModelState.IsValid) { _context.Add(productCategory); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(productCategory)); }
public async Task <IActionResult> AddOrEditEmployee([Bind("EmployeeId,EmpCode,Position,OfficeLocation,HireDate,BaseSalary")] Employee employee) { if (ModelState.IsValid) { if (employee.EmployeeId == 0) { _context.Add(employee); } else { _context.Update(employee); } await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(employee)); }