コード例 #1
0
        public IList<Core.Business.VirtualLaboratory> GetAllVirtualLaboratory()
        {
            IList<Core.Business.VirtualLaboratory> virtualLaboratorylist = new List<Core.Business.VirtualLaboratory>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectVirtualLaboratoriesAll");

            if(reader != null)
            {
                while(reader.Read())
                {
                    Core.Business.VirtualLaboratory virtualLaboratory = new Core.Business.VirtualLaboratory();

                    if (!reader.IsDBNull(0)) virtualLaboratory.Id = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) virtualLaboratory.Name = reader.GetString(1);
                    if (!reader.IsDBNull(2)) virtualLaboratory.Content = reader.GetString(2);
                    virtualLaboratory.MarkOld();
                    virtualLaboratorylist.Add(virtualLaboratory);
                }
                reader.Close();
            }
            return virtualLaboratorylist;
        }
コード例 #2
0
        public IList<VirtualLaboratory> SelectVirtualLaboratoriesDynamic(string sqlwhere, string orderwhere)
        {
            IList<Core.Business.VirtualLaboratory> virtualLaboratorylist = new List<Core.Business.VirtualLaboratory>();
            SqlServerUtility sql = new SqlServerUtility();
            sql.AddParameter("@WhereCondition", SqlDbType.NVarChar, sqlwhere);
            sql.AddParameter("@OrderByExpression", SqlDbType.NVarChar, orderwhere);

            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectVirtualLaboratoriesDynamic");

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.VirtualLaboratory virtualLaboratory = new Core.Business.VirtualLaboratory();

                    if (!reader.IsDBNull(0)) virtualLaboratory.Id = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) virtualLaboratory.Name = reader.GetString(1);
                    if (!reader.IsDBNull(2)) virtualLaboratory.Content = reader.GetString(2);
                    virtualLaboratory.MarkOld();
                    virtualLaboratorylist.Add(virtualLaboratory);
                }
                reader.Close();
            }
            return virtualLaboratorylist;
        }