Beispiel #1
0
        public List <SYS_RightOfRoles> SelectAllSYS_RightOfRoles()
        {
            DbConnection conn = _DbHelper.CreateConnection(Common.ConnectionString);

            conn.Open();
            List <SYS_RightOfRoles> sys_rightofroles = new List <SYS_RightOfRoles>();
            DbDataReader            reader           = null;

            try
            {
                reader = _DbHelper.ExecuteReader(conn, Common.DatabaseSchema + "[SYS_RightOfRoles_SelectAll]", (DbParameter[])null);
                if (reader.HasRows)
                {
                    SYS_RightOfRolesDataAccess.SetListSYS_RightOfRolesInfo(ref reader, ref sys_rightofroles);
                }
                return(sys_rightofroles);
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format(" SYS_RightOfRolesDataAccess.SelectAll: {0}", ex.Message));
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                conn.Close();
            }
        }
Beispiel #2
0
        public SYS_RightOfRoles SelectSYS_RightOfRoles(int ID)
        {
            DbConnection conn = _DbHelper.CreateConnection(Common.ConnectionString);

            conn.Open();

            SYS_RightOfRoles sys_rightofroles = new SYS_RightOfRoles();
            DbDataReader     reader           = null;

            try
            {
                List <DbParameter> para = new List <DbParameter>();
                para.Add(_DbHelper.CreateParameter(FIELD_ID, ID, false));

                reader = _DbHelper.ExecuteReader(conn, Common.DatabaseSchema + "[SYS_RightOfRoles_SelectById]", para.ToArray());
                if (reader.HasRows && reader.Read())
                {
                    SYS_RightOfRolesDataAccess.SetSYS_RightOfRolesInfo(reader, ref sys_rightofroles);
                }
                return(sys_rightofroles);
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("SYS_RightOfRolesDataAccess.SelectById: {0}", ex.Message));
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                conn.Close();
            }
        }
Beispiel #3
0
        private static void SetListSYS_RightOfRolesInfo(ref DbDataReader reader, ref List <SYS_RightOfRoles> sys_rightofroless)
        {
            SYS_RightOfRoles sys_rightofroles = null;

            while (reader.Read())
            {
                sys_rightofroles = new SYS_RightOfRoles();
                SYS_RightOfRolesDataAccess.SetSYS_RightOfRolesInfo(reader, ref sys_rightofroles);
                sys_rightofroless.Add(sys_rightofroles);
            }
        }