示例#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));
            }
        }
示例#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));
 }
示例#3
0
 public void DeleteBranch(int branchId)
 {
     _branchRepository.DeleteBranch(branchId);
 }