Beispiel #1
0
        private int GetRecordCount()
        {
            var size     = DataGrid1.PageSize;
            var startRow = DataGrid1.CurrentPageIndex * size;

            return(ModeratorManageLog.SearchCount(others.Text, Username.Text, postdatetimeStart.SelectedDate, postdatetimeEnd.SelectedDate, null, startRow, size));
            //if (ViewState["condition"] == null)
            //{
            //    return ModeratorManageLog.Meta.Count;
            //}
            //return AdminModeratorLogs.RecordCount(ViewState["condition"].ToString());
        }
Beispiel #2
0
 private void DelRec_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         var rs = ModeratorManageLog.Del(Request["deleteMode"], Request["id"], Int32.Parse(deleteNum.Text), deleteFrom.SelectedDate);
         if (rs > 0)
         {
             base.Response.Redirect("forum_moderatormanagelog.aspx");
             return;
         }
         base.RegisterStartupScript("", "<script>alert('您未选中任何选项或输入参数错误!');window.location.href='forum_moderatormanagelog.aspx';</script>");
     }
 }
Beispiel #3
0
        public static string GetTopicListModeratorLog(int tid)
        {
            //return BBX.Data.TopicAdmins.GetTopicListModeratorLog(tid);

            string result = "";
            var    log    = ModeratorManageLog.FindLastByTid(tid);

            if (log != null)
            {
                result = "本主题由 " + log.GroupTitle + " " + log.ModeratorName + " 于 " + log.PostDateTime.ToFullString() + " 执行 " + log.Actions + " 操作";
                //log.Close();
            }
            return(result);
        }
Beispiel #4
0
        public void BindData()
        {
            DataGrid1.AllowCustomPaging = true;
            DataGrid1.VirtualItemCount  = GetRecordCount();
            //DataTable dataTable = (ViewState["condition"] == null) ? AdminModeratorLogs.LogList(DataGrid1.PageSize, DataGrid1.CurrentPageIndex + 1) : AdminModeratorLogs.LogList(DataGrid1.PageSize, DataGrid1.CurrentPageIndex + 1, ViewState["condition"].ToString());
            var size      = DataGrid1.PageSize;
            var startRow  = DataGrid1.CurrentPageIndex * size;
            var dataTable = ModeratorManageLog.Search(others.Text, Username.Text, postdatetimeStart.SelectedDate, postdatetimeEnd.SelectedDate, null, startRow, size).ToDataTable(false);

            foreach (DataRow dataRow in dataTable.Rows)
            {
                dataRow["reason"] = dataRow["reason"].ToString().Trim();
                dataRow["title"]  = ((!dataRow["title"].ToString().IsNullOrEmpty()) ? string.Format("<a href=\"{0}\" target=\"_blank\">{1}</a>", BaseConfigs.GetForumPath + Urls.ShowTopicAspxRewrite(dataRow["tid"].ToInt(), 1), dataRow["title"]) : "没有标题");
            }
            DataGrid1.DataSource = dataTable;
            DataGrid1.DataBind();
        }
Beispiel #5
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);
        }
Beispiel #6
0
        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);
        }
Beispiel #7
0
 public static bool InsertLog(string moderatoruid, string moderatorname, string groupid, string grouptitle, string ip, string postdatetime, string fid, string fname, string tid, string title, string actions, string reason)
 {
     return(ModeratorManageLog.InsertLog(moderatoruid, moderatorname, groupid, grouptitle, ip, postdatetime, fid, fname, tid, title, actions, reason));
 }
Beispiel #8
0
 public static string GetSearchModeratorManageLogCondition(DateTime postDateTimeStart, DateTime postDateTimeEnd, string userName, string others)
 {
     return(ModeratorManageLog.GetSearchModeratorManageLogCondition(postDateTimeStart, postDateTimeEnd, userName, others));
 }
Beispiel #9
0
 public static string GetDeleteModeratorManageCondition(string deleteMode, string id, string deleteNum, string deleteFrom)
 {
     return(ModeratorManageLog.GetDeleteModeratorManageCondition(deleteMode, id, deleteNum, deleteFrom));
 }
Beispiel #10
0
 public static int RecordCount(string condition)
 {
     return(ModeratorManageLog.RecordCount(condition));
 }
Beispiel #11
0
 public static int RecordCount()
 {
     return(ModeratorManageLog.RecordCount());
 }
Beispiel #12
0
 public static DataTable LogList(int pagesize, int currentpage, string condition)
 {
     return(ModeratorManageLog.GetModeratorLogList(pagesize, currentpage, condition));
 }
Beispiel #13
0
 public static string SearchModeratorManageLog(string keyword)
 {
     return(ModeratorManageLog.SearchModeratorManageLog(keyword));
 }
Beispiel #14
0
 public static bool DeleteLog(string condition)
 {
     return(ModeratorManageLog.DeleteLog(condition));
 }