Esempio n. 1
0
        public IActionResult CommentFor()
        {
            if (ItemID < 1)
            {
                return(WriteErr("内容ID错误"));
            }
            PageSetting setting = cmtBll.SeachCommentByGid1(CPage, PSize, ItemID);

            if (Request.IsAjax())
            {
                return(PartialView("CommentFor_List", setting));
            }
            //获取节点配置
            M_CommonData cdata = conBll.GetCommonData(ItemID);

            if (cdata == null)
            {
                return(WriteErr("内容不存在"));
            }
            M_Node nodeMod = nodeBll.GetNodeXML(cdata.NodeID);

            if (nodeMod == null)
            {
                return(WriteErr("节点不存在"));
            }
            ViewBag.nodeMod = nodeMod;
            ViewBag.mu      = mu;
            return(View(setting));
        }
        public ActionResult CommentFor()
        {
            if (ItemID < 1)
            {
                function.WriteErrMsg("内容ID错误"); return(null);
            }
            //获取节点配置
            M_CommonData cdata = conBll.GetCommonData(ItemID);

            if (cdata == null)
            {
                function.WriteErrMsg("内容不存在"); return(null);
            }
            M_Node nodeMod = nodeBll.GetNodeXML(cdata.NodeID);

            if (nodeMod == null)
            {
                function.WriteErrMsg("节点不存在"); return(null);
            }
            PageSetting setting = cmtBll.SeachCommentByGid1(CPage, PSize, ItemID);

            ViewBag.nodeMod = nodeMod;
            ViewBag.mu      = mu;
            return(View(setting));
        }
Esempio n. 3
0
        //修改模式使用,更改前台页面
        protected void BindText(int gid)
        {
            mcon = bll.GetCommonData(gid);
            if (buser.GetLogin().UserName != mcon.Inputer && !purBll.Auth("OAEdit", buser.GetLogin().UserRole, mcon.NodeID))
            {
                function.WriteErrMsg("非本人添加或无修改权限!!");
            }
            Title_T.Text         = mcon.Title;
            nodeDP.SelectedValue = mcon.NodeID.ToString();
            CreateTime.Text      = mcon.CreateTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            userNameT.Text       = mcon.Inputer;
            userGroupL.Text      = strBll.SelNameByUid(buser.GetLogin().UserID);
            DataRow dr = boa.SelByItemID(mcon.TableName, mcon.ItemID).Rows[0];

            Secret.SelectedValue     = dr["Secret"].ToString();
            Urgency.SelectedValue    = dr["Urgency"].ToString();
            Importance.SelectedValue = dr["Importance"].ToString();
            userGroupL.Text          = dr["userGroupT"].ToString();
            content.Text             = dr["content"].ToString();
            if (!string.IsNullOrEmpty(dr["attach"].ToString()))
            {
                string[] af = dr["attach"].ToString().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                string   h  = "";
                for (int i = 0; i < af.Length; i++)
                {
                    h += "<span class='disupFile'>";
                    h += GroupPic.GetShowExtension(GroupPic.GetExtName(af[i]));
                    h += "<a href='" + af[i] + "' title='点击下载'>" + af[i].Split('/')[(af[i].Split('/').Length - 1)] +
                         "<a href='javascript:;' title='删除' onclick='delHasFile(\"" + af[i] + "\",this);' ><img src='/App_Themes/AdminDefaultTheme/images/del.png'/></a></span>";
                }
                hasFileTD.InnerHtml = h;
            }
            hasFileData.Value = dr["attach"].ToString();//便于删除管理
            saveBtn.Text      = "修改";
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ZoomLa.Common.function.AccessRulo();
            B_Admin badmin = new B_Admin();

            if (!B_ARoleAuth.Check(ZLEnum.Auth.store, "StoreManage"))
            {
                function.WriteErrMsg("没有权限进行此项操作");
            }
            ShowGrid();
            M_CommonData mc       = cbll.GetCommonData(DataConverter.CLng(Request.QueryString["Id"]));
            int          i        = mc.ModelID;
            DataTable    UserData = cbll.GetContentByItems(mc.TableName, Convert.ToInt32(Request.QueryString["Id"]));

            if (UserData.Rows.Count > 0)
            {
                DetailsView1.DataSource = UserData.DefaultView;
                DetailsView1.DataBind();
            }
            if (!IsPostBack)
            {
                ViewState["id"] = Request.QueryString["id"];
                mc = cbll.GetCommonData(DataConverter.CLng(Request.QueryString["Id"]));
                M_Node nnn = bn.GetNodeXML(DataConverter.CLng(UserData.Rows[0]["NodeID"]));
                mc.Hits = mc.Hits + 1;
                cbll.Update(mc);
                GetInit();
            }
            Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>工作台</a></li><li><a href='../Shop/ProductManage.aspx'>商城管理</a></li><li><a href='StoreManage.aspx'>店铺管理</a></li><li class='active'>查看店铺信息</li>");
        }
Esempio n. 5
0
        public void Option()
        {
            if (!string.IsNullOrEmpty(Request["menu"]))
            {
                DataBind();
                string       uname        = string.Empty;
                M_CommonData b_CommonData = cbll.GetCommonData(DataConverter.CLng(Request.QueryString["id"]));
                switch (Request["menu"])
                {
                case "Audit":
                    messInfo.Sender   = "1";
                    messInfo.Title    = "店铺审核通知_通过";
                    messInfo.PostDate = DataConverter.CDate(DateTime.Now.ToShortDateString());
                    messInfo.Content  = "店铺审核通知_通过";
                    messInfo.Receipt  = "";
                    uname             = b_CommonData.Inputer;
                    string[] namearrr = uname.Split(new char[] { ',' });
                    for (int i = 0; i < namearrr.Length; i++)
                    {
                        messInfo.Incept = namearrr[i];
                        B_Message.Add(messInfo);
                    }
                    b_CommonData.Status = 99;
                    cbll.Update(b_CommonData); Response.Write("<script language=javascript>alert('通过审核!并已发送短消息通知');location.href='StoreManage.aspx';</script>");
                    break;

                default: break;
                }
            }
        }
Esempio n. 6
0
        public ContentResult ContentManage_API()
        {
            string action = GetParam("action");
            string ids    = GetParam("ids");

            switch (action)
            {
            case "move":
                string direct = Request.Form["direct"];
                int    curid = DataConvert.CLng(Request.Form["curid"]), tarid = DataConvert.CLng(Request.Form["tarid"]);

                M_CommonData curMod = contentBll.GetCommonData(curid);
                M_CommonData tarMod = contentBll.GetCommonData(tarid);
                if (curMod.OrderID == tarMod.OrderID)
                {
                    switch (direct)
                    {
                    case "up":
                        curMod.OrderID++;
                        break;

                    case "down":
                        curMod.OrderID--;
                        break;
                    }
                }
                else
                {
                    int temp = curMod.OrderID;
                    curMod.OrderID = tarMod.OrderID;
                    tarMod.OrderID = temp;
                }
                contentBll.UpdateByID(curMod); contentBll.UpdateByID(tarMod);
                return(Content("true"));

            case "del":
                contentBll.DelContent(ids, "");
                break;

            case "recover":
                contentBll.Reset(ids);
                break;

            case "clear":
                contentBll.DelRecycle();
                break;

            default:
                break;
            }
            return(Content(Success.ToString()));
        }
