public Core.Business.InstrumentMainUser Select(Guid id) { SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, id); SqlDataReader reader = sql.ExecuteSPReader("usp_SelectInstrumentMainUser"); if (reader != null && !reader.IsClosed && reader.Read()) { Core.Business.InstrumentMainUser instrumentMainUser = new Core.Business.InstrumentMainUser(); if (!reader.IsDBNull(0)) instrumentMainUser.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) instrumentMainUser.Name = reader.GetString(1); reader.Close(); return instrumentMainUser; } else { if (reader != null && !reader.IsClosed) reader.Close(); return null; } }
public IEnumerable<InstrumentMainUser> GetInstrumentMainUse(Guid instrumentid) { IList<Core.Business.InstrumentMainUser> instrumentMainUserlist = new List<Core.Business.InstrumentMainUser>(); SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@id", SqlDbType.UniqueIdentifier, instrumentid); SqlDataReader reader = sql.ExecuteSqlReader(Sql_GetInstrumentMainUse); if (reader != null) { while (reader.Read()) { Core.Business.InstrumentMainUser instrumentMainUser = new Core.Business.InstrumentMainUser(); if (!reader.IsDBNull(0)) instrumentMainUser.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) instrumentMainUser.Name = reader.GetString(1); instrumentMainUser.MarkOld(); instrumentMainUserlist.Add(instrumentMainUser); } reader.Close(); } return instrumentMainUserlist; }
public IList<Core.Business.InstrumentMainUser> GetAllInstrumentMainUser() { IList<Core.Business.InstrumentMainUser> instrumentMainUserlist = new List<Core.Business.InstrumentMainUser>(); SqlServerUtility sql = new SqlServerUtility(); SqlDataReader reader = sql.ExecuteSPReader("usp_SelectInstrumentMainUsersAll"); if(reader != null) { while(reader.Read()) { Core.Business.InstrumentMainUser instrumentMainUser = new Core.Business.InstrumentMainUser(); if (!reader.IsDBNull(0)) instrumentMainUser.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) instrumentMainUser.Name = reader.GetString(1); instrumentMainUser.MarkOld(); instrumentMainUserlist.Add(instrumentMainUser); } reader.Close(); } return instrumentMainUserlist; }