Esempio n. 1
0
        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());
 }
Esempio n. 3
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            _service.DeleteBranch(id);

            return(RedirectToAction("Index"));
        }