Esempio n. 7
0
        // 直接退稿
        protected void Reject_Btn_Click(object sender, EventArgs e)
        {
            M_AdminInfo ad = babll.GetAdminLogin();

            if (GetRole("State") || ("," + ad.RoleList + ",").Contains(",1,"))
            {
                M_CommonData commdata = bc.GetCommonData(Gid);
                commdata.Status = -1;
                bc.Update(commdata);
                function.WriteSuccessMsg("退稿成功!", "ShowContent.aspx?GID=" + Gid);
            }
            else
            {
                function.WriteErrMsg("你无权限退稿信息", "ContentManage.aspx?NodeID=" + ViewState["NodeID"].ToString());
            }
        }
Esempio n. 8
0
    protected void EBtnSubmit_Click(object sender, EventArgs e)
    {
        DataTable dt         = mfbll.GetModelFieldList(int.Parse(HiddenField1.Value));
        Call      commonCall = new Call();
        DataTable table      = commonCall.GetDTFromPage(dt, Page, ViewState);
        DataRow   rs4        = table.NewRow();

        rs4[0] = "StoreName";
        rs4[1] = "TextType";
        rs4[2] = Nametxt.Text;
        table.Rows.Add(rs4);
        DataRow rs5 = table.NewRow();

        rs5[0] = "StoreStyleID";
        rs5[1] = "int";
        rs5[2] = DataConverter.CLng(SSTDownList.Text);
        table.Rows.Add(rs5);
        M_StoreStyleTable sst   = sstbll.GetStyleByID(int.Parse(SSTDownList.Text));
        M_CommonData      CData = conBll.GetCommonData(gid);

        CData.Template = sst.StyleUrl;
        CData.Title    = Nametxt.Text;
        conBll.UpdateContent(table, CData);
        function.WriteSuccessMsg("提交成功");
    }
Esempio n. 9
0
        protected void DataBind(string ID)
        {
            int generealID = Convert.ToInt32(ID);

            mcon             = bcon.GetCommonData(generealID);
            minfo            = buser.GetUserByName(mcon.Inputer);
            Title_T.Text     = mcon.Title;
            LbCreatTime.Text = mcon.CreateTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            userNameL.Text   = mcon.Inputer;
            //function.WriteErrMsg(mcon.TableName + ":" + mcon.ItemID + ":" + generealID);
            DataRow dr = boa.SelByItemID(mcon.TableName, mcon.ItemID).Rows[0];

            SecretL.Text     = dr["Secret"].ToString();
            UrgencyL.Text    = dr["Urgency"].ToString();
            ImportanceL.Text = dr["Importance"].ToString();
            userGroupL.Text  = dr["userGroupT"].ToString();
            ContentHtml.Text = dr["content"].ToString();
            if (!string.IsNullOrEmpty(dr["attach"].ToString()))
            {
                string[] af = dr["attach"].ToString().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                string   h  = "";
                for (int i = 0; i < af.Length; i++)
                {
                    h += "<span class='disupFile'>";
                    h += GroupPic.GetShowExtension(GroupPic.GetExtName(af[i]));
                    h += "<a href='" + af[i] + "' title='点击下载'>" + af[i].Split('/')[(af[i].Split('/').Length - 1)] + "</span>";
                }
                publicAttachTD.InnerHtml = h;
            }
        }
Esempio n. 10
0
        public IActionResult AddContent()
        {
            M_CommonData Cdata = new M_CommonData();

            if (Mid > 0)
            {
                Cdata = conBll.GetCommonData(Mid);
            }
            else
            {
                Cdata.NodeID = DataConvert.CLng(RequestEx["NodeID"]); Cdata.ModelID = DataConvert.CLng(RequestEx["ModelID"]);
            }

            if (Cdata.ModelID < 1 && Cdata.NodeID < 1)
            {
                return(WriteErr("参数错误"));
            }
            M_ModelInfo model   = modBll.SelReturnModel(Cdata.ModelID);
            M_Node      nodeMod = nodeBll.SelReturnModel(Cdata.NodeID);

            if (Mid > 0)
            {
                if (mu.UserName != Cdata.Inputer)
                {
                    return(WriteErr("不能编辑不属于自己输入的内容!")); return(Content(""));
                }
                //DataTable dtContent = conBll.GetContent(Mid);
                //ViewBag.modelhtml = fieldBll.InputallHtml(Cdata.ModelID, Cdata.NodeID, new ModelConfig()
                //{
                //    Source = ModelConfig.SType.UserContent,
                //    ValueDT = dtContent
                //});
            }
            //else
            //{
            //    ViewBag.modelhtml = fieldBll.InputallHtml(ModelID, NodeID, new ModelConfig()
            //    {
            //        Source = ModelConfig.SType.UserContent
            //    });
            //}
            ViewBag.ds      = fieldBll.SelByModelID(Cdata.ModelID, true);
            ViewBag.op      = (Mid < 1 ? "添加" : "修改") + model.ItemName;
            ViewBag.nodeMod = nodeMod;
            ViewBag.tip     = "向 <a href='MyContent?NodeId=" + nodeMod.NodeID + "'>[" + nodeMod.NodeName + "]</a> 节点" + ViewBag.op;
            return(View(Cdata));
        }
Esempio n. 11
0
        public ActionResult News()
        {
            int          ID     = Convert.ToInt32(Request.QueryString["ID"]);
            M_CommonData conMod = conBll.GetCommonData(ID);
            DataTable    dt     = SqlHelper.ExecuteTable(CommandType.Text, "Select * From ZL_C_Article Where ID=" + conMod.ItemID);

            ViewBag.Title      = conMod.Title;
            ViewBag.CreateTime = conMod.CreateTime.ToString("yyyy年MM月dd日");
            ViewBag.Content    = dt.Rows[0]["Content"].ToString();
            return(View());
        }
