Beispiel #1
0
        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));
            }
        }
Beispiel #2
0
 // 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));
 }
Beispiel #3
0
 public void DeleteBranch(int branchId)
 {
     _branchRepository.DeleteBranch(branchId);
 }