public static bool CanDelete(int IMGroupId) { bool retval = Security.IsUserInGroup(InternalSecureGroups.Administrator); if (retval) // Check for users { using (IDataReader reader = DBIMGroup.GetListUsers(IMGroupId)) { if (reader.Read()) { retval = false; } } } if (retval) // Check for partner { DataTable table = DBIMGroup.GetIMGroup(IMGroupId, true); if (table.Rows.Count > 0) { if ((bool)table.Rows[0]["is_partner"]) { retval = false; } } } return(retval); }
/// <summary> /// Reader returns fields: /// UserId, Login, FirstName, LastName, Email, IsActive, IMGroupId, OriginalId /// </summary> public static IDataReader GetListUsers(int group_id) { return(DBIMGroup.GetListUsers(group_id)); }