Exemplo n.º 1
0
        /// <summary>
        /// 编辑|添加店铺幻灯图片
        /// </summary>
        public void indeximage_Edit()
        {
            int       id    = RequestTool.RequestInt("id", 0);
            Lebi_Page model = B_Lebi_Page.GetModel(id);
            Lebi_Node node  = NodePage.GetNodeByCode("shopindeximages");

            if (model == null)
            {
                model = new Lebi_Page();
            }
            B_Lebi_Page.SafeBindForm(model);
            model.Supplier_id = CurrentSupplier.id;
            model.Node_id     = node.id;
            if (model.id == 0)
            {
                if (!Power("indeximage_add", "添加店铺幻灯"))
                {
                    AjaxNoPower();
                    return;
                }
                B_Lebi_Page.Add(model);
                id = B_Lebi_Page.GetMaxId();
                string action      = "添加店铺幻灯";
                string description = model.Name;
                Log.Add(action, "Page", id.ToString(), CurrentSupplier, description);
            }
            else
            {
                if (!Power("indeximage_edit", "编辑店铺幻灯"))
                {
                    AjaxNoPower();
                    return;
                }
                B_Lebi_Page.Update(model);
                string action      = Tag("编辑店铺幻灯");
                string description = model.Name;
                Log.Add(action, "Page", id.ToString(), CurrentSupplier, description);
            }
            //=========================================
            //处理静态页面
            ImageHelper.LebiImagesUsed(model.ImageOriginal, "page", id);
            Response.Write("{\"msg\":\"OK\",\"id\":\"" + id + "\"}");
        }
Exemplo n.º 2
0
        /// <summary>
        /// 编辑页面
        /// </summary>
        public void Page_Edit()
        {
            int       id    = RequestTool.RequestInt("id", 0);
            Lebi_Page model = B_Lebi_Page.GetModel(id);

            if (model == null)
            {
                model = new Lebi_Page();
            }
            B_Lebi_Page.BindForm(model);
            model.Language_ids = RequestTool.RequestSafeString("Language_ids");
            model.Language     = Language.LanuageidsToCodes(model.Language_ids);
            if (model.id == 0)
            {
                if (!EX_Admin.Power("page_add", "添加结点内容"))
                {
                    AjaxNoPower();
                    return;
                }
                B_Lebi_Page.Add(model);
                id = B_Lebi_Page.GetMaxId();
                string action      = Tag("添加结点内容");
                string description = model.Name;
                Log.Add(action, "Page", id.ToString(), CurrentAdmin, description);
            }
            else
            {
                if (!EX_Admin.Power("page_edit", "编辑结点内容"))
                {
                    AjaxNoPower();
                    return;
                }
                B_Lebi_Page.Update(model);
                string action      = Tag("编辑结点内容");
                string description = model.Name;
                Log.Add(action, "Page", id.ToString(), CurrentAdmin, description);
            }
            //=========================================
            //处理静态页面
            Lebi_Node       node = B_Lebi_Node.GetModel(model.Node_id);
            Lebi_Theme_Page themepage;

            if (node.Code == "About")
            {
                themepage = B_Lebi_Theme_Page.GetModel("Code='P_About'");
            }
            else if (node.Code == "News")
            {
                themepage = B_Lebi_Theme_Page.GetModel("Code='P_NewsDetails'");
            }
            else if (node.Code == "Help")
            {
                themepage = B_Lebi_Theme_Page.GetModel("Code='P_Help'");
            }
            else
            {
                themepage = B_Lebi_Theme_Page.GetModel("Code='P_ArticleDetails'");
            }
            if (themepage.Type_id_PublishType == 122)//静态发布页面
            {
                if (node.Code == "Help")
                {
                    PageStatic.Greate_Help(themepage);
                }
                else
                {
                    PageStatic.Greate_InfoPage(model, themepage);
                }
            }
            ImageHelper.LebiImagesUsed(model.ImageOriginal, "page", id);
            Response.Write("{\"msg\":\"OK\",\"id\":\"" + id + "\"}");
        }