コード例 #1
0
ファイル: BranchController.cs プロジェクト: ESDP-C-5/ESDP
        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());
 }
コード例 #3
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            _service.DeleteBranch(id);

            return(RedirectToAction("Index"));
        }