Esempio n. 12
0
 protected void EGV_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Del")
     {
         string       Id      = e.CommandArgument.ToString();
         M_CommonData content = conbll.GetCommonData(DataConvert.CLng(Id));
         content.SpecialID = content.SpecialID.Replace("," + ViewState["SpecID"] + ",", "");
         conbll.UpdateByID(content);
         RepNodeBind();
     }
 }
        public void StoreIndex()
        {
            if (ItemID < 1)
            {
                function.WriteErrMsg("店铺ID错误,StoreIndex?id=店铺ID"); return;
            }
            M_CommonData cdata = conBll.GetCommonData(ItemID);

            if (cdata == null)
            {
                function.WriteErrMsg("店铺信息不存在"); return;
            }
            if (!cdata.IsStore)
            {
                function.WriteErrMsg("错误,指定的ID并非店铺"); return;
            }
            DataTable dt = conBll.GetContent(ItemID);

            if (dt != null && dt.Rows.Count < 1)
            {
                function.WriteErrMsg("该店铺不存在"); return;
            }
            else if (cdata.Status == 0)
            {
                function.WriteErrMsg("该店铺被关闭了"); return;
            }
            else if (cdata.Status != 99)
            {
                function.WriteErrMsg("该店铺还在审核中"); return;
            }
            else
            {
                string            username     = cdata.Inputer;
                int               userid       = buser.GetUserByName(username).UserID;
                int               StoreStyleID = DataConverter.CLng(dt.Rows[0]["StoreStyleID"]);//店铺风格
                M_StoreStyleTable stinfo       = sstbll.GetStyleByID(StoreStyleID);
                string            ContentHtml  = SafeSC.ReadFileStr(SiteConfig.SiteOption.TemplateDir + "/" + stinfo.StyleUrl);
                ContentHtml = this.createBll.CreateHtml(ContentHtml, 0, ItemID, 0);
                Response.Write(ContentHtml);
            }
        }
        public string GetContent(string gid)
        {
            string       result    = "";
            M_CommonData comMod    = contentBll.GetCommonData(Convert.ToInt32(gid));
            DataTable    dt        = this.fieldBll.GetModelFieldListAll(comMod.ModelID);
            DataTable    contentDT = contentBll.GetContentByItems(comMod.TableName, comMod.GeneralID);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (dt.Rows[i]["FieldName"].ToString() == "content")
                {
                    result = contentDT.Rows[0][dt.Rows[i]["FieldName"].ToString()].ToString();
                }
            }
            result = StringHelper.StripHtml(result);
            if (result.Length > 200)
            {
                result = result.Substring(0, 200) + "......";
            }
            return(result);
        }
Esempio n. 15
0
        public string ContentManage_API()
        {
            string result = "";

            switch (Request.Form["action"])
            {
            case "move":
                string direct = Request.Form["direct"];
                int    curid = DataConvert.CLng(Request.Form["curid"]), tarid = DataConvert.CLng(Request.Form["tarid"]);

                M_CommonData curMod = contentBll.GetCommonData(curid);
                M_CommonData tarMod = contentBll.GetCommonData(tarid);
                if (curMod.OrderID == tarMod.OrderID)
                {
                    switch (direct)
                    {
                    case "up":
                        curMod.OrderID++;
                        break;

                    case "down":
                        curMod.OrderID--;
                        break;
                    }
                }
                else
                {
                    int temp = curMod.OrderID;
                    curMod.OrderID = tarMod.OrderID;
                    tarMod.OrderID = temp;
                }
                contentBll.UpdateByID(curMod); contentBll.UpdateByID(tarMod);
                result = "true";
                break;

            default:
                break;
            }
            return(result);
        }
Esempio n. 16
0
        void MyBind()
        {
            M_Comment model = commentBll.SelReturnModel(MainID);

            ID_L.Text = model.CommentID.ToString();
            M_CommonData coninfo = contentBll.GetCommonData(DataConverter.CLng(model.GeneralID));

            Title_L.Text      = coninfo.Title;
            CUser_LB.Text     = userbll.SeachByID(model.UserID).UserName;
            CID_L.Text        = model.GeneralID.ToString();
            MsgContent_T.Text = model.Contents;
            CDate_T.Text      = model.CommentTime.ToString();
        }
        protected void EGV_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            M_CommonData cdataMod = new M_CommonData();

            switch (e.CommandName.ToLower())
            {
            case "read":
                Response.Redirect("ViewContent.aspx?Gid=" + e.CommandArgument.ToString() + "&NodeID=" + Request.QueryString["NodeID"]);
                break;

            case "settop":
                cdataMod = bll.GetCommonData(Convert.ToInt32(e.CommandArgument.ToString()));
                if (cdataMod.EliteLevel == 1)
                {
                    cdataMod.EliteLevel = 0;
                }
                else
                {
                    cdataMod.EliteLevel = 1;
                }
                bll.UpdateByID(cdataMod);
                break;

            case "edit1":
                Response.Redirect("AddContent.aspx?GID=" + e.CommandArgument.ToString());
                break;

            case "del2":    //本人才拥有删除权限
                cdataMod = bll.GetCommonData(Convert.ToInt32(e.CommandArgument.ToString()));
                if (buser.GetLogin().UserName.Equals(cdataMod.Inputer))
                {
                    bll.SetDel(Convert.ToInt32(e.CommandArgument.ToString()));    //进入回收站
                }
                break;
            }
            DataBind();
        }
Esempio n. 18
0
        public ActionResult AddContent()
        {
            M_CommonData Cdata = new M_CommonData();

            if (Mid > 0)
            {
                Cdata   = conBll.GetCommonData(Mid);
                NodeID  = Cdata.NodeID;
                ModelID = Cdata.ModelID;
            }
            else
            {
                Cdata.ModelID = ModelID;
                Cdata.NodeID  = NodeID;
            }
            if ((ModelID < 1 && NodeID < 1) && Mid < 1)
            {
                function.WriteErrMsg("参数错误"); return(Content(""));
            }
            M_ModelInfo model   = modBll.GetModelById(ModelID);
            M_Templata  nodeMod = tempBll.SelReturnModel(NodeID);

            if (Mid > 0)
            {
                if (mu.UserName != Cdata.Inputer)
                {
                    function.WriteErrMsg("不能编辑不属于自己输入的内容!"); return(Content(""));
                }
                DataTable dtContent = conBll.GetContent(Mid);
                //ViewBag.modelhtml = fieldBll.InputallHtml(Cdata.ModelID, Cdata.NodeID, new ModelConfig()
                //{
                //    Source = ModelConfig.SType.UserContent,
                //    ValueDT = dtContent
                //});
            }
            else
            {
                //ViewBag.modelhtml = fieldBll.InputallHtml(ModelID, NodeID, new ModelConfig()
                //{
                //    Source = ModelConfig.SType.UserContent
                //});
            }
            ViewBag.NodeName = nodeMod.TemplateName;
            ViewBag.ds       = fieldBll.SelByModelID(ModelID, true);
            ViewBag.op       = (Mid < 1 ? "添加" : "修改") + model.ItemName;
            ViewBag.tip      = "向 <a href='MyContent?NodeId=" + nodeMod.TemplateID + "'>[" + nodeMod.TemplateName + "]</a> 节点" + ViewBag.op;
            return(View(Cdata));
        }
