Exemplo n.º 1
0
        /// <summary>
        /// Deletes a AccessRole record
        /// </summary>
        public static int Delete(AccessRoleDO DO)
        {
            SqlParameter _AccessRoleID = new SqlParameter("AccessRoleID", SqlDbType.VarChar);

            _AccessRoleID.Value = DO.AccessRoleID;

            SqlParameter[] _params = new SqlParameter[] {
                _AccessRoleID
            };

            return DataCommon.ExecuteScalar("[dbo].[AccessRole_Delete]", _params, "dbo");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new AccessRole record
        /// </summary>
        public static void Create(AccessRoleDO DO)
        {
            SqlParameter _AccessRoleID = new SqlParameter("AccessRoleID", SqlDbType.VarChar);

            _AccessRoleID.Value = DO.AccessRoleID;

            SqlParameter[] _params = new SqlParameter[] {
                _AccessRoleID
            };

            DataCommon.ExecuteNonQuery("[dbo].[AccessRole_Insert]", _params, "dbo");
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets all AccessRole records
        /// </summary>
        public static AccessRoleDO[] GetAll()
        {
            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[AccessRole_GetAll]", new SqlParameter[] { }, "dbo");

            List<AccessRoleDO> objs = new List<AccessRoleDO>();

            while(sr.Read()){

                AccessRoleDO obj = new AccessRoleDO();

                obj.AccessRoleID = sr.GetString(sr.GetOrdinal("AccessRoleID"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Selects AccessRole records by PK
        /// </summary>
        public static AccessRoleDO[] GetByPK(String AccessRoleID)
        {
            SqlParameter _AccessRoleID = new SqlParameter("AccessRoleID", SqlDbType.VarChar);

            _AccessRoleID.Value = AccessRoleID;

            SqlParameter[] _params = new SqlParameter[] {
                _AccessRoleID
            };

            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[AccessRole_GetByPK]", _params, "dbo");

            List<AccessRoleDO> objs = new List<AccessRoleDO>();

            while(sr.Read())
            {
                AccessRoleDO obj = new AccessRoleDO();

                obj.AccessRoleID = sr.GetString(sr.GetOrdinal("AccessRoleID"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }