public BESIMREG_DELIVEREDBYs GetSIMREG_DELIVEREDBYs(SQLHelper sqlHelper) { string sql = string.Empty; BESIMREG_DELIVEREDBYs SIMREG_DELIVEREDBYs = new BESIMREG_DELIVEREDBYs(); try { sql = sqlHelper.MakeSQL(@"SELECT * FROM SIMREG_DELIVEREDBY ORDER BY DELIVEREDBYID"); IDataReader reader = sqlHelper.ExecuteQuery(sql); AddToSIMREG_DELIVEREDBYCollection(SIMREG_DELIVEREDBYs, reader); reader.Close(); } catch (Exception ex) { throw new Exception(ex.Message); } return SIMREG_DELIVEREDBYs; }
public BESIMREG_DELIVEREDBY GetSIMREG_DELIVEREDBYbyUSERNAME(SQLHelper sqlHelper, string userName) { string sql = string.Empty; BESIMREG_DELIVEREDBYs SIMREG_DELIVEREDBYs = new BESIMREG_DELIVEREDBYs(); try { sql = sqlHelper.MakeSQL(@"SELECT * FROM SIMREG_DELIVEREDBY WHERE USERNAME=$s", userName); IDataReader reader = sqlHelper.ExecuteQuery(sql); AddToSIMREG_DELIVEREDBYCollection(SIMREG_DELIVEREDBYs, reader); reader.Close(); } catch (Exception ex) { throw new Exception(ex.Message); } if (SIMREG_DELIVEREDBYs.Count > 0) return SIMREG_DELIVEREDBYs[0]; else return new BESIMREG_DELIVEREDBY(); }
private BESIMREG_DELIVEREDBYs AddToSIMREG_DELIVEREDBYCollection(BESIMREG_DELIVEREDBYs SIMREG_DELIVEREDBYs, IDataReader reader) { NULLHandler nullHandler = new NULLHandler(reader); while (reader.Read()) { SIMREG_DELIVEREDBYs.Add(PreaperSIMREG_DELIVEREDBYObject(nullHandler)); } return SIMREG_DELIVEREDBYs; }