예제 #1
0
 public ActionResult Delete(int branchId)
 {
     try
     {
         BusinessAccessLayer.BALBranches.BALBranches bALBranches  = new BusinessAccessLayer.BALBranches.BALBranches();
         BusinessObjects.Models.ResultsEnum          checkDeleted = bALBranches.deleteBranchById(branchId, ((BusinessObjects.Models.User)Session["UserObj"]).bankId);
         if (checkDeleted == BusinessObjects.Models.ResultsEnum.deleted)
         {
             return(RedirectToAction("Home"));
         }
         else
         {
             TempData["errorMsg"] = LangText.somethingWentWrongAlert;
             return(RedirectToAction("Home"));
         }
     }
     catch (Exception ex)
     {
         ExceptionsWriter.saveExceptionToLogFile(ex);
         return(View("Error"));
     }
 }
예제 #2
0
 public ActionResult Delete(int branchId)
 {
     try
     {
         BusinessAccessLayer.BALBranches.BALBranches bALBranches = new BusinessAccessLayer.BALBranches.BALBranches();
         ClaimsPrincipal principal = HttpContext.User as ClaimsPrincipal;
         var             bankId    = Convert.ToInt32(principal.FindFirst("BankId").Value);
         BusinessObjects.Models.sqlResultsEnum checkDeleted = bALBranches.deleteBranchById(branchId, bankId);
         if (checkDeleted == BusinessObjects.Models.sqlResultsEnum.success)
         {
             return(RedirectToAction("Home"));
         }
         else
         {
             TempData["errorMsg"] = LangText.somethingWentWrongAlert;
             return(RedirectToAction("Home"));
         }
     }
     catch (Exception ex)
     {
         ExceptionsWriter.saveEventsAndExceptions(ex, "Exceptions not handled", EventLogEntryType.Error);
         return(View("Error"));
     }
 }