Esempio n. 19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(base.Request.QueryString["ItemID"]))
     {
         int          ItemID   = DataConverter.CLng(base.Request.QueryString["ItemID"]);
         B_Content    bcontent = new B_Content();
         B_Model      bmode    = new B_Model();
         B_Node       bnode    = new B_Node();
         M_CommonData ItemInfo = bcontent.GetCommonData(ItemID);
         if (ItemInfo.IsNull)
         {
             Response.Write("[产生错误的可能原因:您访问的内容信息不存在!]");
         }
         M_ModelInfo modelinfo   = bmode.GetModelById(ItemInfo.ModelID);
         string      TempNode    = bnode.GetModelTemplate(ItemInfo.NodeID, ItemInfo.ModelID);
         string      TempContent = ItemInfo.Template;
         string      TemplateDir = modelinfo.ContentModule;
         if (!string.IsNullOrEmpty(TempContent))
         {
             TemplateDir = TempContent;
         }
         else
         {
             if (!string.IsNullOrEmpty(TempNode))
             {
                 TemplateDir = TempNode;
             }
         }
         if (string.IsNullOrEmpty(TemplateDir))
         {
             Response.Write("[产生错误的可能原因:该内容所属模型未指定模板!]");
         }
         else
         {
             TemplateDir = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + TemplateDir;
             TemplateDir = TemplateDir.Replace("/", @"\");
             string ContentHtml = this.bll.CreateHtml(FileSystemObject.ReadFile(TemplateDir), 0, ItemID);
             Response.Write(ContentHtml);
         }
     }
     else
     {
         Response.Write("[产生错误的可能原因:您访问的内容信息不存在!]");
     }
 }
Esempio n. 20
0
        public ActionResult EditContent()
        {
            if (!B_ARoleAuth.AuthCheckEx(ZLEnum.Auth.page, "manage"))
            {
                return(null);
            }
            M_CommonData Cdata = conBll.GetCommonData(Mid);

            if (Cdata == null)
            {
                function.WriteErrMsg("黄页内容不存在");
            }
            M_ModelInfo model   = modBll.SelReturnModel(Cdata.ModelID);
            M_Templata  nodeMod = tempBll.SelReturnModel(Cdata.NodeID);

            ViewBag.nodeMod = nodeMod;
            return(View(Cdata));
        }
Esempio n. 21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         if (!string.IsNullOrEmpty(Request.QueryString["ID"]))
         {
             m_ItemID = DataConverter.CLng(Request.QueryString["ID"]);
         }
         else
         {
             function.WriteErrMsg("没有指定内容ID!");
         }
         this.HdnItemID.Value = m_ItemID.ToString();
         int p = 0;
         if (!string.IsNullOrEmpty(Request.QueryString["p"]))
         {
             p = DataConverter.CLng(Request.QueryString["p"]);
         }
         m_Title             = bll.GetCommonData(m_ItemID).Title;
         this.HdnTitle.Value = m_Title;
         RepBind();
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            B_Admin badmin = new B_Admin();

            if (!IsPostBack)
            {
                Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>" + Resources.L.工作台 + "</a></li><li><a href='ContentManage.aspx'>" + Resources.L.内容管理 + "</a></li><li><a href='CreateHtmlContent.aspx'>" + Resources.L.生成发布 + "</a></li><li class='active'><a href='" + Request.RawUrl + "'>" + Resources.L.内容生成管理 + "</a></li>");
                //直接浏览
                if (ContentID > 0)
                {
                    string htmllink = bll.GetCommonData(ContentID).HtmlLink;
                    if (htmllink != "")
                    {
                        htmllink = "../../" + SiteConfig.SiteOption.GeneratedDirectory + htmllink;
                        Response.Redirect(htmllink);
                    }
                }
                //删除文件
                if (GeneralID > 0)
                {
                    string htmllink = bll.GetCommonData(GeneralID).HtmlLink;
                    if (!string.IsNullOrEmpty(htmllink))
                    {
                        string fleex = "." + htmllink.Split('.')[1];
                        FileSystemObject.Delete(Server.MapPath(htmllink), FsoMethod.File);
                        string HtmlLinkurl = htmllink.Replace(GeneralID + fleex, "");
                        //删除页面与其的分页
                        DirectoryInfo di = new DirectoryInfo(Server.MapPath(HtmlLinkurl));
                        FileInfo[]    ff = di.GetFiles(GeneralID + "_" + "*");
                        if (ff.Length != 0)
                        {
                            foreach (FileInfo fi in ff)
                            {
                                fi.Delete();
                            }
                        }
                        bll.UpdateCreate1(GeneralID);
                        function.WriteSuccessMsg(Resources.L.恭喜您删除成功 + "!", "ListHtmlContent.aspx");
                    }
                }
                this.BindOrder();
                MyBind();
            }
        }
