示例#1
0
 public BusinessObjects.Models.sqlResultsEnum deleteBranchById(int branchId, int bankId)
 {
     try
     {
         BusinessObjects.Models.sqlResultsEnum checkDelete;
         using (TransactionScope scope = new TransactionScope())
         {
             DataAccessLayer.DALBranches.DALBranches dALBranches = new DataAccessLayer.DALBranches.DALBranches();
             checkDelete = dALBranches.deleteCountersByBranchId(branchId, bankId);
             if (checkDelete == BusinessObjects.Models.sqlResultsEnum.success)
             {
                 checkDelete = dALBranches.deleteBranchById(branchId, bankId);
                 if (checkDelete == BusinessObjects.Models.sqlResultsEnum.success)
                 {
                     scope.Complete();
                 }
             }
         }
         return(checkDelete);
     }
     catch (Exception ex)
     {
         ExceptionsWriter.saveEventsAndExceptions(ex, "Exceptions not handled", EventLogEntryType.Error);
         return(BusinessObjects.Models.sqlResultsEnum.failed);
     }
 }
示例#2
0
 public BusinessObjects.Models.ResultsEnum deleteBranchById(int branchId, int bankId)
 {
     try
     {
         BusinessObjects.Models.ResultsEnum checkDelete;
         using (TransactionScope scope = new TransactionScope())
         {
             DataAccessLayer.DALBranches.DALBranches dALBranches = new DataAccessLayer.DALBranches.DALBranches();
             checkDelete = dALBranches.deleteCountersByBranchId(branchId, bankId);
             if (checkDelete == BusinessObjects.Models.ResultsEnum.deleted)
             {
                 checkDelete = dALBranches.deleteBranchById(branchId, bankId);
                 if (checkDelete == BusinessObjects.Models.ResultsEnum.deleted)
                 {
                     scope.Complete();
                 }
             }
         }
         return(checkDelete);
     }
     catch (Exception ex)
     {
         ExceptionsWriter.saveExceptionToLogFile(ex);
         return(BusinessObjects.Models.ResultsEnum.notDeleted);
     }
 }