public async Task <ActionResult> Delete(Branch branch) { try { await _branchService.DeleteBranch(branch); return(RedirectToAction(nameof(Index))); } catch { return(RedirectToAction(nameof(Index))); } }
public ActionResult RemoveBranch(BranchModel Branch) { try { _branchService.DeleteBranch(Branch); _branchService.Save(); ModelState.Clear(); ViewData["Message"] = "1"; } catch { ViewData["Message"] = "0"; } return(View()); }
public async Task <IActionResult> DeleteConfirmed(int id) { _service.DeleteBranch(id); return(RedirectToAction("Index")); }