Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 /// <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));
 }