public ActionResult Delete(BranchBE branch) { try { if (!ModelState.IsValid) { return(View(branch)); } branchRep.DeleteBranch(branch.Id); return(RedirectToAction("Index")); } catch (Exception ex) { ViewBag.Error = ex.Message; branch = branchRep.GetAllBranch(0).Find(x => x.Id == branch.Id); return(View(branch)); } }
// DELETE: api/Branch/5 /// <summary> /// Delete a branch by id /// </summary> /// <param name="id"></param> /// <returns>bool</returns> public bool Delete(int id) { return(_branchRepository.DeleteBranch(id)); }
public void DeleteBranch(int branchId) { _branchRepository.DeleteBranch(branchId); }