Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (function.isAjax())
            {
                string action = Request["action"] ?? "";
                string value  = Request["value"] ?? "";
                string result = "";
                switch (action)
                {
                case "duptitle":
                    DataTable dt = contentBll.GetByDupTitle(value);
                    result = Newtonsoft.Json.JsonConvert.SerializeObject(dt);
                    break;
                }
                Response.Write(result); Response.Flush(); Response.End();
            }
            if (ModelID < 1 || NodeID < 1)
            {
                function.WriteErrMsg("参数错误");
            }
            DataTable fieldDT = fieldBll.SelByModelID(ModelID, true);

            bt_txt.Text   = B_Content.GetFieldAlias("Title", fieldDT) + ":";
            gjz_txt.Text  = B_Content.GetFieldAlias("Tagkey", fieldDT) + ":";
            Label4.Text   = B_Content.GetFieldAlias("Subtitle", fieldDT) + ":";
            tj_txt.Text   = B_Content.GetFieldAlias("EliteLevel", fieldDT);
            zht_txt.Text  = B_Content.GetFieldAlias("Status", fieldDT);
            gx_time.Text  = B_Content.GetFieldAlias("UpDateTime", fieldDT);
            hits_txt.Text = B_Content.GetFieldAlias("Hits", fieldDT);
            if (!IsPostBack)
            {
                B_ARoleAuth.CheckEx(ZLEnum.Auth.content, "ContentMange");
                if (!string.IsNullOrEmpty(Request.QueryString["Source"]))
                {
                    function.Script(this, "SetContent();");
                }
                //-----工作流,检测该节点是否绑定工作流,如无绑定,则直接通过,未绑定,则以第一步为准
                contentsk.Visible = B_ARoleAuth.Check(ZLEnum.Auth.content, "ContentMange");
                DataTable ddlDT = proBll.SelByNodeID2(NodeID);
                ddlFlow.DataSource     = ddlDT;
                ddlFlow.DataTextField  = "PName";
                ddlFlow.DataValueField = "PPassCode";
                ddlFlow.DataBind();
                M_AdminInfo adminMod = B_Admin.GetLogin();
                ddlFlow.SelectedValue = adminMod.DefaultStart.ToString();
                //if (ddlDT.TableName.Equals("Default"))
                //{
                //    ddlFlow.SelectedValue = "99";
                //}
                //else
                //{
                //    ddlFlow.Items[0].Selected = true;
                //}
                //-----
                //专题
                if (spbll.GetFirstID() > 0)
                {
                    SpecInfo_Li.Text = "<button type='button' class='btn btn-info btn-sm' onclick='ShowSpDiag()'>" + Resources.L.添加至专题 + "</button>";
                }
                else
                {
                    SpecInfo_Li.Text = "<div style='margin:5px;' class='btn btn-default disabled'><span class='fa fa-info-circle'></span> " + Resources.L.尚未定义专题 + "</div>";
                }
                //智能关键词
                keys = keyBll.SelToJson();
                //------
                nodeMod = nodeBll.GetNodeXML(NodeID);
                NodeDir = nodeMod.NodeDir;
                if (nodeMod.ListPageHtmlEx < 3)
                {
                    CreateHTML.Visible = true;
                }
                else
                {
                    CreateHTML.Visible = false;
                }
                nodeMod = nodeBll.GetNodeXML(NodeID);
                if (nodeMod.Contribute != 1)
                {
                    function.Script(this, "ShowSys();");
                }
                M_ModelInfo model = modelBll.GetModelById(ModelID);
                Label1.Text     = "添加" + model.ItemName;
                EBtnSubmit.Text = "添加" + model.ItemName;
                Title_L.Text    = "添加" + model.ItemName;
                ModelHtml.Text  = fieldBll.InputallHtml(ModelID, NodeID, new ModelConfig()
                {
                    Source = ModelConfig.SType.Admin
                });
                txtAddTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                txtdate.Text    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                BindTempList();
                string bread = "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>" + Resources.L.工作台 + "</a></li><li><a href='ContentManage.aspx'>" + Resources.L.内容管理 + "</a></li><li><a href='ContentManage.aspx?NodeID=" + nodeMod.NodeID + "'>" + nodeMod.NodeName + "</a></li>";
                bread += "<li class='active'>[向本栏目添加" + model.ItemName + "]</li>";
                bread += "<div class='pull-right hidden-xs'> <span> <a href='" + customPath2 + "Content/SchedTask.aspx' title='" + Resources.L.查看计划任务 + "'><span class='fa fa-clock-o' style='color:#28b462;'></span></a>" + GetOpenView() + "<span onclick=\"ShowDiag('EditNode.aspx?NodeID=" + NodeID + "','" + Resources.L.配置本节点 + "');\" class='fa fa-cog' title='" + Resources.L.配置本节点 + "' style='cursor:pointer;margin-left:5px;'></span></span></div>";
                Call.SetBreadCrumb(Master, bread);
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Gid < 1)
                {
                    function.WriteErrMsg("参数出错");
                }
                M_CommonData mc = bc.SelReturnModel(Gid);
                if (mc == null || mc.IsNull)
                {
                    function.WriteErrMsg("[" + Gid + "]号文章不存在");
                }
                M_ModelInfo modelMod = bm.GetModelById(mc.ModelID);
                M_Node      nodeMod  = nodeBll.SelReturnModel(mc.NodeID);
                ModelID = mc.ModelID;
                NodeID  = mc.NodeID;
                if (modelMod.IsNull)
                {
                    function.WriteErrMsg("该内容所绑定的模型[" + mc.ModelID + "]不存在");
                }
                if (nodeMod.IsNull)
                {
                    function.WriteErrMsg("该内容所绑定的节点[" + mc.NodeID + "]不存在");
                }
                Call.SetBreadCrumb(Master, "<li><a href='ContentManage.aspx'>内容管理</a></li><li><a href='ContentManage.aspx?NodeID=" + mc.NodeID + "'>" + nodeMod.NodeName + "</a></li><li class='active'>预览" + modelMod.ItemName + "</li><div class='pull-right hidden-xs'><span><a href='" + customPath2 + "Content/SchedTask.aspx' title='查看计划任务'><span class='fa fa-clock-o' style='color:#28b462;'></span></a>" + GetOpenView() + "<span onclick=\"opentitle('EditNode.aspx?NodeID=" + mc.NodeID + "','配置本节点');\" class='fa fa-cog' title='配置本节点' style='cursor:pointer;margin-left:5px;'></span></span></div>");
                //--------------
                Button5.Text        = "修改" + modelMod.ItemName;
                Del_Btn.Text        = "删除" + modelMod.ItemName;
                Reject_Btn.Enabled  = (mc.Status != (int)ZLEnum.ConStatus.Reject);
                UnAudit_Btn.Enabled = (mc.Status == (int)ZLEnum.ConStatus.Audited);
                if (mc.EliteLevel == 1)
                {
                    Elite_Btn.Visible = false;
                    Button6.Visible   = true;
                }
                else
                {
                    Elite_Btn.Visible = true;
                    Button6.Visible   = false;
                }

                if (mc.Status == (int)ZLEnum.ConStatus.Recycle)
                {
                    Del_Btn.Enabled    = false;
                    Reject_Btn.Enabled = false;
                }
                else
                {
                    Del_Btn.Enabled = true;
                }
                NodeName_L.Text = nodeMod.NodeName;
                Gid_L.Text      = Gid.ToString();
                DataTable fieldDT = fieldBll.SelByModelID(mc.ModelID, true);
                //自定义字段名称
                C_Title_L.Text = B_Content.GetFieldAlias("Title", fieldDT) + ":";
                //
                Title_L.Text      = mc.Title;
                Inputer_L.Text    = mc.Inputer;
                Hits_L.Text       = mc.Hits.ToString();
                CreateTime_L.Text = mc.CreateTime.ToString();
                UpdateTime_L.Text = mc.UpDateTime.ToString();
                ConStatus_L.Text  = ZLEnum.GetConStatus(mc.Status);
                Elite_L.Text      = mc.EliteLevel == 1 ? "已推荐" : "未推荐";
                topimg_img.Src    = mc.TopImg;
                DataTable contentDT = bc.GetContentByItems(mc.TableName, mc.GeneralID);
                Base_L.Text = bfield.InputallHtml(ModelID, NodeID, new ModelConfig()
                {
                    ValueDT = contentDT,
                    Mode    = ModelConfig.SMode.PreView
                });
            }
        }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         M_CommonData commdata = new M_CommonData();
         if (GeneralID > 0)
         {
             commdata = contentBll.GetCommonData(this.GeneralID);
             NodeID   = commdata.NodeID;
             ModelID  = commdata.ModelID;
         }
         else
         {
             NodeID  = DataConvert.CLng(Request.QueryString["NodeID"]);
             ModelID = DataConvert.CLng(Request.QueryString["ModelID"]);
         }
         if ((ModelID < 1 && NodeID < 1) && GeneralID < 1)
         {
             function.WriteErrMsg("参数错误");
         }
         if (!string.IsNullOrEmpty(Request.QueryString["Source"]))
         {
             function.Script(this, "SetContent();");
         }
         //-------------------------------------------
         DataTable ds = mfieldBll.SelByModelID(ModelID, true);
         bt_txt.Text  = B_Content.GetFieldAlias("Title", ds);
         gjz_txt.Text = B_Content.GetFieldAlias("Tagkey", ds);
         Label4.Text  = B_Content.GetFieldAlias("Subtitle", ds);
         py.Text      = B_Content.GetFieldAlias("PYtitle", ds);
         //-------------------------------------------
         M_ModelInfo model     = modelBll.GetModelById(ModelID);
         string      optionstr = GeneralID > 0 ? "修改" : "添加";
         Label1.Text     = optionstr + model.ItemName;
         EBtnSubmit.Text = optionstr + model.ItemName;
         //-------------------------------------------
         if (spbll.GetSpecList().Rows.Count > 0)
         {
             SpecInfo_Li.Text = "<button type='button' class='btn btn-info btn-sm' onclick='ShowSpDiag()'>添加至专题</button>";
         }
         else
         {
             SpecInfo_Li.Text = "<div style='margin:5px;' class='btn btn-default disabled'><span class='fa fa-info-circle'></span> 尚未定义专题</div>";
         }
         //-------------------------------------------
         M_Node nodeMod = nodeBll.SelReturnModel(NodeID);
         CreateHTML.Visible = nodeMod.ListPageHtmlEx < 3;
         Tips = "向 <a href='/User/Content/MyContent.aspx?NodeId=" + nodeMod.NodeID + "'>[" + nodeMod.NodeName + "]</a> 节点" + optionstr + model.ItemName;
         if (GeneralID > 0)
         {
             MyBind(commdata);
         }
         else
         {
             ModelHtml.Text = mfieldBll.InputallHtml(ModelID, NodeID, new ModelConfig()
             {
                 Source = ModelConfig.SType.UserContent
             });
         }
         if (nodeMod.Contribute != 1)
         {
             function.Script(this, "ShowSys();");
         }
     }
 }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            B_Admin badmin = new B_Admin();

            if (!IsPostBack)
            {
                B_ARoleAuth.CheckEx(ZLEnum.Auth.content, "ContentMange");
                M_CommonData Cdata = contentBll.GetCommonData(GeneralID);
                if (Cdata == null)
                {
                    function.WriteErrMsg("请指定内容参数");
                }
                //计划任务(审核时间)
                //M_Content_ScheTask taskmod = taskBll.SelByGid(GeneralID, M_Content_ScheTask.TaskTypeEnum.AuditArt);
                //if (taskmod != null)
                //{
                //    CheckDate_T.Text = taskmod.ExecuteTime2.ToString();
                //    CheckDate_Hid.Value = taskmod.ExecuteTime2.ToString();
                //}
                //taskmod = taskBll.SelByGid(GeneralID, M_Content_ScheTask.TaskTypeEnum.UnAuditArt);
                //if (taskmod!=null)
                //{
                //    TimeDate_T.Text = taskmod.ExecuteTime2.ToString();
                //    TimeDate_Hid.Value = taskmod.ExecuteTime2.ToString();
                //}
                M_ModelInfo model = bmode.GetModelById(Cdata.ModelID);
                ModelID = Cdata.ModelID;
                NodeID  = Cdata.NodeID;
                DataTable fieldDT = fieldBll.SelByModelID(ModelID, true);
                bt_txt.Text          = B_Content.GetFieldAlias("Title", fieldDT) + ":";
                gjz_txt.Text         = B_Content.GetFieldAlias("Tagkey", fieldDT) + ":";
                SubTitle_L.Text      = B_Content.GetFieldAlias("Subtitle", fieldDT) + ":";
                tj_txt.Text          = B_Content.GetFieldAlias("EliteLevel", fieldDT);
                zht_txt.Text         = B_Content.GetFieldAlias("Status", fieldDT);
                hits_txt.Text        = B_Content.GetFieldAlias("Hits", fieldDT);
                RelatedIDS_Hid.Value = Cdata.RelatedIDS;
                AddToNew_Btn.Text    = "添加为新" + model.ItemName;
                EBtnSubmit.Text      = "保存" + model.ItemName;
                //-----工作流,检测该节点是否绑定工作流,如无绑定,则直接通过,未绑定,则以第一步为准
                ddlFlow.DataSource     = proBll.SelByNodeID2(NodeID);
                ddlFlow.DataTextField  = "PName";
                ddlFlow.DataValueField = "PPassCode";
                ddlFlow.DataBind();
                ddlFlow.SelectedValue = Cdata.Status.ToString().Equals("-3") || string.IsNullOrEmpty(Cdata.Status.ToString()) ? "0" : Cdata.Status.ToString();
                //-----工作流(End)
                //-----智能关键词
                keys    = keyBll.SelToJson();
                ModelID = Cdata.ModelID;
                M_Node nnn = bnode.GetNodeXML(NodeID);
                if (nnn.Contribute != 1)
                {
                    function.Script(this, "ShowSys();");
                }
                NodeDir                    = nnn.NodeDir;
                CreateHTML.Visible         = nnn.ListPageHtmlEx < 3;
                nodename.Value             = nnn.NodeName;
                EBtnSubmit.Text            = "修改" + bmode.GetModelById(ModelID).ItemName;
                txtTitle.Text              = Cdata.Title;
                ThumImg_Hid.Value          = Cdata.TopImg;
                txtAddTime.Text            = Cdata.CreateTime == DateTime.MinValue ? "" : Cdata.CreateTime.ToString("yyyy-MM-dd HH:mm:ss");
                txtInputer.Text            = Cdata.Inputer;
                txtdate.Text               = Cdata.UpDateTime.ToString("yyyy-MM-dd HH:mm:ss");
                txtNum.Text                = Cdata.Hits.ToString();
                ChkAudit.Checked           = Cdata.EliteLevel > 0;
                TxtTemplate_hid.Value      = Cdata.Template;
                TlpView_Tlp.SelectedID     = Cdata.Template;
                TlpView_Tlp.SelectedValue  = Cdata.Template;
                Keywords.Text              = Cdata.TagKey;
                Subtitle.Text              = Cdata.Subtitle;
                PYtitle.Text               = Cdata.PYtitle;
                ThreadStyle.Value          = Cdata.TitleStyle.ToString();
                txtTitle.Style.Value      += Cdata.TitleStyle.ToString();
                IsComm_Radio.SelectedValue = Cdata.IsComm.ToString();
                #region 专题
                if (specbll.GetSpecList().Rows.Count > 0)
                {
                    SpecInfo_Li.Text = "<button type='button' class='btn btn-info btn-sm' onclick='ShowSpDiag()'>添加至专题</button>";
                }
                else
                {
                    SpecInfo_Li.Text = "<div style='margin:5px;' class='btn btn-default disabled'><span class='fa fa-info-circle'></span> 尚未定义专题</div>";
                }
                Spec_Hid.Value = Cdata.SpecialID;
                if (!string.IsNullOrEmpty(Cdata.SpecialID))
                {
                    string    ids     = Cdata.SpecialID.Trim(',');
                    DataTable dtspecs = specbll.SelByIDS(ids);
                    string    names   = "";
                    if (dtspecs != null)
                    {
                        foreach (DataRow item in dtspecs.Rows)
                        {
                            names += "{\"id\":\"" + item["SpecID"] + "\",\"name\":\"" + item["SpecName"] + "\"},";
                        }
                    }
                    names = names.TrimEnd(',');
                    function.Script(this, "DealResult('[" + names + "]');");
                }
                #endregion
                DataTable dtContent = contentBll.GetContent(GeneralID);
                ModelHtml.Text = fieldBll.InputallHtml(ModelID, NodeID, new ModelConfig()
                {
                    ValueDT = dtContent
                });//模型内容
                   //检测是否已生成PDF或Html
                if (File.Exists(Server.MapPath(Cdata.PdfLink)))
                {
                    makePDFBtn.Enabled  = false;
                    downPdfHref.Text   += Cdata.GeneralID + ".pdf";
                    delPdfHref.Visible  = true;
                    downPdfHref.Visible = true;
                }
                if (File.Exists(Server.MapPath(wordLink + Cdata.GeneralID + ".doc")))
                {
                    makeWordBtn.Enabled  = false;
                    downWordHref.Text   += Cdata.GeneralID + ".doc";
                    downWordHref.Visible = true;
                    delWordHref.Visible  = true;
                }
                string breadTlp = "<li><a href='ContentManage.aspx'>内容管理</a></li><li><a href='ContentManage.aspx?NodeID=" + nnn.NodeID + "'>" + nnn.NodeName + "</a></li><li class='active'>";
                breadTlp += "[向本栏目修改" + model.ItemName + "]";
                if (!string.IsNullOrEmpty(Cdata.Template))//启用个性模板
                {
                    breadTlp += "<span class='margin_l5 rd_red'>(提示:该内容已启用个性模板)</span>";
                }
                breadTlp += "</li>";
                breadTlp += "<div class='pull-right hidden-xs'><span><a href='" + customPath2 + "Content/SchedTask.aspx' title='查看计划任务'><span class='fa fa-clock-o' style='color:#28b462;'></span></a>" + GetOpenView() + "<span onclick=\"ShowDiag('EditNode.aspx?NodeID=" + NodeID + "','配置本节点');\" class='fa fa-cog' title='配置本节点' style='cursor:pointer;margin-left:5px;'></span></span></div>";
                Call.SetBreadCrumb(Master, breadTlp);
                BindTempList();
            }
        }