コード例 #1
0
ファイル: 用户组.Biz.cs プロジェクト: xiongeee/BBX
        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);
        }
コード例 #2
0
ファイル: 在线.Biz.cs プロジェクト: xiongeee/BBX
        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);
        }