Esempio n. 1
0
        public void Admin()
        {
            String ids        = ctx.Post("choice");
            String cmd        = ctx.Post("action");
            int    categoryId = ctx.PostInt("categoryId");

            if (strUtil.IsNullOrEmpty(cmd) || cvt.IsIdListValid(ids) == false)
            {
                content(lang("exCmd"));
                return;
            }

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


            if ("unpick".Equals(cmd))
            {
                pickedService.UnPickPost(ids);
                log(SiteLogString.UnPickPhotoPost(), ids);

                echoAjaxOk();
            }

            else if ("deleteTrue".Equals(cmd))
            {
                photoService.SystemDeleteListTrue(ids);
                log(SiteLogString.DeleteSysPhotoPostTrue(), ids);
                echoAjaxOk();
            }
            else if ("unDelete".Equals(cmd))
            {
                photoService.SystemUnDeleteList(ids);
                log(SiteLogString.UnDeleteSysPhotoPost(), ids);
                echoAjaxOk();
            }

            else
            {
                content(lang("exCmd"));
            }
        }
Esempio n. 2
0
        public void Admin()
        {
            String ids        = ctx.Post("choice");
            String cmd        = ctx.Post("action");
            int    categoryId = ctx.PostInt("categoryId");

            if (strUtil.IsNullOrEmpty(cmd) || cvt.IsIdListValid(ids) == false)
            {
                actionContent(lang("exCmd"));
                return;
            }

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

            if ("pick".Equals(cmd))
            {
                pickedService.PickPost(ids);
                log(SiteLogString.PickPhotoPost(), ids);

                echoAjaxOk();
            }
            else if ("unpick".Equals(cmd))
            {
                pickedService.UnPickPost(ids);
                log(SiteLogString.UnPickPhotoPost(), ids);

                echoAjaxOk();
            }
            else if ("delete".Equals(cmd))
            {
                PhotoPost.updateBatch("set SaveStatus=" + SaveStatus.SysDelete, condition);
                log(SiteLogString.DeleteSysPhotoPost(), ids);
                echoAjaxOk();
            }
            else if ("deleteTrue".Equals(cmd))
            {
                photoService.SystemDeleteListTrue(ids);
                log(SiteLogString.DeleteSysPhotoPostTrue(), ids);
                echoAjaxOk();
            }
            else if ("unDelete".Equals(cmd))
            {
                photoService.SystemUnDeleteList(ids);
                log(SiteLogString.UnDeleteSysPhotoPost(), ids);
                echoAjaxOk();
            }
            else if ("category".Equals(cmd))
            {
                if (categoryId <= 0)
                {
                    actionContent(lang("exCategoryNotFound"));
                    return;
                }
                PhotoPost.updateBatch("set SysCategoryId=" + categoryId, condition);
                log(SiteLogString.MovePhotoPost(), ids);

                echoAjaxOk();
            }
            else
            {
                actionContent(lang("exCmd"));
            }
        }