public async Task <IActionResult> Edit(int id, [Bind("CustomerID,CustomerName,ContactNumber,Expenses")] Clients clients) { if (id != clients.CustomerID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(clients); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClientsExists(clients.CustomerID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(clients)); }
public async Task <IActionResult> Edit(int id, [Bind("ProductID,ProductName,Company,Charges")] 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))); } return(View(product)); }
public async Task <IActionResult> Edit(int id, [Bind("SaloonID,SaloonName,SaloonAddress,Contact_Number")] Saloon saloon) { if (id != saloon.SaloonID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(saloon); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SaloonExists(saloon.SaloonID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(saloon)); }