public async Task <IActionResult> Edit(int id, [Bind("BranchID,BranchName,Address,OpeningTime,CloseingTime")] Banch banch) { if (id != banch.BranchID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(banch); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BanchExists(banch.BranchID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(banch)); }
public async Task <IActionResult> Create([Bind("BranchID,BranchName,Address,OpeningTime,CloseingTime")] Banch banch) { if (ModelState.IsValid) { _context.Add(banch); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(banch)); }