public static CustomList <LoanProcess> GetAllLoanProcess(string loanCode) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <LoanProcess> LoanProcessCollection = new CustomList <LoanProcess>(); IDataReader reader = null; String sql = "select *from LoanProcess Where LoanCode='" + loanCode + "'"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { LoanProcess newLoanProcess = new LoanProcess(); newLoanProcess.SetData(reader); LoanProcessCollection.Add(newLoanProcess); } return(LoanProcessCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList <LoanProcess> GetAllLoanProcess() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <LoanProcess> LoanProcessCollection = new CustomList <LoanProcess>(); IDataReader reader = null; const String sql = "select *from LoanProcess"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { LoanProcess newLoanProcess = new LoanProcess(); newLoanProcess.SetData(reader); LoanProcessCollection.Add(newLoanProcess); } LoanProcessCollection.InsertSpName = "spInsertLoanProcess"; LoanProcessCollection.UpdateSpName = "spUpdateLoanProcess"; LoanProcessCollection.DeleteSpName = "spDeleteLoanProcess"; return(LoanProcessCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }