public static void Delete(int group_id) { if (!CanDelete(group_id)) { throw new AccessDeniedException(); } int IMGroupId = -1; using (IDataReader reader = DBGroup.GetGroup(group_id)) { if (reader.Read()) { if (reader["IMGroupId"] != DBNull.Value) { IMGroupId = (int)reader["IMGroupId"]; } } } using (DbTransaction tran = DbTransaction.Begin()) { DBGroup.Delete(group_id); if (IMGroupId > 0) { IMGroup.Delete(IMGroupId); } tran.Commit(); } }
public static string GetGroupName(int group_id) { string GroupName = ""; using (IDataReader reader = DBGroup.GetGroup(group_id)) { if (reader.Read()) { GroupName = reader["GroupName"].ToString(); } } return(GroupName); }
/// <summary> /// Reader returns fields: /// GroupId, GroupName, IMGroupId, ContactUid, OrgUid /// </summary> public static IDataReader GetGroup(int group_id) { return(DBGroup.GetGroup(group_id)); }