/// <summary> /// 递归添加子节点 /// </summary> /// <param name="cRow"></param> private void BuildSubTree(DataRow cRow) { var i = 0; _stringBuilder.Append(",\"children\":["); foreach (var iRow in cRow.GetChildRows("NodeRelation")) { if (i != 0) { _stringBuilder.Append(","); } var text = iRow["AreaName"].ToString().Trim(); var no = iRow["AreaId"].ToString().Trim(); var href = Request.QueryString["menu"] + "?AreaId=" + no; //_stringBuilder.Append("{\"data\":{\"title\": \"" + text + "\",\"attr\": { \"href\": \"" + href + "\", \"target\": \"center\" }},\"attr\": { \"id\": \"" + no + "\" }"); if (iRow.GetChildRows("NodeRelation").Length <= 0) { _stringBuilder.Append("{\"data\":{\"title\": \"" + text + "\",\"icon\": \"jstree-iconla\",\"attr\": { \"href\": \"" + href + "\", \"target\": \"center\" }},\"attr\": { \"id\": \"" + no + "\" }"); } else { _stringBuilder.Append("{\"data\":{\"title\": \"" + text + "\",\"attr\": { \"href\": \"" + href + "\", \"target\": \"center\" }},\"attr\": { \"id\": \"" + no + "\" }"); } i++; BuildSubTree(iRow); _stringBuilder.Append("}"); } List <SqlParameter> parameters = new List <SqlParameter>(); var parameter = new SqlParameter("@AreaId", DbType.AnsiString) { Value = cRow["AreaId"] }; parameters.Add(parameter); var dt = new OrgOrganize().GetList(" AreaId=@AreaId and OrgType=5 and Status=1 ", parameters).Tables[0]; if (dt.Rows.Count > 0) { var k = 0; for (int j = 0; j < dt.Rows.Count; j++) { if (i != 0 || k != 0) { _stringBuilder.Append(","); } var text = dt.Rows[j]["OrgName"].ToString().Trim(); var no = dt.Rows[j]["OrgId"].ToString().Trim(); var href = Request.QueryString["menu"] + "?OId=" + no; _stringBuilder.Append("{\"data\":{\"title\": \"" + text + "\",\"icon\": \"jstree-iconWS\",\"attr\": { \"href\": \"" + href + "\", \"target\": \"center\" }},\"attr\": { \"id\": \"" + no + "\" }"); k++; _stringBuilder.Append("}"); } } _stringBuilder.Append("]"); }
public static string Nav(Admin.Model.TempInfo timodel, object spid, object itid) { #region 导航 var str = ""; if (0 != timodel.ParentID) { var imodel = infosDal.GetModel(Convert.ToInt32(timodel.ParentID)); if (null != imodel) { str = "<div class=\"backup\"><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid + "&itid=" + itid + "\" class=\"back_btn backfirst\">返回首页</a><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid + "&tiid=" + imodel.TIID + "&itid=" + itid + "\" class=\"back_btn\">返回上级</a> </div>"; } } else { #region 分站名称 StaPackage _staPackageDal = new StaPackage(); OrgOrganize _orgOrganizeDal = new OrgOrganize(); var spmodel = _staPackageDal.GetModel(Convert.ToInt32(spid)); if (null != spmodel) { var orgmodel = _orgOrganizeDal.GetModel(Convert.ToInt64(spmodel.OrgId)); if (null != orgmodel) { str = "<div class=\"logo\"><img src=\"/images/LOGO-yt.png\" style=\"display: block; width: 50px; height: 50px;\" alt=\"沿途\" /></div><div class=\"title\"><strong>" + orgmodel.OrgName + "</strong><span>" + orgmodel.EnName + "</span></div>"; } } #endregion } return(str); #endregion }
protected void Page_Load(object sender, EventArgs e) { VerifyPage("", true); if (!IsPostBack) { var spid = Request.QueryString["spid"]; if (!string.IsNullOrEmpty(spid)) { #region 左侧分类 var itid = Request.QueryString["itid"]; //分类id if (!string.IsNullOrEmpty(itid)) { var model = _infoTypeDal.GetModel(Convert.ToInt32(itid)); if (null != model) { litType.Text = Service.GetType(Convert.ToInt32(model.ITID), spid); } } else { litType.Text = Service.GetType(0, spid); } #endregion #region 块内容 var tiid = Request.QueryString["tiid"]; if (!string.IsNullOrEmpty(tiid)) { TempInfo _tempInfoDal = new TempInfo(); var timodel = _tempInfoDal.GetModel(Convert.ToInt32(tiid)); if (null != timodel) { #region 导航 var ptiid = Request.QueryString["ptiid"]; if (!string.IsNullOrEmpty(ptiid)) { litStaName.Text = "<div class=\"backup\"><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid + "&itid=" + Request.QueryString["itid"] + "\" class=\"back_btn backfirst\">返回首页</a><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid + "&tiid=" + ptiid + "&itid=" + Request.QueryString["itid"] + "\" class=\"back_btn\">返回上级</a> </div>"; } else { #region 分站名称 StaPackage _staPackageDal = new StaPackage(); OrgOrganize _orgOrganizeDal = new OrgOrganize(); var spmodel = _staPackageDal.GetModel(Convert.ToInt32(spid)); if (null != spmodel) { var orgmodel = _orgOrganizeDal.GetModel(Convert.ToInt64(spmodel.OrgId)); if (null != orgmodel) { litStaName.Text = "<div class=\"logo\"><img src=\"/images/LOGO-yt.png\" style=\"display: block; width: 50px; height: 50px;\" alt=\"沿途\" /></div><div class=\"title\"><strong>" + orgmodel.OrgName + "</strong><span>" + orgmodel.EnName + "</span></div>"; } } #endregion } #endregion #region 分页 litPager.Text = "<td><input type=\"button\" class=\"btn btn-sm delpage\" value=\"删除\" style=\"width: 50px;\" /></td>";; #endregion litInfo1.Text = GetBtn(timodel, 1); } } #endregion } } }
protected void Page_Load(object sender, EventArgs e) { VerifyPage("", true); if (!IsPostBack) { var spid = Request.QueryString["spid"]; if (!string.IsNullOrEmpty(spid)) { #region 左侧分类 var itid = Request.QueryString["itid"]; //分类id if (!string.IsNullOrEmpty(itid)) { var model = _infoTypeDal.GetModel(Convert.ToInt32(itid)); if (null != model) { litType.Text = Service.GetType(Convert.ToInt32(model.ITID), spid); } } else { litType.Text = Service.GetType(0, spid); } #endregion #region 块内容 var tiid = Request.QueryString["tiid"]; if (!string.IsNullOrEmpty(tiid)) { TempInfo _tempInfoDal = new TempInfo(); var timodel = _tempInfoDal.GetModel(Convert.ToInt32(tiid)); if (null != timodel) { #region 导航 if (0 != timodel.ParentID) { var imodel = infosDal.GetModel(Convert.ToInt32(timodel.ParentID)); if (null != imodel) { litStaName.Text = "<div class=\"backup\"><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid + "&itid=" + Request.QueryString["itid"] + "\" class=\"back_btn backfirst\">返回首页</a><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid + "&tiid=" + imodel.TIID + "&itid=" + Request.QueryString["itid"] + "\" class=\"back_btn\">返回上级</a> </div>"; } } else { #region 分站名称 StaPackage _staPackageDal = new StaPackage(); OrgOrganize _orgOrganizeDal = new OrgOrganize(); var spmodel = _staPackageDal.GetModel(Convert.ToInt32(spid)); if (null != spmodel) { var orgmodel = _orgOrganizeDal.GetModel(Convert.ToInt64(spmodel.OrgId)); if (null != orgmodel) { litStaName.Text = "<div class=\"logo\"><img src=\"/images/LOGO-yt.png\" style=\"display: block; width: 50px; height: 50px;\" alt=\"沿途\" /></div><div class=\"title\"><strong>" + orgmodel.OrgName + "</strong><span>" + orgmodel.EnName + "</span></div>"; } } #endregion } #endregion #region 分页 var pager = ""; List <SqlParameter> parDef = new List <SqlParameter>(); var preitModel = _tempInfoDal.GetModel( " ITID=" + timodel.ITID + " and ParentID=" + timodel.ParentID + " and TIPage=" + (timodel.TIPage - 1), parDef); if (null != preitModel) { pager += "<td><a href=\"/Manage/Template/Redircet.aspx?itid=" + Request.QueryString["itid"] + "&spid=" + Request.QueryString["spid"] + "&tiid=" + preitModel.TIID + "\" class=\"btn btnprev\" data-tiid=\"" + preitModel.TIID + "\">上页 </a></td>"; } else { pager += "<td> </td>"; } var count = _tempInfoDal.GetList(" TIPage is not null and TIPage!='' and ITID=" + timodel.ITID + " and ParentID=" + timodel.ParentID, parDef).Tables[0].Rows.Count; if (count > 1) { pager += "<td>页码 </td><td><input type=\"text\" class=\"form-control input-sm iptpno\" value=\"" + timodel.TIPage + "\" style=\"width: 40px;display:inline;text-align: center;\" /> /" + count + "</td><td><input data-parcount=\"" + timodel.ParentID + "\" data-count=\"" + count + "\" type=\"button\" class=\"btn btn-sm repage\" value=\"跳转\" style=\"width: 70px;\" /></td><td><input type=\"button\" class=\"btn btn-sm editpno\" value=\"修改页码\" style=\"width: 70px;\" /></td><td><input type=\"button\" class=\"btn btn-sm delpage\" value=\"删除当前页\" /></td>"; } else if (count == 1) { pager += "<td><input type=\"button\" class=\"btn btn-sm delpage\" value=\"删除当前页\" /></td>"; } var nexitModel = _tempInfoDal.GetModel( " ITID=" + timodel.ITID + " and ParentID=" + timodel.ParentID + " and TIPage=" + (timodel.TIPage + 1), parDef); if (null != nexitModel) { pager += "<td><a href=\"/Manage/Template/Redircet.aspx?itid=" + Request.QueryString["itid"] + "&spid=" + Request.QueryString["spid"] + "&tiid=" + nexitModel.TIID + "\" class=\"btn btnnext\" data-tiid=\"" + nexitModel.TIID + "\">下页 </a></td>"; } else { pager += "<td> </td>"; litNewPage.Text = "<a href=\"/Manage/Systems/ChooseNewsTemplate.aspx?page=" + (timodel.TIPage + 1) + "&pid=" + timodel.ParentID + "&itid=" + Request.QueryString["itid"] + "&spid=" + Request.QueryString["spid"] + "&tiid=" + timodel.TIID + "\" class=\" btn btn-add newpage\">新建内容页</a> <a href=\"/Manage/News/RedircetAD.aspx?itid=" + Request.QueryString["itid"] + "&spid=" + Request.QueryString["spid"] + "&tiid=" + timodel.TIID + "\" class=\"btn btn-add newpage\" style=\"top:50%\">添加文末广告</a>"; } litPager.Text = pager; #endregion List <SqlParameter> par1 = new List <SqlParameter>(); var tmpPar1 = templateParDal.GetModel(" TID=" + timodel.TID + " and SortNum=1 ", par1); var str = "<div class=\"box col-sm-12 ht2\" style=\"text-align:inherit\">"; var dtInfo = infosDal.GetList(" TIID=" + timodel.TIID, par1).Tables[0]; if (dtInfo.Rows.Count > 0) { for (int i = 0; i < dtInfo.Rows.Count; i++) { var point = "/images/hand.png"; if ("" != dtInfo.Rows[i]["ADPic"].ToString()) { point = "/UploadFiles/" + dtInfo.Rows[i]["ADPic"]; } str += "<div class=\"news-pic\" style=\"top:" + dtInfo.Rows[i]["YPosition"] + "px;left:" + dtInfo.Rows[i]["XPosition"] + "px;\"><a href=\"javascript:;\" data-iid=\"" + dtInfo.Rows[i]["IID"] + "\" class=\"btn edit-pic\">编辑</a> <a href=\"javascript:;\" data-iid=\"" + dtInfo.Rows[i]["IID"] + "\" class=\"btn del-pic\">删除</a><img src=\"" + point + "\" style=\"background-color:transparent\"/></div>"; } if (dtInfo.Rows.Count < 4) { str += "<div class=\"btnbox\"><a href=\"javascript:;\" class=\"btn new-info\" data-bgw=\"" + tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight + "\">新增热点</a> <a href=\"javascript:;\" class=\"btn edit-bpic\" data-bgw=\"" + tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight + "\" data-tiid=\"" + timodel.TIID + "\">编辑背景</a></div>"; } else { str += "<div class=\"btnbox\"><a href=\"javascript:;\" data-bgw=\"" + tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight + "\" class=\"btn edit-bpic\" data-tiid=\"" + timodel.TIID + "\">编辑背景</a></div>"; } } else { str += "<div class=\"btnbox\"><a href=\"javascript:;\" class=\"btn new-info\" data-bgw=\"" + tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight + "\">新增热点</a> <a href=\"javascript:;\" class=\"btn edit-bpic\" data-bgw=\"" + tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight + "\" data-tiid=\"" + timodel.TIID + "\">上传背景</a>"; //str += " <a href=\"javascript:;\" class=\"btn select-info\" data-sortnum=\"1\">选择</a>"; str += "</div>"; } if (!string.IsNullOrEmpty(timodel.AttID)) { str += "<img src=\"/UploadFiles/" + timodel.AttID + "\">"; } else { str += "<img>"; } str += "</div>"; litInfo1.Text = str; } } #endregion } } }
protected void Page_Load(object sender, EventArgs e) { VerifyPage("", true); if (!IsPostBack) { var spid = Request.QueryString["spid"]; if (!string.IsNullOrEmpty(spid)) { #region 左侧分类 var itid = Request.QueryString["itid"]; //分类id if (!string.IsNullOrEmpty(itid)) { var model = _infoTypeDal.GetModel(Convert.ToInt32(itid)); if (null != model) { litType.Text = Service.GetType(Convert.ToInt32(model.ITID), spid); } } else { litType.Text = Service.GetType(0, spid); } #endregion #region 块内容 var tiid = Request.QueryString["tiid"]; if (!string.IsNullOrEmpty(tiid)) { TempInfo _tempInfoDal = new TempInfo(); var timodel = _tempInfoDal.GetModel(Convert.ToInt32(tiid)); if (null != timodel) { #region 导航 var ptiid = Request.QueryString["ptiid"]; if (!string.IsNullOrEmpty(ptiid)) { litStaName.Text = "<div class=\"backup\"><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid + "&itid=" + Request.QueryString["itid"] + "\" class=\"back_btn backfirst\">返回首页</a><a href=\"/Manage/Template/Redircet.aspx?spid=" + spid + "&tiid=" + ptiid + "&itid=" + Request.QueryString["itid"] + "\" class=\"back_btn\">返回上级</a> </div>"; } else { #region 分站名称 StaPackage _staPackageDal = new StaPackage(); OrgOrganize _orgOrganizeDal = new OrgOrganize(); var spmodel = _staPackageDal.GetModel(Convert.ToInt32(spid)); if (null != spmodel) { var orgmodel = _orgOrganizeDal.GetModel(Convert.ToInt64(spmodel.OrgId)); if (null != orgmodel) { litStaName.Text = "<div class=\"logo\"><img src=\"/images/LOGO-yt.png\" style=\"display: block; width: 50px; height: 50px;\" alt=\"沿途\" /></div><div class=\"title\"><strong>" + orgmodel.OrgName + "</strong><span>" + orgmodel.EnName + "</span></div>"; } } #endregion } #endregion #region 分页 litPager.Text = "<td><input type=\"button\" class=\"btn btn-sm delpage\" value=\"删除\" style=\"width: 50px;\" /></td>";; #endregion #region var sortNum = 1; List <SqlParameter> par1 = new List <SqlParameter>(); var tmpPar1 = _templateParDal.GetModel(" TID=" + timodel.TID + " and SortNum=" + sortNum + " ", par1); var info1 = _infosDal.GetModel(" TIID=" + timodel.TIID + " and SortNum=" + sortNum + " ", par1); if (null != info1) { var user = (OrgUsers)HttpContext.Current.Session["CurrentUser"]; #region 纯图广告反显 if (info1.IType == 7) { #region 右侧推荐 litInfo1.Text += "<div class=\"txtbox tmenu\"><ul>"; List <SqlParameter> par = new List <SqlParameter>(); par.Add(new SqlParameter("@IID", DbType.AnsiString) { Value = info1.IID }); var dt = _adInfosDal.GetListAI(" AdInfos.IID=@IID ", par).Tables[0]; if (dt.Rows.Count > 0) { if (dt.Rows.Count < 6) { litInfo1.Text += "<li class=\"tit\"><span class=\"btn btnadd add-rec\" data-iid=\"" + info1.IID + "\">添加推荐</span> </li>"; } else { litInfo1.Text += "<li class=\"tit\"></li>"; } for (int i = 0; i < dt.Rows.Count; i++) { litInfo1.Text += "<li title=\"" + dt.Rows[i]["IName"] + "\"><span class=\"del del-rec\" data-aiid=\"" + dt.Rows[i]["AIID"] + "\">删除</span><a href=\"/Manage/Template/Redircet.aspx?spid=" + Request.QueryString["spid"] + "&pid=" + dt.Rows[i]["Inf_IID"] + "&itid=" + Request.QueryString["itid"] + "\"><span class=\"hot\"></span>" + (dt.Rows[i]["IName"].ToString().Length > 12 ? dt.Rows[i]["IName"].ToString().Substring(0, 12) + "..." : dt.Rows[i]["IName"].ToString()) + "</a></li>"; } } else { litInfo1.Text += "<li class=\"tit\"><span class=\"btn btnadd add-rec\" data-iid=\"" + info1.IID + "\">添加推荐</span> </li>"; } litInfo1.Text += " </ul></div>"; #endregion litInfo1.Text += "<div class=\"btnbox\" style=\"top:54%;right:10%;display:none\"><a href=\"javascript:;\" class=\"btn edit-info\" data-iid=\"" + info1.IID + "\" data-sortnum=\"" + sortNum + "\" data-bgw=\"" + tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight + "\">编辑</a> <a href=\"javascript:;\" class=\"btn del-info\" data-iid=\"" + info1.IID + "\" data-sortnum=\"" + sortNum + "\" data-bgw=\"" + tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight + "\">删除</a>"; if (1 == user.Type) { if (1 == info1.Status) { litInfo1.Text += " <a href=\"javascript:;\" class=\"btn sin-info btn-warning\" data-iid=\"" + info1.IID + "\">标记</a>"; } else { litInfo1.Text += " <a href=\"javascript:;\" class=\"btn sin-info btn-warning\" data-iid=\"" + info1.IID + "\">取消标记</a>"; } } else { if (0 == info1.Status) { litInfo1.Text += " <span class=\"btn btn-editing\">待修改</span>"; } } litInfo1.Text += "</div><img style=\"height: 606px; display: block; width: 756px;\" src=\"/UploadFiles/" + info1.PicAttID + "\">"; } #endregion } else { litInfo1.Text = "<div class=\"btnbox\"><a href=\"javascript:;\" class=\"btn new-info\" data-sortnum=\"" + sortNum + "\" data-bgw=\"" + tmpPar1.BgWidth + "\" data-bgh=\"" + tmpPar1.BgHeight + "\">新增</a>"; //litInfo1.Text += " <a href=\"javascript:;\" class=\"btn select-info\" data-sortnum=\"" + // sortNum + // "\">选择</a>"; litInfo1.Text += "</div><img>"; } #endregion } } #endregion } } }