Esempio n. 23
0
        public IActionResult AddContent()
        {
            M_CommonData Cdata = new M_CommonData();

            if (Mid > 0)
            {
                Cdata   = conBll.GetCommonData(Mid);
                NodeID  = Cdata.NodeID;
                ModelID = Cdata.ModelID;
            }
            else
            {
                Cdata.ModelID = ModelID;
                Cdata.NodeID  = NodeID;
            }
            if ((ModelID < 1 && NodeID < 1) && Mid < 1)
            {
                return(WriteErr("参数错误"));
            }
            M_ModelInfo model   = modBll.SelReturnModel(ModelID);
            M_Templata  nodeMod = tempBll.SelReturnModel(NodeID);

            if (Mid > 0)
            {
                if (mu.UserName != Cdata.Inputer)
                {
                    return(WriteErr("不能编辑不属于自己输入的内容!"));
                }
                DataTable dtContent = conBll.GetContent(Mid);
            }
            ViewBag.nodeMod = nodeMod;
            ViewBag.ds      = fieldBll.SelByModelID(ModelID, true);
            ViewBag.op      = (Mid < 1 ? "添加" : "修改") + model.ItemName;
            ViewBag.tip     = "向 <a href='MyContent?NodeId=" + nodeMod.TemplateID + "'>[" + nodeMod.TemplateName + "]</a> 节点" + ViewBag.op;
            return(View(Cdata));
        }
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            if (this.Page.IsValid)
            {
                int         ModelID = DataConverter.CLng(this.HdnModel.Value);
                M_ModelInfo model   = bmodel.GetModelById(ModelID);

                string ID = this.HdnID.Value;

                string[]  modarr = ID.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                DataTable dt     = this.bfield.GetModelFieldList(ModelID);

                Call      commCall = new Call();
                DataTable table    = commCall.GetDTFromPage(dt, Page, ViewState, null, false);
                GetTable(table);
                //DataTable table = new DataTable();
                //table.Columns.Add(new DataColumn("FieldName", typeof(string)));
                //table.Columns.Add(new DataColumn("FieldType", typeof(string)));
                //table.Columns.Add(new DataColumn("FieldValue", typeof(string)));
                //foreach (DataRow dr in dt.Rows)
                //{
                //    if (DataConverter.CBool(dr["IsNotNull"].ToString()))
                //    {
                //        if (string.IsNullOrEmpty(this.Page.Request.Form["txt_" + dr["FieldName"].ToString()]))
                //        {
                //            function.WriteErrMsg(dr["FieldAlias"].ToString() + "不能为空!");
                //        }
                //    }
                //    if (dr["FieldType"].ToString() == "FileType")
                //    {
                //        string[] Sett = dr["Content"].ToString().Split(new char[] { ',' });
                //        bool chksize = DataConverter.CBool(Sett[0].Split(new char[] { '=' })[1]);
                //        string sizefield = Sett[1].Split(new char[] { '=' })[1];
                //        if (chksize && sizefield != "")
                //        {
                //            DataRow row2 = table.NewRow();
                //            row2[0] = sizefield;
                //            row2[1] = "FileSize";
                //            row2[2] = this.Page.Request.Form["txt_" + sizefield];
                //            table.Rows.Add(row2);
                //        }
                //    }
                //    if (dr["FieldType"].ToString() == "MultiPicType")
                //    {
                //        string[] Sett = dr["Content"].ToString().Split(new char[] { ',' });
                //        bool chksize = DataConverter.CBool(Sett[0].Split(new char[] { '=' })[1]);
                //        string sizefield = Sett[1].Split(new char[] { '=' })[1];
                //        if (chksize && sizefield != "")
                //        {
                //            if (string.IsNullOrEmpty(this.Page.Request.Form["txt_" + sizefield]))
                //            {
                //                function.WriteErrMsg(dr["FieldAlias"].ToString() + "的缩略图不能为空!");
                //            }
                //            DataRow row1 = table.NewRow();
                //            row1[0] = sizefield;
                //            row1[1] = "ThumbField";
                //            row1[2] = this.Page.Request.Form["txt_" + sizefield];
                //            table.Rows.Add(row1);
                //        }
                //    }
                //    DataRow row = table.NewRow();
                //    row[0] = dr["FieldName"].ToString();
                //    string ftype = dr["FieldType"].ToString();
                //    if (ftype == "NumType")
                //    {
                //        string[] fd = dr["Content"].ToString().Split(new char[] { ',' });
                //        string[] fdty = fd[1].Split(new char[] { '=' });

                //        int numstyle = DataConverter.CLng(fdty[1]);
                //        if (numstyle == 1)
                //            ftype = "int";
                //        if (numstyle == 2)
                //            ftype = "float";
                //        if (numstyle == 3)
                //            ftype = "money";
                //    }

                //    row[1] = ftype;
                //    string fvalue = this.Page.Request.Form["txt_" + dr["FieldName"].ToString()];

                //    row[2] = fvalue;
                //    table.Rows.Add(row);
                //}
                B_Content bcc = new B_Content();
                for (int i = 0; i < modarr.Length; i++)
                {
                    M_CommonData mc     = bcc.GetCommonData(DataConverter.CLng(modarr[i]));
                    bool         result = buser.UpdateModelInfo(table, model.TableName, mc.ItemID);
                }
                function.WriteSuccessMsg("修改完成", "../Content/ContentManage.aspx?NodeID=" + this.HdnModelName.Value);

                //if (!string.IsNullOrEmpty(this.HdnModelName.Value))
                //    Response.Redirect("ContentManage.aspx?NodeID=" + this.HdnModelName.Value);
                //else
                //    Response.Redirect();
            }
        }
Esempio n. 25
0
        public ActionResult ShowPub()
        {
            GID   = DataConverter.CLng(Request["ID"]);
            PubID = DataConverter.CLng(Request["pid"]);
            string menu    = Request["menu"] ?? "";
            string Optimal = Request["Optimal"] ?? "";
            M_Pub  pubMod  = pubBll.GetSelect(PubID);

            if (pubMod != null)
            {
                switch (menu)
                {
                case "setinfo":
                {
                    if (Optimal.Equals("0"))
                    {
                        pubBll.UpdatePubModelByOptimal(pubMod.PubTableName, GID);
                        pubBll.UpdatePubModelById(pubMod.PubTableName, PubID);
                    }
                    else if (Optimal.Equals("1"))
                    {
                        pubBll.UpdatePubModelOptimal(pubMod.PubTableName, PubID);
                    }
                }
                break;

                case "setdb":
                {
                    if (Optimal.Equals("0"))
                    {
                        pubBll.Getdb(pubMod.PubTableName, GID);
                    }
                    else if (Optimal.Equals("2"))
                    {
                        pubBll.UpdatePubModelOptimal(pubMod.PubTableName, GID);
                    }
                }
                break;

                case "setnodb":
                {
                    if (Optimal.Equals("0"))
                    {
                        pubBll.Getnodb(pubMod.PubTableName, DataConverter.CLng(Request.QueryString["GID"]));
                    }
                    else if (Optimal.Equals("-1"))
                    {
                        pubBll.UpdatePubModelOptimal(pubMod.PubTableName, DataConverter.CLng(Request.QueryString["GID"]));
                    }
                }
                break;
                }
            }
            M_CommonData comMod      = conBll.GetCommonData(GID);
            int          ModelID     = comMod.ModelID;
            bool         IsLoginUser = comMod.Inputer.Equals(mu.UserName);
            //列表数据
            //PageSetting setting = IsLoginUser ? pubBll.SelPage(CPage, PSize, 0, GID, "", pubMod.PubTableName) : pubBll.SelPage(CPage, PSize, 0, GID, mu.UserName, pubMod.PubTableName);
            PageSetting setting = null;
            //详情数据
            DataRow   DataDr  = conBll.GetContentByItems(comMod.TableName, comMod.GeneralID).Rows[0]; //要显示的数据
            DataTable FieldDt = mfBll.GetModelFieldList(ModelID);                                     //要显示的字段列表
            DataTable newDt   = new DataTable();

            newDt.Columns.Add("Title");
            newDt.Columns.Add("Content");
            DataRow dr1 = newDt.NewRow(); dr1["Title"] = "ID"; dr1["Content"] = DataDr["GeneralID"]; newDt.Rows.Add(dr1);
            DataRow dr2 = newDt.NewRow(); dr2["Title"] = "标题"; dr2["Content"] = DataDr["Title"]; newDt.Rows.Add(dr2);

            foreach (DataRow dr in FieldDt.Rows)
            {
                DataRow row = newDt.NewRow();
                row["Title"]   = dr["FieldAlias"];
                row["Content"] = DataDr[dr["FieldName"].ToString()];
                newDt.Rows.Add(row);
            }
            ViewBag.Details     = newDt;
            ViewBag.IsLoginUser = IsLoginUser;
            PubTable            = pubMod.PubTableName;
            return(View(setting));
        }
