Example #1
0
        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();
            }
        }
Example #2
0
        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);
        }
Example #3
0
 /// <summary>
 /// Reader returns fields:
 ///		GroupId, GroupName, IMGroupId, ContactUid, OrgUid
 /// </summary>
 public static IDataReader GetGroup(int group_id)
 {
     return(DBGroup.GetGroup(group_id));
 }