Example #1
0
        public Int32 InsertWithCredits()
        {
            var ug            = this;
            int creditshigher = ug.Creditshigher;
            int creditslower  = ug.Creditslower;
            //DataTable userGroupByCreditsHigherAndLower = UserGroup.GetUserGroupByCreditsHigherAndLower(creditshigher, creditslower);
            //if (userGroupByCreditsHigherAndLower.Rows.Count > 0) return false;
            // 检查该积分用户组是否存在
            var list = UserGroup.FindAllByCredits(creditshigher, creditslower);

            if (list.Count > 0)
            {
                return(-1);
            }

            if (!ug.Is管理团队)
            {
                var rs = SystemCheckCredits("add", ref creditshigher, ref creditslower, 0);
                if (rs == null)
                {
                    return(-1);
                }
            }

            ug.Creditshigher = creditshigher;
            ug.Creditslower  = creditslower;
            //UserGroup.CreateUserGroup(userGroupInfo);
            ug.Insert();
            //BBX.Data.OnlineUsers.AddOnlineList(userGroupInfo.GroupTitle);
            OnlineList.Add(ug.ID, ug.GroupTitle);
            //Caches.ReSetAdminGroupList();
            //Caches.ReSetUserGroupList();

            return(0);
        }
Example #2
0
        public static string GetGroupImg(int groupid)
        {
            string text = "";
            var    list = OnlineList.GetGroupIcons();

            if (list.Count > 0)
            {
                foreach (var item in list)
                {
                    if (item.GroupID == 0 && String.IsNullOrEmpty(text) || item.GroupID == groupid)
                    {
                        text = "<img src=\"" + BaseConfigs.GetForumPath + "images/groupicons/" + item.Img + "\" />";
                    }
                }
            }
            return(text);
        }