public BESIMREG_MSISDNs GetSIMREG_MSISDNs(SQLHelper sqlHelper) { string sql = string.Empty; BESIMREG_MSISDNs SIMREG_MSISDNs = new BESIMREG_MSISDNs(); try { sql = sqlHelper.MakeSQL(@"SELECT * FROM SIMREG_MSISDN ORDER BY MSISDNID"); IDataReader reader = sqlHelper.ExecuteQuery(sql); AddToSIMREG_MSISDNCollection(SIMREG_MSISDNs, reader); reader.Close(); } catch (Exception ex) { throw new Exception(ex.Message); } return SIMREG_MSISDNs; }
public BESIMREG_MSISDN GetSIMREG_MSISDN(SQLHelper sqlHelper, int SIMREG_MSISDNId) { string sql = string.Empty; BESIMREG_MSISDNs SIMREG_MSISDNs = new BESIMREG_MSISDNs(); try { sql = sqlHelper.MakeSQL(@"SELECT * FROM SIMREG_MSISDN WHERE MSISDNID=$n ORDER BY MSISDNID", SIMREG_MSISDNId); IDataReader reader = sqlHelper.ExecuteQuery(sql); AddToSIMREG_MSISDNCollection(SIMREG_MSISDNs, reader); reader.Close(); } catch (Exception ex) { throw new Exception(ex.Message); } if (SIMREG_MSISDNs.Count > 0) return SIMREG_MSISDNs[0]; else return new BESIMREG_MSISDN(); }
private BESIMREG_MSISDNs AddToSIMREG_MSISDNCollection(BESIMREG_MSISDNs SIMREG_MSISDNs, IDataReader reader) { NULLHandler nullHandler = new NULLHandler(reader); while (reader.Read()) { SIMREG_MSISDNs.Add(PreaperSIMREG_MSISDNObject(nullHandler)); } return SIMREG_MSISDNs; }