private void MyBind() { PName_T.Text = SiteConfig.SiteInfo.SiteName; if (Mid > 0) { classMod = classBll.SelReturnModel(Mid); Name_T.Text = classMod.Name; Remind_T.Text = classMod.Remind; CDate_L.Text = classMod.CDate.ToString(); } if (Pid > 0) { M_Design_TlpClass pmod = classBll.SelReturnModel(Pid); PName_T.Text = pmod.Name; } }
protected void Save_Btn_Click(object sender, EventArgs e) { if (Mid > 0) { classMod = classBll.SelReturnModel(Mid); } classMod.Name = Name_T.Text; classMod.Remind = Remind_T.Text; if (classMod.ID > 0) { classBll.UpdateByID(classMod); } else { classMod.Pid = Pid; classMod.Depth = classBll.GetDepth(Pid); classMod.AdminID = B_Admin.GetLogin().AdminId; classBll.Insert(classMod); } function.WriteSuccessMsg("操作成功", "TlpClass.aspx"); }
protected void Page_Load(object sender, EventArgs e) { //模板预览 if (TlpID > 0) { DataTable tlpdt = DBCenter.Sel("ZL_Design_Page", "TlpID=" + TlpID + " AND SiteID=0 AND (Path='' OR Path='/' OR Path='/index' OR Path='index')"); if (tlpdt.Rows.Count > 0) { Response.Redirect("/Design/PreView.aspx?ID=" + tlpdt.Rows[0]["Guid"]); return; } else { function.WriteErrMsg("模板未指定首页,无法预览"); } } if (!IsPostBack) { if (!string.IsNullOrEmpty(Mid)) { pageMod = pageBll.SelModelByGuid(Mid); } else if (!string.IsNullOrEmpty(Path)) { pageMod = pageBll.SelModelByPath(Domain, Path); } if (pageMod == null || pageMod.ID < 1) { function.WriteErrMsg("页面不存在"); } pageMod = pageBll.MergeGlobal(pageMod, ""); if (pageMod.comp_global.Count > 0) { comp_global = JsonConvert.SerializeObject(pageMod.comp_global); } //------站点 M_Design_SiteInfo sfMod = sfBll.SelReturnModel(pageMod.SiteID); if (pageMod.IsTemplate)//浏览模板 { tlpprompt_div.Visible = true; M_UserInfo mu = buser.GetLogin(); M_Design_Tlp tlpMod = tlpBll.SelReturnModel(pageMod.TlpID); M_Design_TlpClass tcMod = tcBll.SelReturnModel(tlpMod.ClassID); Title_L.Text = tlpMod.TlpName + "_" + pageMod.Title; tlpinfo_sp.InnerHtml = "模板名称:" + tlpMod.TlpName + " 归属分类:" + tcMod.Name; if (mu.IsNull) { nologin_wrap.Visible = true; } else { logged_wrap.Visible = true; } } else if (sfMod != null)//浏览用户站点 { sitecfg = sfBll.ToSiteCfg(sfMod); Title_L.Text = sfMod.SiteName + "_" + pageMod.Title; } else { Title_L.Text = pageMod.Title; } //------解析标签 if (!string.IsNullOrEmpty(pageMod.labelArr)) { DataTable labelDT = new DataTable(); labelDT.Columns.Add(new DataColumn("guid", typeof(string))); labelDT.Columns.Add(new DataColumn("label", typeof(string))); labelDT.Columns.Add(new DataColumn("htmlTlp", typeof(string))); string[] labelArr = pageMod.labelArr.Trim('|').Split('|'); foreach (string label in labelArr) { DataRow dr = labelDT.NewRow(); dr["guid"] = label.Split(':')[0]; dr["label"] = label.Split(':')[1]; string html = createBll.CreateHtml(StringHelper.Base64StringDecode(dr["label"].ToString())); dr["htmlTlp"] = StringHelper.Base64StringEncode(html); labelDT.Rows.Add(dr); } extendData = JsonConvert.SerializeObject(labelDT); } //------解析页面属性 Resource_L.Text = pageMod.Resource; Meta_L.Text = pageMod.Meta; } }