Esempio n. 26
0
        public IActionResult Content()
        {
            M_CommonData ItemInfo = null;
            //M_UserInfo mu = buser.GetLogin();

            string title = GetParam("ID");

            if (ItemID > 0)
            {
                ItemInfo = conBll.GetCommonData(ItemID);
                nodeMod  = nodeBll.SelReturnModel(ItemInfo.NodeID);
                if (nodeMod == null || nodeMod.IsNull)
                {
                    return(ErrToClient("[产生错误的可能原因:(" + ItemInfo.NodeID + ")节点不存在!]"));
                }
                if (nodeMod.ItemOpenTypeTrue.Equals("cn"))
                {
                    return(ErrToClient("[产生错误的可能原因:内容信息不存在或未开放!调用方法:/Item/标题]"));
                }
            }
            else if (!string.IsNullOrEmpty(title))
            {
                ItemInfo = conBll.SelModelByTitle(title);
                nodeMod  = nodeBll.SelReturnModel(ItemInfo.NodeID);
                if (nodeMod == null || nodeMod.IsNull)
                {
                    return(ErrToClient("[产生错误的可能原因:(" + ItemInfo.NodeID + ")节点不存在!]"));
                }
                if (!nodeMod.ItemOpenTypeTrue.Equals("cn"))
                {
                    return(ErrToClient("[产生错误的可能原因:内容信息不存在或未开放!调用方法:/Item/内容GID]"));
                }
            }
            else
            {
                return(ErrToClient("[产生错误的可能原因:内容信息不存在或未开放!调用方法:/Item/内容GID]"));
            }
            if (ItemInfo == null || ItemInfo.IsNull)
            {
                return(ErrToClient("[产生错误的可能原因:[" + ItemID + "]内容信息不存在或未开放!]"));
            }
            //访问权限
            if (!string.IsNullOrEmpty(ItemInfo.UGroupAuth) && ("," + ItemInfo.UGroupAuth + ",").IndexOf("," + mu.GroupID + ",") < 0)
            {
                return(WriteErr("你无权访问该内容"));
            }
            M_ModelInfo modelinfo = modBll.SelReturnModel(ItemInfo.ModelID);

            //-----------------------------------------------------
            if (modelinfo == null || modelinfo.IsNull)
            {
                return(ErrToClient("[产生错误的可能原因:(" + ItemInfo.ModelID + ")模型不存在!]"));
            }
            if (ItemInfo.Status == (int)ZLEnum.ConStatus.Recycle)
            {
                return(ErrToClient("[当前信息已删除,您无法浏览!]"));
            }
            else if (ItemInfo.Status == (int)ZLEnum.ConStatus.UnAudit)
            {
                return(ErrToClient("[当前信息待审核状态,您无法浏览!]"));
            }
            else if (ItemInfo.Status != (int)ZLEnum.ConStatus.Audited)
            {
                return(ErrToClient("[当前信息未通过审核,您无法浏览!]"));
            }


            //-------------------------End;
            //自定义模板>节点模板
            string TemplateDir = ItemInfo.Template;

            if (string.IsNullOrEmpty(TemplateDir))
            {
                TemplateDir = nodeBll.GetModelTemplate(ItemInfo.NodeID, ItemInfo.ModelID);
            }
            if (string.IsNullOrEmpty(TemplateDir))
            {
                return(WriteErr("该内容所属模型未指定模板"));
            }
            try
            {
                return(HtmlToClient(Content_TemplateToHtml(TemplateDir)));
            }
            catch (Exception) { return(WriteErr("模板[" + TemplateDir + "]文件不存在")); }
        }
