Esempio n. 1
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);
     }
 }
Esempio n. 2
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);
     }
 }
Esempio n. 3
0
 public BusinessObjects.Models.ResultsEnum updateBranch(BusinessObjects.Models.Branch branch)
 {
     try
     {
         DataAccessLayer.DALBranches.DALBranches dALBranches = new DataAccessLayer.DALBranches.DALBranches();
         return(dALBranches.updateBranch(branch));
     }
     catch (Exception ex)
     {
         ExceptionsWriter.saveEventsAndExceptions(ex, "Exceptions not handled", EventLogEntryType.Error);
         return(BusinessObjects.Models.ResultsEnum.notUpdated);
     }
 }
Esempio n. 4
0
 public List <BusinessObjects.Models.Branch> selectBranchesByBankId(int pBankId)
 {
     try
     {
         DataAccessLayer.DALBranches.DALBranches dALBranches = new DataAccessLayer.DALBranches.DALBranches();
         return(dALBranches.selectBranchesByBankId(pBankId));
     }
     catch (Exception ex)
     {
         ExceptionsWriter.saveEventsAndExceptions(ex, "Exceptions not handled", EventLogEntryType.Error);
         return(null);
     }
 }
Esempio n. 5
0
 public BusinessObjects.Models.ResultsEnum updateBranch(BusinessObjects.Models.Branch branch)
 {
     try
     {
         DataAccessLayer.DALBranches.DALBranches dALBranches = new DataAccessLayer.DALBranches.DALBranches();
         return(dALBranches.updateBranch(branch));
     }
     catch (Exception ex)
     {
         ExceptionsWriter.saveExceptionToLogFile(ex);
         return(BusinessObjects.Models.ResultsEnum.notUpdated);
     }
 }
Esempio n. 6
0
 public List <BusinessObjects.Models.Branch> selectBranchesByBankId(int pBankId)
 {
     try
     {
         DataAccessLayer.DALBranches.DALBranches dALBranches = new DataAccessLayer.DALBranches.DALBranches();
         return(dALBranches.selectBranchesByBankId(pBankId));
     }
     catch (Exception ex)
     {
         ExceptionsWriter.saveExceptionToLogFile(ex);
         return(null);
     }
 }
Esempio n. 7
0
 public BusinessObjects.Models.Branch selectBranchById(int branchId, int bankId)
 {
     try
     {
         DataAccessLayer.DALBranches.DALBranches dALBranches = new DataAccessLayer.DALBranches.DALBranches();
         return(dALBranches.selectBranchById(branchId, bankId));
     }
     catch (Exception ex)
     {
         ExceptionsWriter.saveExceptionToLogFile(ex);
         return(null);
     }
 }