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

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

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

            BlogArticleCollection articles = BlogBO.Instance.GetBlogArticlesForAdmin(operatorUserID, filter, 1);

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

            totalCount = articles.TotalRecords;

            title = "将删除 " + totalCount + " 篇日志";

            return(true);
        }
Exemple #2
0
        public override void AfterExecute(int operatorUserID, string param, bool success, int totalCount, int finishedCount, out string title)
        {
            if (success)
            {
                title = "删除日志成功,共删除 " + finishedCount + " 篇日志";

                StringList paramData = StringList.Parse(param);

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

                if (success)
                {
                    User operatorUser = UserBO.Instance.GetUser(operatorUserID, GetUserOption.WithAll);

                    Logs.LogManager.LogOperation(
                        new Blog_DeleteBlogArticleBySearch(operatorUserID, operatorUser.Name, IPUtil.GetCurrentIP(), filter, finishedCount)
                        );
                }
            }
            else
            {
                title = "删除日志失败";
            }
        }
Exemple #3
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);

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

            int stepCount;

            if (BlogBO.Instance.DeleteBlogArticlesForAdmin(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);
        }