/// <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"); }
/// <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"); }
/// <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(); }
/// <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(); }