Beispiel #1
0
        public override bool BeforeExecute(int operatorUserID, string param, ref long offset, ref int totalCount, out string title)
        {
            StringList paramData = StringList.Parse(param);

            AdminCommentFilter filter = AdminCommentFilter.Parse(paramData[0]);

            //只取一条数据测试下就可以
            filter.PageSize = 1;

            CommentCollection comments = CommentBO.Instance.GetCommentsForAdmin(operatorUserID, filter, 1);

            if (comments == null || comments.Count == 0)
            {
                title = "没有数据可以删除";
                return(false);
            }

            totalCount = comments.TotalRecords;

            title = "将删除 " + totalCount + " 条评论";

            return(true);
        }
Beispiel #2
0
        public override bool StepExecute(int operatorUserID, string param, ref long offset, ref int totalCount, ref int finishedCount, out string title, out bool isLastStep)
        {
            StringList paramData = StringList.Parse(param);

            AdminCommentFilter filter = AdminCommentFilter.Parse(paramData[0]);

            int stepCount;

            if (CommentBO.Instance.DeleteCommentsForAdmin(operatorUserID, filter, paramData[1] == "1", stepDeleteCount, out stepCount))             // .DeleteDoingsBySearch(filter, 200);
            {
                finishedCount += stepCount;

                isLastStep = stepCount < stepDeleteCount;

                title = "正在删除评论,总数 " + totalCount + ",已删 " + finishedCount;
            }
            else
            {
                isLastStep = true;
                title      = string.Empty;
            }

            return(true);
        }