コード例 #1
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();
            }
        }
コード例 #2
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);
            }
        }