コード例 #1
0
        public IList<Core.Business.UserInLab> GetAllUserInLab()
        {
            IList<Core.Business.UserInLab> userInLablist = new List<Core.Business.UserInLab>();
            SqlServerUtility sql = new SqlServerUtility();

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

            if(reader != null)
            {
                while(reader.Read())
                {
                    Core.Business.UserInLab userInLab = new Core.Business.UserInLab();

                    if (!reader.IsDBNull(0)) userInLab.Id = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) userInLab.LabID = reader.GetGuid(1);
                    if (!reader.IsDBNull(2)) userInLab.UserID = reader.GetGuid(2);

                    userInLab.MarkOld();
                    userInLablist.Add(userInLab);
                }
                reader.Close();
            }
            return userInLablist;
        }
コード例 #2
0
        public IList<UserInLab> SelectUserInLabsByAndLabID(Guid labID)
        {
            IList<Core.Business.UserInLab> userInLablist = new List<Core.Business.UserInLab>();
            SqlServerUtility sql = new SqlServerUtility();
            sql.AddParameter("@LabID", SqlDbType.UniqueIdentifier, labID);
            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectUserInLabsByAndLabID");

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.UserInLab userInLab = new Core.Business.UserInLab();

                    if (!reader.IsDBNull(0)) userInLab.Id = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) userInLab.LabID = reader.GetGuid(1);
                    if (!reader.IsDBNull(2)) userInLab.UserID = reader.GetGuid(2);

                    userInLab.MarkOld();
                    userInLablist.Add(userInLab);
                }
                reader.Close();
            }
            return userInLablist;
        }