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); } }
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); } }
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); } }
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); } }
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); } }
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); } }
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); } }