コード例 #1
0
        public void Admin()
        {
            String ids = ctx.PostIdList("choice");
            String cmd = ctx.Post("action");

            if (strUtil.IsNullOrEmpty(cmd))
            {
                echoText(lang("exCmd"));
                return;
            }

            if (strUtil.IsNullOrEmpty(ids))
            {
                echoText(lang("plsSelect"));
                return;
            }

            if ("pick".Equals(cmd))
            {
                pickedService.PickPost(ids);
                log(SiteLogString.PickBlogPost(), ids);
                echoAjaxOk();
            }
            else if ("unpick".Equals(cmd))
            {
                pickedService.UnPickPost(ids);
                log(SiteLogString.UnPickBlogPost(), ids);
                echoAjaxOk();
            }
            else if ("delete".Equals(cmd))
            {
                sysblogService.Delete(ids);
                log(SiteLogString.DeleteBlogPost(), ids);
                echoAjaxOk();
            }
            else if ("undelete".Equals(cmd))
            {
                sysblogService.UnDelete(ids);
                log(SiteLogString.UnDeleteBlogPost(), ids);
                echoAjaxOk();
            }
            else if ("deletetrue".Equals(cmd))
            {
                sysblogService.DeleteTrue(ids);
                log(SiteLogString.DeleteBlogPostTrue(), ids);
                echoAjaxOk();
            }
            else
            {
                echoText(lang("exUnknowCmd"));
            }
        }
コード例 #2
0
ファイル: MainController.cs プロジェクト: youmuyou/wojilu
        public void Admin()
        {
            String ids        = ctx.PostIdList("choice");
            String cmd        = ctx.Post("action");
            int    categoryId = ctx.PostInt("categoryId");

            String condition = string.Format("Id in ({0}) ", ids);

            if (strUtil.IsNullOrEmpty(cmd))
            {
                echoText(lang("exCmd"));
                return;
            }

            if (strUtil.IsNullOrEmpty(ids))
            {
                echoText(lang("plsSelect"));
                return;
            }

            if ("pick".Equals(cmd))
            {
                pickedService.PickPost(ids);
                log(SiteLogString.PickBlogPost(), ids);
                echoAjaxOk();
            }
            else if ("unpick".Equals(cmd))
            {
                pickedService.UnPickPost(ids);
                log(SiteLogString.UnPickBlogPost(), ids);
                echoAjaxOk();
            }
            else if ("delete".Equals(cmd))
            {
                sysblogService.Delete(ids);
                log(SiteLogString.DeleteBlogPost(), ids);
                echoAjaxOk();
            }
            else if ("category".Equals(cmd))
            {
                if (categoryId < 0)
                {
                    content(lang("exCategoryNotFound"));
                    return;
                }

                if (categoryId == zeroCatId)
                {
                    categoryId = 0;
                }

                BlogPost.updateBatch("set SysCategoryId=" + categoryId, condition);
                log(SiteLogString.MoveBlogPost(), ids);

                echoAjaxOk();
            }
            else
            {
                echoText(lang("exUnknowCmd"));
            }
        }