public IList<Core.Business.VirtualLabDataBigClass> GetBySql(string sqlwhere) { IList<Core.Business.VirtualLabDataBigClass> virtualLabDataBigClasslist = new List<Core.Business.VirtualLabDataBigClass>(); SqlServerUtility sql = new SqlServerUtility(); string sqlstr = "SELECT * FROM [dbo].[VirtualLabDataBigClass] where "; sqlstr += sqlwhere; SqlDataReader reader = sql.ExecuteSqlReader(sqlstr); if (reader != null) { while (reader.Read()) { Core.Business.VirtualLabDataBigClass virtualLabDataBigClass = new Core.Business.VirtualLabDataBigClass(); if (!reader.IsDBNull(0)) virtualLabDataBigClass.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) virtualLabDataBigClass.Name = reader.GetString(1); if (!reader.IsDBNull(2)) virtualLabDataBigClass.VirturlLabID = reader.GetGuid(2); virtualLabDataBigClass.MarkOld(); virtualLabDataBigClasslist.Add(virtualLabDataBigClass); } reader.Close(); } return virtualLabDataBigClasslist; }
public IList<Core.Business.VirtualLabDataBigClass> GetAllVirtualLabDataBigClass() { IList<Core.Business.VirtualLabDataBigClass> virtualLabDataBigClasslist = new List<Core.Business.VirtualLabDataBigClass>(); SqlServerUtility sql = new SqlServerUtility(); SqlDataReader reader = sql.ExecuteSPReader("usp_SelectVirtualLabDataBigClassesAll"); if(reader != null) { while(reader.Read()) { Core.Business.VirtualLabDataBigClass virtualLabDataBigClass = new Core.Business.VirtualLabDataBigClass(); if (!reader.IsDBNull(0)) virtualLabDataBigClass.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) virtualLabDataBigClass.Name = reader.GetString(1); if (!reader.IsDBNull(2)) virtualLabDataBigClass.VirturlLabID = reader.GetGuid(2); virtualLabDataBigClass.MarkOld(); virtualLabDataBigClasslist.Add(virtualLabDataBigClass); } reader.Close(); } return virtualLabDataBigClasslist; }