public async Task <IActionResult> Create([Bind("id,First_Name,Last_Name,Contact_Number")] Customers customers) { if (ModelState.IsValid) { _context.Add(customers); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(customers)); }
public async Task <IActionResult> Create([Bind("id,address,number,email")] Location location) { if (ModelState.IsValid) { _context.Add(location); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(location)); }
public async Task <IActionResult> Create([Bind("id,Staff_Name,Staff_Position")] Staffs staffs) { if (ModelState.IsValid) { _context.Add(staffs); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(staffs)); }
public async Task <IActionResult> Create([Bind("id,Name,Price,Category")] Products products) { if (ModelState.IsValid) { _context.Add(products); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(products)); }
public async Task <IActionResult> Create([Bind("id,Productsid,Customersid,Locationid,StaffsId")] Sells sells) { if (ModelState.IsValid) { _context.Add(sells); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["Customersid"] = new SelectList(_context.Customers, "id", "id", sells.Customersid); ViewData["Locationid"] = new SelectList(_context.Location, "id", "id", sells.Locationid); ViewData["Productsid"] = new SelectList(_context.Products, "id", "id", sells.Productsid); ViewData["StaffsId"] = new SelectList(_context.Staffs, "id", "id", sells.StaffsId); return(View(sells)); }