コード例 #1
0
        public static void CancelRatePosts(string ratelogidlist, int tid, string pid, int userid, string username, int groupid, string grouptitle, int forumid, string forumname, string reason)
        {
            if (!Utils.IsNumeric(pid))
            {
                return;
            }

            //var postid = pid.ToInt();

            //int posterid = Posts.GetPostInfo(tid, postid).Posterid;
            //if (posterid <= 0) return;
            var post = Post.FindByID(pid.ToInt());

            if (post == null)
            {
                return;
            }

            //string postTableId = TableList.GetPostTableId(tid);
            //DataTable dataTable = AdminRateLogs.LogList(ratelogidlist.Split(',').Length, 1, "id IN(" + ratelogidlist + ")");
            //foreach (DataRow dataRow in dataTable.Rows)
            //{
            //	TopicAdmins.SetPostRate(postTableId, pid.ToInt(), TypeConverter.ObjectToInt(dataRow["extcredits"]), (float)TypeConverter.ObjectToInt(dataRow["score"]), false);
            //	User.UpdateUserExtCredits(posterid, TypeConverter.ObjectToInt(dataRow["extcredits"]), -1f * TypeConverter.ObjectToFloat(dataRow["score"]));
            //}
            //AdminRateLogs.DeleteLog("[id] IN(" + ratelogidlist + ")");
            var list = RateLog.FindAllByIDs(ratelogidlist);

            foreach (var item in list)
            {
                SetPostRate(post.ID, item.ExtCredits, (float)item.Score, false);
                User.UpdateUserExtCredits(post.PosterID, item.ExtCredits, -1f * item.Score);
            }
            list.Delete();
            //if (AdminRateLogs.LogList(1, 1, "pid = " + pid).Rows.Count == 0)
            if (RateLog.SearchByPid(post.ID, 0, 1) == null)
            {
                //BBX.Data.Posts.CancelPostRate(pid, postTableId);
                post.Rate      = 0;
                post.RateTimes = 0;
                post.Update();
            }
            var topicInfo = Topic.FindByID(tid);

            ModeratorManageLog.Add(userid, username, groupid, grouptitle, forumid, forumname, tid, (topicInfo == null) ? "暂无标题" : topicInfo.Title, "撤消评分", reason);
        }
コード例 #2
0
ファイル: useradmin.cs プロジェクト: xiongeee/BBX
        private void DoBanUserOperation()
        {
            this.ispost = false;
            if (this.usergroupinfo.ReasonPm == 1 && Utils.StrIsNullOrEmpty(DNTRequest.GetString("reason")))
            {
                this.titlemessage = true;
                base.AddErrLine("请填写操作原因");
                return;
            }
            int    formInt = DNTRequest.GetFormInt("banexpirynew", -1);
            string text    = (formInt == 0) ? "29990101" : string.Format("{0:yyyyMMdd}", DateTime.Now.AddDays((double)formInt));
            string title;
            string actions;

            switch (DNTRequest.GetInt("bantype", -1))
            {
            case 0:
                Users.UpdateBanUser(CreditsFacade.GetCreditsUserGroupId((float)this.operateduser.Credits).ID, "0", this.operateduid);
                title   = string.Format("取消对 <a href=\"../../userinfo-{1}.aspx\" target=\"_blank\">{0}</a> 的禁止", this.operatedusername, this.operateduid);
                actions = "取消禁止";
                break;

            case 1:
                Users.UpdateBanUser(4, text, this.operateduid);
                title   = string.Format("禁止 <a href=\"../../userinfo-{1}.aspx\" target=\"_blank\">{0}</a> 发言", this.operatedusername, this.operateduid);
                actions = "禁止发言";
                break;

            case 2:
                Users.UpdateBanUser(5, text, this.operateduid);
                title   = string.Format("禁止 <a href=\"../../userinfo-{1}.aspx\" target=\"_blank\">{0}</a> 访问", this.operatedusername, this.operateduid);
                actions = "禁止访问";
                break;

            default:
                this.titlemessage = true;
                base.AddErrLine("错误的禁止类型");
                return;
            }
            ModeratorManageLog.Add(userid, username, usergroupid, usergroupinfo.GroupTitle, 0, "", 0, title, actions, DNTRequest.GetString("reason").Trim());
            this.ispost = true;
            base.SetShowBackLink(false);
            base.SetUrl(Utils.UrlDecode(ForumUtils.GetReUrl()));
            base.SetMetaRefresh();
            base.MsgForward("useradmin_succeed", true);
        }