public BusinessObjects.Models.ResultsEnum deleteCounterById(int counterId, int bankId, int branchId) { try { BusinessObjects.Models.ResultsEnum checkDelete; using (TransactionScope scope = new TransactionScope()) { DataAccessLayer.DALCounter.DALCounter dALCounter = new DataAccessLayer.DALCounter.DALCounter(); checkDelete = dALCounter.deleteAllocateCounterServiceByCounterId(counterId, bankId); if (checkDelete == BusinessObjects.Models.ResultsEnum.deleted) { checkDelete = dALCounter.deleteCounterById(counterId, bankId, branchId); 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 deleteCounterById(int counterId, int bankId, int branchId) { try { BusinessObjects.Models.sqlResultsEnum checkDelete; using (TransactionScope scope = new TransactionScope()) { DataAccessLayer.DALCounter.DALCounter dALCounter = new DataAccessLayer.DALCounter.DALCounter(); checkDelete = dALCounter.deleteAllocateCounterServiceByCounterId(counterId, bankId); if (checkDelete == BusinessObjects.Models.sqlResultsEnum.success) { checkDelete = dALCounter.deleteCounterById(counterId, bankId, branchId); 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); } }