public IList<Core.Business.VirtualLabDataAnnex> GetAllVirtualLabDataAnnex() { IList<Core.Business.VirtualLabDataAnnex> virtualLabDataAnnexlist = new List<Core.Business.VirtualLabDataAnnex>(); SqlServerUtility sql = new SqlServerUtility(); SqlDataReader reader = sql.ExecuteSPReader("usp_SelectVirtualLabDataAnnexsAll"); if(reader != null) { while(reader.Read()) { Core.Business.VirtualLabDataAnnex virtualLabDataAnnex = new Core.Business.VirtualLabDataAnnex(); if (!reader.IsDBNull(0)) virtualLabDataAnnex.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) virtualLabDataAnnex.ContentID = reader.GetGuid(1); if (!reader.IsDBNull(2)) virtualLabDataAnnex.Name = reader.GetString(2); if (!reader.IsDBNull(3)) virtualLabDataAnnex.Url = reader.GetString(3); virtualLabDataAnnex.MarkOld(); virtualLabDataAnnexlist.Add(virtualLabDataAnnex); } reader.Close(); } return virtualLabDataAnnexlist; }
public Core.Business.VirtualLabDataAnnex Select(Guid id) { SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@ID", SqlDbType.UniqueIdentifier, id); SqlDataReader reader = sql.ExecuteSPReader("usp_SelectVirtualLabDataAnnex"); if (reader != null && !reader.IsClosed && reader.Read()) { Core.Business.VirtualLabDataAnnex virtualLabDataAnnex = new Core.Business.VirtualLabDataAnnex(); if (!reader.IsDBNull(0)) virtualLabDataAnnex.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) virtualLabDataAnnex.ContentID = reader.GetGuid(1); if (!reader.IsDBNull(2)) virtualLabDataAnnex.Name = reader.GetString(2); if (!reader.IsDBNull(3)) virtualLabDataAnnex.Url = reader.GetString(3); reader.Close(); return virtualLabDataAnnex; } else { if (reader != null && !reader.IsClosed) reader.Close(); return null; } }
public IList<Core.Business.VirtualLabDataAnnex> SelectByContentID(Guid IsonID) { IList<Core.Business.VirtualLabDataAnnex> virtualLabDataAnnexlist = new List<Core.Business.VirtualLabDataAnnex>(); SqlServerUtility sql = new SqlServerUtility(); string sqlstr = "SELECT * FROM [dbo].[VirtualLabDataAnnex] where contentID='"; sqlstr += IsonID.ToString()+"'"; SqlDataReader reader = sql.ExecuteSqlReader(sqlstr); if (reader != null) { while (reader.Read()) { Core.Business.VirtualLabDataAnnex virtualLabDataAnnex = new Core.Business.VirtualLabDataAnnex(); if (!reader.IsDBNull(0)) virtualLabDataAnnex.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) virtualLabDataAnnex.ContentID = reader.GetGuid(1); if (!reader.IsDBNull(2)) virtualLabDataAnnex.Name = reader.GetString(2); if (!reader.IsDBNull(3)) virtualLabDataAnnex.Url = reader.GetString(3); virtualLabDataAnnex.MarkOld(); virtualLabDataAnnexlist.Add(virtualLabDataAnnex); } reader.Close(); } return virtualLabDataAnnexlist; }