Beispiel #1
0
        public List <SYS_User> SelectAllSYS_User()
        {
            List <SYS_User> sys_user   = new List <SYS_User>();
            DbDataReader    reader     = null;
            DbConnection    connection = _DbHelper.CreateConnection(Common.ConnectionString);

            connection.Open();
            try
            {
                reader = _DbHelper.ExecuteReader(connection, Common.DatabaseSchema + "[SYS_User_SelectAll]", (DbParameter[])null);
                if (reader.HasRows)
                {
                    SYS_UserDataAccess.SetListSYS_UserInfo(ref reader, ref sys_user);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format(" SYS_UserDataAccess.SelectAll: {0}", ex.Message));
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                connection.Close();
            }
            return(sys_user);
        }
Beispiel #2
0
        public List <SYS_User> SelectAllSYS_User_ofRoles(int ID)
        {
            List <SYS_User> sys_user   = new List <SYS_User>();
            DbDataReader    reader     = null;
            DbConnection    connection = _DbHelper.CreateConnection(Common.ConnectionString);

            connection.Open();
            try
            {
                List <DbParameter> para = new List <DbParameter>();
                para.Add(_DbHelper.CreateParameter("ID", ID, false));
                reader = _DbHelper.ExecuteReader(connection, Common.DatabaseSchema + "[SYS_User_SelectAll_ofRoles]", para.ToArray());
                if (reader.HasRows)
                {
                    SYS_UserDataAccess.SetListSYS_UserInfo(ref reader, ref sys_user);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format(" SYS_UserDataAccess.SelectAll_ofRoles: {0}", ex.Message));
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                connection.Close();
            }
            return(sys_user);
        }