Esempio n. 27
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();");
         }
     }
 }
        public void PageContent()
        {
            if (ItemID < 1)
            {
                RepToClient("[产生错误的可能原因:您访问的内容信息不存在!访问规则:PageContent?ItemID=信息ID]"); return;
            }
            B_Model      bmode    = new B_Model();
            B_Node       bnode    = new B_Node();
            M_CommonData ItemInfo = conBll.GetCommonData(ItemID);

            if (ItemInfo.IsNull)
            {
                RepToClient("[产生错误的可能原因:内容信息不存在或未开放!]"); return;
            }
            M_ModelInfo modelinfo = bmode.GetModelById(ItemInfo.ModelID);

            M_Templata Nodeinfo    = tll.Getbyid(ItemInfo.NodeID);
            string     TemplateDir = GetTempPath(ItemInfo, Nodeinfo, pageID);

            if (string.IsNullOrEmpty(TemplateDir))
            {
                RepToClient("[产生错误的可能原因:该内容所属模型未指定模板!]"); return;
            }
            else
            {
                int Cpage = 1;
                if (string.IsNullOrEmpty(base.Request.QueryString["p"]))
                {
                    Cpage = 1;
                }
                else
                {
                    Cpage = DataConverter.CLng(base.Request.QueryString["p"]);
                }
                string ContentHtml = "";
                try
                {
                    ContentHtml = FileSystemObject.ReadFile(TemplateDir);
                }
                catch
                {
                    RepToClient("[产生错误的可能原因:该内容所属模型未指定模板!]"); return;
                }

                ContentHtml = this.createBll.CreateHtml(ContentHtml, Cpage, ItemID, 0);

                /* --------------------判断是否分页 并做处理------------------------------------------------*/
                if (!string.IsNullOrEmpty(ContentHtml))
                {
                    string infoContent = "";     //进行处理的内容字段
                    string pagelabel   = "";
                    string infotmp     = "";
                    #region 分页符分页
                    string pattern = @"{\#PageCode}([\s\S])*?{\/\#PageCode}";      //查找要分页的内容
                    if (Regex.IsMatch(ContentHtml, pattern, RegexOptions.IgnoreCase))
                    {
                        infoContent = Regex.Match(ContentHtml, pattern, RegexOptions.IgnoreCase).Value;
                        infotmp     = infoContent;
                        infoContent = infoContent.Replace("{#PageCode}", "").Replace("{/#PageCode}", "");
                        //查找分页标签
                        //bool flag = false;
                        bool   isPage   = false;
                        string pattern1 = @"{ZL\.Page([\s\S])*?\/}";
                        if (Regex.IsMatch(ContentHtml, pattern1, RegexOptions.IgnoreCase))
                        {
                            pagelabel = Regex.Match(ContentHtml, pattern1, RegexOptions.IgnoreCase).Value;
                            isPage    = true;
                        }
                        if (isPage)
                        {
                            if (string.IsNullOrEmpty(infoContent))     //没有设定要分页的字段内容
                            {
                                ContentHtml = ContentHtml.Replace(pagelabel, "");
                            }
                            else       //进行内容分页处理
                            {
                                //取分页标签处理结果 返回字符串数组 根据数组元素个数生成几页
                                string         ilbl       = pagelabel.Replace("{ZL.Page ", "").Replace("/}", "").Replace(" ", ",");
                                string         lblContent = "";
                                IList <string> ContentArr = new List <string>();
                                if (string.IsNullOrEmpty(ilbl))
                                {
                                    lblContent = "{loop}<a href=\"{$pageurl/}\">{$pageid/}</a>$$$<b>[{$pageid/}]</b>{/loop}";     //默认格式的分页导航
                                    ContentArr = this.createBll.GetContentPage(infoContent);
                                }
                                else
                                {
                                    string[] paArr = ilbl.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                                    if (paArr.Length == 0)
                                    {
                                        lblContent = "{loop}<a href=\"{$pageurl/}\">{$pageid/}</a>$$$<b>[{$pageid/}]</b>{/loop}";     //默认格式的分页导航
                                        ContentArr = this.createBll.GetContentPage(infoContent);
                                    }
                                    else
                                    {
                                        string  lblname = paArr[0].Split(new char[] { '=' })[1].Replace("\"", "");
                                        B_Label blbl    = new B_Label();
                                        lblContent = blbl.GetLabelXML(lblname).Content;
                                        if (string.IsNullOrEmpty(lblContent))
                                        {
                                            lblContent = "{loop}<a href=\"{$pageurl/}\">{$pageid/}</a>$$$<b>[{$pageid/}]</b>{/loop}";     //默认格式的分页导航
                                        }
                                        ContentArr = this.createBll.GetContentPage(infoContent);
                                    }
                                }

                                if (ContentArr.Count > 0)     //存在分页数据
                                {
                                    ContentHtml = ContentHtml.Replace(infotmp, ContentArr[CPage - 1]);
                                    ContentHtml = ContentHtml.Replace(pagelabel, this.createBll.GetPage(lblContent, ItemID, CPage, ContentArr.Count, ContentArr.Count));
                                }
                                else
                                {
                                    ContentHtml = ContentHtml.Replace(infotmp, infoContent);
                                    ContentHtml = ContentHtml.Replace(pagelabel, "");
                                }
                            }
                        }
                        else      //没有分页标签
                        {
                            //如果设定了分页内容字段 将该字段内容的分页标志清除
                            if (!string.IsNullOrEmpty(infoContent))
                            {
                                ContentHtml = ContentHtml.Replace(infotmp, infoContent);
                            }
                        }
                    }
                    #endregion

                    pattern = @"{\#Content}([\s\S])*?{\/\#Content}";      //查找要分页的内容
                    if (Regex.IsMatch(ContentHtml, pattern, RegexOptions.IgnoreCase))
                    {
                        infoContent = Regex.Match(ContentHtml, pattern, RegexOptions.IgnoreCase).Value;
                        infotmp     = infoContent;
                        infoContent = infoContent.Replace("{#Content}", "").Replace("{/#Content}", "");

                        //查找分页标签
                        //bool flag = false;
                        bool   isPage   = false;
                        string pattern1 = @"{ZL\.Page([\s\S])*?\/}";
                        if (Regex.IsMatch(ContentHtml, pattern1, RegexOptions.IgnoreCase))
                        {
                            pagelabel = Regex.Match(ContentHtml, pattern1, RegexOptions.IgnoreCase).Value;
                            isPage    = true;
                        }
                        if (isPage)
                        {
                            if (string.IsNullOrEmpty(infoContent))     //没有设定要分页的字段内容
                            {
                                ContentHtml = ContentHtml.Replace(pagelabel, "");
                            }
                            else       //进行内容分页处理
                            {
                                //取分页标签处理结果 返回字符串数组 根据数组元素个数生成几页
                                string         ilbl       = pagelabel.Replace("{ZL.Page ", "").Replace("/}", "").Replace(" ", ",");
                                string         lblContent = "";
                                int            NumPerPage = 500;
                                IList <string> ContentArr = new List <string>();

                                if (string.IsNullOrEmpty(ilbl))
                                {
                                    lblContent = "{loop}<a href=\"{$pageurl/}\">{$pageid/}</a>$$$<b>[{$pageid/}]</b>{/loop}";     //默认格式的分页导航
                                    ContentArr = this.createBll.GetContentPage(infoContent, NumPerPage);
                                }
                                else
                                {
                                    string[] paArr = ilbl.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                                    if (paArr.Length == 0)
                                    {
                                        lblContent = "{loop}<a href=\"{$pageurl/}\">{$pageid/}</a>$$$<b>[{$pageid/}]</b>{/loop}";     //默认格式的分页导航
                                        ContentArr = this.createBll.GetContentPage(infoContent, NumPerPage);
                                    }
                                    else
                                    {
                                        string lblname = paArr[0].Split(new char[] { '=' })[1].Replace("\"", "");
                                        if (paArr.Length > 1)
                                        {
                                            NumPerPage = DataConverter.CLng(paArr[1].Split(new char[] { '=' })[1].Replace("\"", ""));
                                        }
                                        B_Label blbl = new B_Label();
                                        lblContent = blbl.GetLabelXML(lblname).Content;
                                        if (string.IsNullOrEmpty(lblContent))
                                        {
                                            lblContent = "{loop}<a href=\"{$pageurl/}\">{$pageid/}</a>$$$<b>[{$pageid/}]</b>{/loop}";     //默认格式的分页导航
                                        }
                                        ContentArr = this.createBll.GetContentPage(infoContent, NumPerPage);
                                    }
                                }
                                if (ContentArr.Count > 0)     //存在分页数据
                                {
                                    ContentHtml = ContentHtml.Replace(infotmp, ContentArr[Cpage - 1]);
                                    ContentHtml = ContentHtml.Replace(pagelabel, this.createBll.GetPage(lblContent, ItemID, CPage, ContentArr.Count, NumPerPage));
                                }
                                else
                                {
                                    ContentHtml = ContentHtml.Replace(infotmp, infoContent);
                                    ContentHtml = ContentHtml.Replace(pagelabel, "");
                                }
                            }
                        }
                        else      //没有分页标签
                        {
                            //如果设定了分页内容字段 将该字段内容的分页标志清除
                            if (!string.IsNullOrEmpty(infoContent))
                            {
                                ContentHtml = ContentHtml.Replace(infotmp, infoContent);
                            }
                        }
                    }
                }
                string patterns   = @"{ZL\.Page([\s\S])*?\/}";
                string pagelabels = Regex.Match(ContentHtml, patterns, RegexOptions.IgnoreCase).Value;
                if (pagelabels != "")
                {
                    ContentHtml = ContentHtml.Replace(pagelabels, "");
                }
                /*--------------------- 分页内容处理结束-------------------------------------------------------------------------*/
                Response.Write(ContentHtml);
            }
        }
