Exemplo n.º 1
0
        public virtual void Admin()
        {
            String ids        = ctx.Post("choice");
            String cmd        = ctx.Post("action");
            long   categoryId = ctx.PostLong("categoryId");

            if (strUtil.IsNullOrEmpty(cmd) || cvt.IsIdListValid(ids) == false)
            {
                content(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 ("delete".Equals(cmd))
            {
                PhotoPost.updateBatch("set SaveStatus=" + SaveStatus.SysDelete, condition);
                log(SiteLogString.DeleteSysPhotoPost(), ids);
                echoAjaxOk();
            }

            else if ("category".Equals(cmd))
            {
                if (categoryId < 0)
                {
                    content(lang("exCategoryNotFound"));
                    return;
                }

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

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

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