Esempio n. 29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (function.isAjax())
            {
                string action = Request["action"];
                string value  = Request["value"].Trim();
                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();
            }
            DataTable ds = new DataTable();

            if ((ModelID > 0 && NodeID > 0) || GeneralID > 0)
            {
                M_CommonData commdata = new M_CommonData();
                int          nodeid = 0, modelid = 0;
                if (GeneralID > 0)
                {
                    commdata = contentBll.GetCommonData(this.GeneralID);
                    nodeid   = commdata.NodeID;
                    modelid  = commdata.ModelID;
                }
                else
                {
                    nodeid  = NodeID;
                    modelid = ModelID;
                }
                ds           = mfieldBll.SelByModelID(modelid, true);
                bt_txt.Text  = GetAlias("Title", ds);
                gjz_txt.Text = GetAlias("Tagkey", ds);
                Label4.Text  = GetAlias("Subtitle", ds);
                py.Text      = GetAlias("PYtitle", ds);
                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='glyphicon glyphicon-info-sign'></span> 尚未定义专题</div>";
                }
                if (!IsPostBack)
                {
                    if (!string.IsNullOrEmpty(Request.QueryString["Source"]))
                    {
                        function.Script(this, "SetContent();");
                    }
                    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();");
                    }
                    nodename.Value = nodeMod.NodeName;
                    M_ModelInfo model     = modelBll.GetModelById(modelid);
                    string      optionstr = GeneralID > 0 ? "修改" : "添加";
                    this.Tips_L.Text       = "向" + nodeMod.NodeName + "节点" + optionstr + model.ItemName;
                    this.Node_L.Text       = this.nodeBll.GetNodeXML(nodeid).NodeName;
                    content_tite.InnerText = optionstr + "内容";
                    Label1.Text            = optionstr + model.ItemName;
                    EBtnSubmit.Text        = optionstr + model.ItemName;

                    //if (GeneralID>0)
                    //{
                    //    MyBind(commdata);
                    //    GetNodePreate(nodeid, buser.GetLogin());
                    //}
                    //else
                    //{
                    ModelHtml.Text = mfieldBll.InputallHtml(modelid, nodeid, new ModelConfig()
                    {
                        Source = ModelConfig.SType.UserContent
                    });
                    //}
                }
            }
            else
            {
                function.WriteErrMsg("参数错误!!");
            }
        }
Esempio n. 30
0
    protected void EBtnSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            DataTable dt    = this.mfbll.GetModelFieldList(int.Parse(this.HiddenField1.Value)).Tables[0];
            DataTable table = new DataTable();
            table.Columns.Add(new DataColumn("FieldName", typeof(string)));
            table.Columns.Add(new DataColumn("FieldType", typeof(string)));
            table.Columns.Add(new DataColumn("FieldValue", typeof(string)));

            foreach (DataRow dr in dt.Rows)
            {
                if (DataConverter.CBool(dr["IsNotNull"].ToString()))
                {
                    if (string.IsNullOrEmpty(this.Page.Request.Form["txt_" + dr["FieldName"].ToString()]))
                    {
                        function.WriteErrMsg(dr["FieldAlias"].ToString() + "不能为空!");
                    }
                }
                if (dr["FieldType"].ToString() == "FileType")
                {
                    string[] Sett      = dr["Content"].ToString().Split(new char[] { ',' });
                    bool     chksize   = DataConverter.CBool(Sett[0].Split(new char[] { '=' })[1]);
                    string   sizefield = Sett[1].Split(new char[] { '=' })[1];
                    if (chksize && sizefield != "")
                    {
                        DataRow row2 = table.NewRow();
                        row2[0] = sizefield;
                        row2[1] = "FileSize";
                        row2[2] = this.Page.Request.Form["txt_" + sizefield];
                        table.Rows.Add(row2);
                    }
                }
                if (dr["FieldType"].ToString() == "MultiPicType")
                {
                    string[] Sett      = dr["Content"].ToString().Split(new char[] { ',' });
                    bool     chksize   = DataConverter.CBool(Sett[0].Split(new char[] { '=' })[1]);
                    string   sizefield = Sett[1].Split(new char[] { '=' })[1];
                    if (chksize && sizefield != "")
                    {
                        if (string.IsNullOrEmpty(this.Page.Request.Form["txt_" + sizefield]))
                        {
                            function.WriteErrMsg(dr["FieldAlias"].ToString() + "的缩略图不能为空!");
                        }
                        DataRow row1 = table.NewRow();
                        row1[0] = sizefield;
                        row1[1] = "ThumbField";
                        row1[2] = this.Page.Request.Form["txt_" + sizefield];
                        table.Rows.Add(row1);
                    }
                }
                DataRow row = table.NewRow();
                row[0] = dr["FieldName"].ToString();
                string ftype = dr["FieldType"].ToString();
                row[1] = ftype;
                string fvalue = this.Page.Request.Form["txt_" + dr["FieldName"].ToString()];
                if (ftype == "TextType" || ftype == "MultipleTextType" || ftype == "MultipleHtmlType")
                {
                    fvalue = sll.ProcessSen(fvalue);
                }
                row[2] = fvalue;
                table.Rows.Add(row);
            }

            string uname = ubll.GetLogin().UserName;

            DataRow rs4 = table.NewRow();
            rs4[0] = "StoreName";
            rs4[1] = "TextType";
            rs4[2] = this.Nametxt.Text;
            table.Rows.Add(rs4);

            DataRow rs5 = table.NewRow();
            rs5[0] = "StoreStyleID";
            rs5[1] = "int";
            rs5[2] = DataConverter.CLng(this.SSTDownList.Text);
            table.Rows.Add(rs5);

            M_StoreStyleTable sst = sstbll.GetStyleByID(int.Parse(this.SSTDownList.Text));

            M_CommonData CData = cbll.GetCommonData(gid);
            CData.Template = sst.StyleUrl;
            CData.Title    = this.Nametxt.Text;
            //throw new Exception();
            cbll.UpdateContent(table, CData);
            Response.Write("<script language=javascript>alert('提交成功!');location.href='Default.aspx';</script>");
        }
        catch (Exception ee)
        {
            function.WriteErrMsg(ee.Message);
        }
    }