public static string Pager(Admin.Model.TempInfo timodel, object spid, object itid, out string newpage) { #region 分页 var pager = ""; newpage = ""; 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=" + itid + "&spid=" + spid + "&tiid=" + preitModel.TIID + "\" class=\"btn btnprev\" data-tiid=\"" + preitModel.TIID + "\">上页 </a></td>"; } else { pager += "<td> </td>"; } var count = _tempInfoDal.GetList(" 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=" + itid + "&spid=" + spid + "&tiid=" + nexitModel.TIID + "\" class=\"btn btnnext\" data-tiid=\"" + nexitModel.TIID + "\">下页 </a></td>"; } else { pager += "<td> </td>"; newpage = "<a href=\"/Manage/Systems/ChooseTemplate.aspx?page=" + (timodel.TIPage + 1) + "&pid=" + timodel.ParentID + "&itid=" + itid + "&spid=" + spid + "&tiid=" + timodel.TIID + "\" class=\"btn btn-add nepage\">新建模板页</a>"; } return(pager); #endregion }
protected void Page_Load(object sender, EventArgs e) { VerifyPage("", false); if (!IsPostBack) { #region var itid = Request.QueryString["itid"]; var spid = Request.QueryString["spid"]; var pid = Request.QueryString["pid"]; var tiid = Request.QueryString["tiid"]; if (!string.IsNullOrEmpty(tiid)) { var model = _tempInfoDal.GetModel(Convert.ToInt32(tiid)); if (null != model) { var template = _templatesDal.GetModel(Convert.ToInt32(model.TID)); if (null != template) { Response.Redirect(template.TLink + "?itid=" + model.ITID + "&tiid=" + tiid + "&spid=" + spid + "&pid=" + pid, true); } } } else if (!string.IsNullOrEmpty(pid) && !string.IsNullOrEmpty(itid) && !string.IsNullOrEmpty(spid)) { List <SqlParameter> parDef = new List <SqlParameter>(); parDef.Add(new SqlParameter("@ParentID", DbType.AnsiString) { Value = pid }); var timodel = _tempInfoDal.GetModel(" ParentID=@ParentID and TIPage=1 ", parDef); if (null != timodel) { var template = _templatesDal.GetModel(Convert.ToInt32(timodel.TID)); if (null != template) { Response.Redirect(template.TLink + "?itid=" + timodel.ITID + "&tiid=" + timodel.TIID + "&spid=" + spid + "&pid=" + pid, true); } } else { Response.Redirect("/Manage/Systems/CreateFirstNews.aspx" + "?page=1&spid=" + spid + "&itid=" + itid + "&pid=" + pid, true); } } #endregion } }
private void BindOrgName() { var timodel = _tempInfoDal.GetModel(Convert.ToInt32(Request.QueryString["tiid"])); if (null != timodel) { var sql = "select Infos.* from Infos join TempInfo on Infos.TIID=TempInfo.TIID join Templates on TempInfo.TID=Templates.TID where Templates.TID=@TID and Infos.SortNum=@SortNum and TempInfo.TIID!=@TIID"; Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(sql); dbCommand.Parameters.Add(new SqlParameter("@TID", DbType.Int32) { Value = timodel.TID }); dbCommand.Parameters.Add(new SqlParameter("@SortNum", DbType.Int32) { Value = Request.QueryString["sortnum"] }); dbCommand.Parameters.Add(new SqlParameter("@TIID", DbType.Int32) { Value = Request.QueryString["tiid"] }); var dt = db.ExecuteDataSet(dbCommand).Tables[0]; ddlOrgName.DataSource = dt; ddlOrgName.DataTextField = "IName"; ddlOrgName.DataValueField = "IID"; ddlOrgName.DataBind(); ddlOrgName.Items.Insert(0, new ListItem("请选择", "-1")); ddlOrgName.SelectedIndex = 0; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var tiid = Request.QueryString["tiid"]; if (!string.IsNullOrEmpty(tiid)) { var timodel = _tempInfoDal.GetModel(Convert.ToInt32(tiid)); if (null != timodel && !string.IsNullOrEmpty(timodel.AttID)) { //var fname = timodel.AttID.Substring(36); var fname = ""; if ("C0pY" == timodel.AttID.Substring(0, 4)) { fname = timodel.AttID.Substring(76); } else { fname = timodel.AttID.Substring(36); } litPic.Text = "<div class=\"upatta\" title=\"" + fname + "\" data-file=\"" + timodel.AttID + "\"><div class=\"upsigin\"><div class=\"at-file\"><img width=\"220\" id=\"at-img\" src=\"/UploadFiles/" + timodel.AttID + "\"><span class=\"at-name\">" + (fname.Length > 15 ? fname.Substring(0, 15) + "..." : fname) + "</span></div></div></div>"; } } } }
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 导航 litStaName.Text = Service.Nav(timodel, Request.QueryString["spid"], Request.QueryString["itid"]); #endregion #region 分页 var newpage = ""; litPager.Text = Service.Pager(timodel, Request.QueryString["spid"], Request.QueryString["itid"], out newpage); litNewPage.Text = newpage; #endregion litInfo1.Text = Service.GetBtn(timodel, 1, Request.QueryString["spid"], Request.QueryString["itid"]); litInfo2.Text = Service.GetBtn(timodel, 2, Request.QueryString["spid"], Request.QueryString["itid"]); litInfo3.Text = Service.GetBtn(timodel, 3, Request.QueryString["spid"], Request.QueryString["itid"]); litInfo4.Text = Service.GetBtn(timodel, 4, Request.QueryString["spid"], Request.QueryString["itid"]); litInfo5.Text = Service.GetBtn(timodel, 5, Request.QueryString["spid"], Request.QueryString["itid"]); litInfo6.Text = Service.GetBtnNoSpace(timodel, 6, Request.QueryString["spid"], Request.QueryString["itid"]); litInfo7.Text = Service.GetBtnNoSpace(timodel, 7, Request.QueryString["spid"], Request.QueryString["itid"]); } } #endregion } } }
protected void Page_Load(object sender, EventArgs e) { VerifyPage("", true); var itid = Request.QueryString["itid"]; if (!string.IsNullOrEmpty(itid)) { try { var pid = string.IsNullOrEmpty(Request.QueryString["pid"]) ? 0 : Convert.ToInt32(Request.QueryString["pid"]); //var page=string.IsNullOrEmpty(Request.QueryString["page"])?1:Convert.ToInt32(Request.QueryString["page"]); var model = _infoTypeDal.GetModel(Convert.ToInt32(itid)); if (null != model) { var timodel = new Admin.Model.TempInfo { ITID = model.ITID, ParentID = pid, TID = Convert.ToInt32(Request.QueryString["tid"]) }; var sql = " ITID='" + model.ITID + "' and ParentID='" + pid + "' "; if (!string.IsNullOrEmpty(Request.QueryString["page"])) { timodel.TIPage = Convert.ToInt32(Request.QueryString["page"]); sql += " and TIPage='" + timodel.TIPage + "' "; } else { sql += " and (TIPage is null or TIPage='') "; } var exit = _tempInfoDal.GetModel(sql, new List <SqlParameter>()); if (null != exit) { Response.Write("1|~|无法重复创建页面模板,请刷新后重试"); Response.End(); } var tiid = _tempInfoDal.Add(timodel); if (tiid > 0) { Response.Write("0|~|" + tiid); Response.End(); } else { Response.Write("1|~|操作失败"); Response.End(); } } } catch (System.Threading.ThreadAbortException ex) { } catch (Exception ee) { Response.Write("1|~|" + ee.Message); Response.End(); } } }
private string GetDdl(string siid) { var str = new StringBuilder(); str.Append("<div style=\"margin-top: 5px;\" id=\"ddladlink\">"); str.Append("<select class=\"ddlinfo\"><option value=\"\">无</option>"); var timodel = _tempInfoDal.GetModel(Convert.ToInt32(Request.QueryString["tiid"])); if (null != timodel) { var sql = "select Infos.IID,Infos.IName from Infos join TempInfo on TempInfo.TIID=Infos.TIID join InfoType on InfoType.ITID=TempInfo.ITID where InfoType.SPID=@SPID"; Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(sql); dbCommand.Parameters.Add(new SqlParameter("@SPID", DbType.Int32) { Value = Request.QueryString["spid"] }); var dt = db.ExecuteDataSet(dbCommand).Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { if (siid == dt.Rows[i]["IID"].ToString()) { str.Append("<option selected=\"selected\" value=\"" + dt.Rows[i]["IID"] + "\">" + dt.Rows[i]["IName"] + "</option>"); } else { str.Append("<option value=\"" + dt.Rows[i]["IID"] + "\">" + dt.Rows[i]["IName"] + "</option>"); } } } } str.Append("</select>"); str.Append("</div>"); return(str.ToString()); }
private void BindOrgName() { var timodel = _tempInfoDal.GetModel(Convert.ToInt32(Request.QueryString["tiid"])); if (null != timodel) { //var sql = "select Infos.* from Infos where IID in(select IID from InfoLabel where ALID in(select ALID from InfoLabel where IID=@IID)) and IID not in (select Inf_IID from AdInfos where IID=@OIID) "; var sql = "select distinct(Infos.IID),Infos.IName from Infos join InfoLabel on InfoLabel.IID=Infos.IID and InfoLabel.ALID in(select ALID from InfoLabel where IID=@IID) and Infos.IID not in (select Inf_IID from AdInfos where IID=@OIID) join TempInfo on TempInfo.TIID=Infos.TIID join InfoType on InfoType.ITID=TempInfo.ITID where InfoType.SPID in(select InfoType.SPID from InfoType join TempInfo on TempInfo.ITID=InfoType.ITID and TempInfo.TIID=@TIID)"; sql += " order by Infos.IID desc "; Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(sql); //dbCommand.Parameters.Add(new SqlParameter("@TID", DbType.Int32) { Value = timodel.TID }); //dbCommand.Parameters.Add(new SqlParameter("@SortNum", DbType.Int32) { Value = Request.QueryString["sortnum"] }); dbCommand.Parameters.Add(new SqlParameter("@IID", DbType.Int32) { Value = timodel.ParentID }); dbCommand.Parameters.Add(new SqlParameter("@OIID", DbType.Int32) { Value = Request.QueryString["iid"] }); dbCommand.Parameters.Add(new SqlParameter("@TIID", DbType.Int32) { Value = timodel.TIID }); var dt = db.ExecuteDataSet(dbCommand).Tables[0]; ddlOrgName.DataSource = dt; ddlOrgName.DataTextField = "IName"; ddlOrgName.DataValueField = "IID"; ddlOrgName.DataBind(); ddlOrgName.Items.Insert(0, new ListItem("请选择", "-1")); ddlOrgName.SelectedIndex = 0; } }
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("", false); ePath = Server.MapPath("/UpLoad/"); try { var id = Request.QueryString["spid"]; var sortnum = Request.QueryString["sortnum"]; var itid = Request.QueryString["itid"]; var batta = HttpUtility.UrlDecode(Request.QueryString["batta"]); var tiid = Request.QueryString["tiid"]; var name = HttpUtility.UrlDecode(Request.QueryString["name"]); var iid = Request.QueryString["iid"]; var xPosition = Request.QueryString["xposition"]; var yPosition = Request.QueryString["yposition"]; var diid = Request.QueryString["diid"]; var bpic = HttpUtility.UrlDecode(Request.QueryString["bpic"]); var aatta = HttpUtility.UrlDecode(Request.QueryString["aatta"]); var adtype = Request.QueryString["adtype"]; Database db = DatabaseFactory.CreateDatabase(); #region 设置背景图 if (!string.IsNullOrEmpty(bpic) && !string.IsNullOrEmpty(tiid)) { var timodel = _tempInfoDal.GetModel(Convert.ToInt32(tiid)); if (null != timodel) { if (bpic != timodel.AttID) { if (File.Exists(ePath + bpic)) { var fi = new FileInfo(ePath + bpic); fi.MoveTo(Server.MapPath("/UploadFiles/" + bpic)); timodel.AttID = bpic; var res = _tempInfoDal.Update(timodel); if (res) { Response.Write("0|~|" + tiid); Response.End(); } else { Response.Write("1|~|操作失败"); Response.End(); } } } else { Response.Write("0|~|" + tiid); Response.End(); } } } #endregion #region 除热点 if (!string.IsNullOrEmpty(diid)) { var infomodel = _infosDal.GetModel(Convert.ToInt32(diid)); if (null != infomodel) { _infosDal.Delete(infomodel.IID); List <SqlParameter> parameters = new List <SqlParameter>(); var dtatta = _attaListDal.GetList(" IID=" + infomodel.IID, parameters).Tables[0]; if (dtatta.Rows.Count > 0) { for (int i = 0; i < dtatta.Rows.Count; i++) { var del = "delete from AttaList where ALID='" + dtatta.Rows[i]["ALID"] + "'; "; DbCommand dbCommanddel = db.GetSqlStringCommand(del); db.ExecuteNonQuery(dbCommanddel); if (DBNull.Value != dtatta.Rows[i]["AttID"]) { if (!string.IsNullOrEmpty(dtatta.Rows[i]["AttID"].ToString())) { if (File.Exists(Server.MapPath("/UploadFiles/" + dtatta.Rows[i]["AttID"]))) { var fi = new FileInfo(Server.MapPath("/UploadFiles/" + dtatta.Rows[i]["AttID"])); fi.Delete(); } } } } } Response.Write("0|~|" + iid); Response.End(); } } #endregion var attsql = string.Empty; #region 修改热点 if (!string.IsNullOrEmpty(iid)) { var infomodel = _infosDal.GetModel(Convert.ToInt32(iid)); infomodel.IName = name; infomodel.XPosition = xPosition; infomodel.YPosition = yPosition; infomodel.HotType = Convert.ToInt32(adtype); #region 热点图片/视频 List <SqlParameter> parameters = new List <SqlParameter>(); var dtatta = _attaListDal.GetList(" IID=" + infomodel.IID, parameters).Tables[0]; if (!string.IsNullOrEmpty(batta)) { var list = batta.Split(':'); foreach (var s in list) { if (!string.IsNullOrEmpty(s)) { if (dtatta.Select(" AttID='" + s + "' ").Length <= 0) { if (File.Exists(ePath + s)) { var fi = new FileInfo(ePath + s); fi.MoveTo(Server.MapPath("/UploadFiles/" + s)); attsql += "insert into AttaList(AttID,IID)values (N'" + s + "','" + infomodel.IID + "');"; } } } } if (dtatta.Rows.Count > 0) { for (int i = 0; i < dtatta.Rows.Count; i++) { if (!list.Contains(dtatta.Rows[i]["AttID"])) { var del = "delete from AttaList where ALID='" + dtatta.Rows[i]["ALID"] + "'; "; DbCommand dbCommanddel = db.GetSqlStringCommand(del); db.ExecuteNonQuery(dbCommanddel); if (DBNull.Value != dtatta.Rows[i]["AttID"]) { if (!string.IsNullOrEmpty(dtatta.Rows[i]["AttID"].ToString())) { if (File.Exists(Server.MapPath("/UploadFiles/" + dtatta.Rows[i]["AttID"]))) { var fi = new FileInfo( Server.MapPath("/UploadFiles/" + dtatta.Rows[i]["AttID"])); fi.Delete(); } } } } } } } else { for (int i = 0; i < dtatta.Rows.Count; i++) { var del = "delete from AttaList where ALID='" + dtatta.Rows[i]["ALID"] + "'; "; DbCommand comdel = db.GetSqlStringCommand(del); db.ExecuteNonQuery(comdel); if (DBNull.Value != dtatta.Rows[i]["AttID"]) { if (!string.IsNullOrEmpty(dtatta.Rows[i]["AttID"].ToString())) { if (File.Exists(Server.MapPath("/UploadFiles/" + dtatta.Rows[i]["AttID"]))) { var fi = new FileInfo(Server.MapPath("/UploadFiles/" + dtatta.Rows[i]["AttID"])); fi.Delete(); } } } } } #endregion #region 热点图标 if (!string.IsNullOrEmpty(aatta)) { if (aatta != infomodel.ADPic) { if (File.Exists(ePath + aatta)) { var fi = new FileInfo(ePath + aatta); fi.MoveTo(Server.MapPath("/UploadFiles/" + aatta)); infomodel.ADPic = aatta; } } } else { infomodel.ADPic = ""; } #endregion if (!string.IsNullOrEmpty(attsql)) { DbCommand dbCommandAtt = db.GetSqlStringCommand(attsql); db.ExecuteNonQuery(dbCommandAtt); } var upres = _infosDal.Update(infomodel); if (upres) { Response.Write("0|~|" + iid); Response.End(); } else { Response.Write("1|~|操作失败"); Response.End(); } } #endregion #region 新增热点 else { var inmodel = new Admin.Model.Infos(); inmodel.IName = name; inmodel.Status = 1; inmodel.IType = 5; inmodel.TIID = Convert.ToInt32(tiid); inmodel.XPosition = xPosition; inmodel.YPosition = yPosition; inmodel.SortNum = 1; inmodel.NType = 0; inmodel.HotType = Convert.ToInt32(adtype); if (!string.IsNullOrEmpty(aatta)) { if (File.Exists(ePath + aatta)) { var fi = new FileInfo(ePath + aatta); fi.MoveTo(Server.MapPath("/UploadFiles/" + aatta)); inmodel.ADPic = aatta; } } var aiid = _infosDal.Add(inmodel); if (!string.IsNullOrEmpty(batta)) { var labArray = batta.Split(':'); foreach (var s in labArray) { if (!string.IsNullOrEmpty(s)) { if (File.Exists(ePath + s)) { var fi = new FileInfo(ePath + s); fi.MoveTo(Server.MapPath("/UploadFiles/" + s)); var ilmodel = new Admin.Model.AttaList(); ilmodel.IID = aiid; ilmodel.AttID = s; _attaListDal.Add(ilmodel); } } } } Response.Write("0|~|" + aiid); Response.End(); } #endregion } catch (System.Threading.ThreadAbortException ex) { } catch (Exception ee) { Response.Write("1|~|" + ee.Message); Response.End(); } }
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 导航 litStaName.Text = Service.Nav(timodel, Request.QueryString["spid"], Request.QueryString["itid"]); #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\" style=\"top:33%\">新建内容页</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:53%\">添加文末广告</a>"; } litPager.Text = pager; #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) { #region 图文资讯反显 var user = (OrgUsers)HttpContext.Current.Session["CurrentUser"]; if (info1.IType == 4) { litInfo1.Text = "<div class=\"btnbox\" style=\"top:54%;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>"; litInfo1.Text += "<div class=\"txtbox tbox" + info1.ConPosition + "\"><div class=\"pd\" style=\"font-size:" + info1.ConSize + "px;color:#" + info1.ConColor + "; word-break: break-all;\">" + info1.Context + "</div></div><img src=\"/UploadFiles/" + info1.PicAttID + "\" style=\"height:606px; display:block; width:100%;\">"; 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]; } #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 } } }
protected void Page_Load(object sender, EventArgs e) { VerifyPage("", true); var iid = Request.QueryString["siid"]; var tiid = Request.QueryString["tiid"]; if (!string.IsNullOrEmpty(iid) && !string.IsNullOrEmpty(tiid)) { try { var imodel = _infosDal.GetModel(Convert.ToInt32(iid)); if (null != imodel) { var timodel = _tempInfoDal.GetModel(Convert.ToInt32(tiid)); if (null != timodel) { Database db = DatabaseFactory.CreateDatabase(); using (DbConnection conn = db.CreateConnection()) { conn.Open(); DbTransaction trans = conn.BeginTransaction(); try { AddInfo(db, trans, imodel, Convert.ToInt32(tiid), Convert.ToInt32(timodel.ITID)); trans.Commit(); conn.Close(); Response.Write("0|~|"); Response.End(); } catch (System.Threading.ThreadAbortException ex) { } catch (Exception ee) { trans.Rollback(); conn.Close(); Response.Write("1|~|" + ee.Message); Response.End(); } } } else { Response.Write("1|~|操作失败"); Response.End(); } } else { Response.Write("1|~|操作失败"); Response.End(); } } catch (System.Threading.ThreadAbortException ex) { } catch (Exception ee) { Response.Write("1|~|" + ee.Message); Response.End(); } } }
protected void Page_Load(object sender, EventArgs e) { VerifyPage("", true); var tiid = Request.QueryString["tiid"]; var rtiid = Request.QueryString["rtiid"]; var tipage = Request.QueryString["tipage"]; var delad = Request.QueryString["delad"]; try { #region 除页面 if (!string.IsNullOrEmpty(tiid)) { var timodel = _tempInfoDal.GetModel(Convert.ToInt32(tiid)); if (null != timodel) { Database db = DatabaseFactory.CreateDatabase(); using (DbConnection conn = db.CreateConnection()) { conn.Open(); DbTransaction trans = conn.BeginTransaction(); try { DelTemplate(db, trans, Convert.ToInt32(timodel.TIID)); StringBuilder strSql3 = new StringBuilder(); strSql3.Append("select * from TempInfo where ParentID=" + timodel.ParentID + " and ITID=" + timodel.ITID + " and TIPage>" + timodel.TIPage); DbCommand dbCommandDel = db.GetSqlStringCommand(strSql3.ToString()); var dt = db.ExecuteDataSet(dbCommandDel, trans).Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { var sql = "update TempInfo set TIPage=TIPage-1 where TIID=" + dt.Rows[i]["TIID"]; DbCommand dbCommand2 = db.GetSqlStringCommand(sql.ToString()); db.ExecuteNonQuery(dbCommand2, trans); } } trans.Commit(); conn.Close(); Response.Write("0|~|" + (timodel.ParentID.ToString() == "0"?"":timodel.ParentID.ToString())); Response.End(); } catch (ThreadAbortException ex) { } catch (Exception ee) { trans.Rollback(); conn.Close(); Response.Write("1|~|" + ee.Message); Response.End(); } } } else { Response.Write("1|~|操作失败"); Response.End(); } } #endregion #region 修改页码 if (!string.IsNullOrEmpty(rtiid) && !string.IsNullOrEmpty(tipage)) { var timodel = _tempInfoDal.GetModel(Convert.ToInt32(rtiid)); if (null != timodel) { Database db = DatabaseFactory.CreateDatabase(); using (DbConnection conn = db.CreateConnection()) { conn.Open(); DbTransaction trans = conn.BeginTransaction(); try { StringBuilder strSql4 = new StringBuilder(); strSql4.Append("select * from TempInfo where ITID=" + timodel.ITID + " and ParentID=" + timodel.ParentID); DbCommand dbCommand4 = db.GetSqlStringCommand(strSql4.ToString()); var dt4 = db.ExecuteDataSet(dbCommand4, trans).Tables[0]; if (dt4.Rows.Count < Convert.ToInt32(tipage)) { conn.Close(); Response.Write("1|~|页码必须小于总页数"); Response.End(); } if (Convert.ToInt32(tipage) == timodel.TIPage) { conn.Close(); Response.Write("0|~|"); Response.End(); } if (Convert.ToInt32(tipage) > timodel.TIPage) { StringBuilder strSql3 = new StringBuilder(); strSql3.Append("select * from TempInfo where ITID=" + timodel.ITID + " and ParentID=" + timodel.ParentID + " and TIPage>" + timodel.TIPage + " and TIPage<=" + Convert.ToInt32(tipage)); DbCommand dbCommandDel = db.GetSqlStringCommand(strSql3.ToString()); var dt = db.ExecuteDataSet(dbCommandDel, trans).Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { var sql = "update TempInfo set TIPage=TIPage-1 where TIID=" + dt.Rows[i]["TIID"]; DbCommand dbCommand2 = db.GetSqlStringCommand(sql.ToString()); db.ExecuteNonQuery(dbCommand2, trans); } } var osql = "update TempInfo set TIPage=" + Convert.ToInt32(tipage) + " where TIID=" + timodel.TIID; DbCommand dbCommando = db.GetSqlStringCommand(osql.ToString()); db.ExecuteNonQuery(dbCommando, trans); } else { StringBuilder strSql3 = new StringBuilder(); strSql3.Append("select * from TempInfo where ITID=" + timodel.ITID + " and ParentID=" + timodel.ParentID + " and TIPage>=" + Convert.ToInt32(tipage) + " and TIPage<" + timodel.TIPage); DbCommand dbCommandDel = db.GetSqlStringCommand(strSql3.ToString()); var dt = db.ExecuteDataSet(dbCommandDel, trans).Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { var sql = "update TempInfo set TIPage=TIPage+1 where TIID=" + dt.Rows[i]["TIID"]; DbCommand dbCommand2 = db.GetSqlStringCommand(sql.ToString()); db.ExecuteNonQuery(dbCommand2, trans); } } var osql = "update TempInfo set TIPage=" + Convert.ToInt32(tipage) + " where TIID=" + timodel.TIID; DbCommand dbCommando = db.GetSqlStringCommand(osql.ToString()); db.ExecuteNonQuery(dbCommando, trans); } trans.Commit(); conn.Close(); Response.Write("0|~|"); Response.End(); } catch (ThreadAbortException ex) { } catch (Exception ee) { trans.Rollback(); conn.Close(); Response.Write("1|~|" + ee.Message); Response.End(); } } } else { Response.Write("1|~|操作失败"); Response.End(); } } #endregion #region 除广告 if (!string.IsNullOrEmpty(delad)) { Database db = DatabaseFactory.CreateDatabase(); using (DbConnection conn = db.CreateConnection()) { conn.Open(); DbTransaction trans = conn.BeginTransaction(); try { DelTemplate(db, trans, Convert.ToInt32(delad)); trans.Commit(); conn.Close(); Response.Write("0|~|"); Response.End(); } catch (ThreadAbortException ex) { } catch (Exception ee) { trans.Rollback(); conn.Close(); Response.Write("1|~|" + ee.Message); Response.End(); } } } #endregion } catch (System.Threading.ThreadAbortException ex) { } catch (Exception ee) { Response.Write("1|~|" + ee.Message); Response.End(); } }
private void BindOrgName() { var timodel = _tempInfoDal.GetModel(Convert.ToInt32(Request.QueryString["tiid"])); if (null != timodel) { //var sql = "select Infos.* from Infos where TIID in (select TIID from TempInfo where (ITID in(select ITID from InfoType where SPID in(select SPID from StaPackage join OrgOrganize on OrgOrganize.OrgId=StaPackage.OrgId where (OrgName='全国热点' or OrgOrganize.OrgId=(select OrgId from StaPackage join InfoType on InfoType.SPID=StaPackage.SPID where InfoType.ITID=@ITID)) ))) and TIID!=@TIID and TID=@TID) and Infos.SortNum=@SortNum "; //var sql = "select Infos.* from Infos where TIID in (select TIID from TempInfo where (ITID in(select ITID from InfoType where SPID in(select SPID from StaPackage join OrgOrganize on OrgOrganize.OrgId=StaPackage.OrgId where (OrgOrganize.OrgId=(select OrgId from StaPackage join InfoType on InfoType.SPID=StaPackage.SPID where InfoType.ITID=@ITID)) ))) and TIID!=@TIID and TID=@TID) and Infos.SortNum=@SortNum "; var sql = @"select Infos.IID,RootPackage.RPName+'-'+ (case StaPackage.PkgType when 0 then '默认资源包' else (select OrgOrganize.OrgName from OrgPkgList join OrgOrganize on OrgOrganize.OrgId=OrgPkgList.OrgId and OrgPkgList.SPID=StaPackage.SPID) end)+'-'+Infos.IName AS IName from Infos join TempInfo on TempInfo.TIID=Infos.TIID join InfoType on InfoType.ITID=TempInfo.ITID join StaPackage on StaPackage.SPID=InfoType.SPID join RootPackage on RootPackage.RPID=StaPackage.RPID join OrgOrganize on OrgOrganize.OrgId=StaPackage.OrgId where StaPackage.OrgId=(select OrgId from StaPackage join InfoType on InfoType.SPID=StaPackage.SPID where InfoType.ITID=@ITID) and TempInfo.TIID!=@TIID and TempInfo.TID=@TID and Infos.SortNum=@SortNum and (StaPackage.SPID in (select SPID from OrgPkgList) or StaPackage.SPID=@SPID) "; var itmodel = _infoTypeDal.GetModel(Convert.ToInt32(timodel.ITID)); if (null != itmodel) { var smodel = _staPackageDal.GetModel(Convert.ToInt32(itmodel.SPID)); if (null != smodel) { var org = _orgOrganizeDal.GetModel(Convert.ToInt64(smodel.OrgId)); if ("全国热点" == org.OrgName) { //sql = "select Infos.IID,(Infos.IName +'-'+ OrgOrganize.OrgName) as IName from Infos join TempInfo on TempInfo.TIID=Infos.TIID join InfoType on InfoType.ITID=TempInfo.ITID join StaPackage on StaPackage.SPID=InfoType.SPID join OrgOrganize on OrgOrganize.OrgId=StaPackage.OrgId where OrgOrganize.OrgId in (select OrgId from OrgOrganize where OrgType=1 and OrgId!='" + smodel.OrgId + "') and TempInfo.TIID!=@TIID and TID=@TID and Infos.SortNum=@SortNum"; sql = @"select Infos.IID,RootPackage.RPName+'-'+ (case StaPackage.PkgType when 0 then '默认资源包' else (select OrgOrganize.OrgName from OrgPkgList join OrgOrganize on OrgOrganize.OrgId=OrgPkgList.OrgId and OrgPkgList.SPID=StaPackage.SPID) end)+'-'+Infos.IName AS IName from Infos join TempInfo on TempInfo.TIID=Infos.TIID join InfoType on InfoType.ITID=TempInfo.ITID join StaPackage on StaPackage.SPID=InfoType.SPID join RootPackage on RootPackage.RPID=StaPackage.RPID join OrgOrganize on OrgOrganize.OrgId=StaPackage.OrgId where StaPackage.OrgId in (select OrgId from OrgOrganize where OrgType=1 and "; sql += "OrgId!='" + smodel.OrgId + "') and TempInfo.TIID!=@TIID and TempInfo.TID=@TID and Infos.SortNum=@SortNum and (StaPackage.SPID in (select SPID from OrgPkgList) or StaPackage.SPID=@SPID or StaPackage.SPID in (select StaPackage.SPID from StaPackage join RootPackage on RootPackage.RPID=StaPackage.RPID where StaPackage.PkgType=0 and RootPackage.RPID=(select RootPackage.RPID from RootPackage join StaPackage on RootPackage.RPID=StaPackage.RPID join InfoType on InfoType.SPID=StaPackage.SPID join TempInfo on InfoType.ITID=TempInfo.ITID where TempInfo.TIID=@TIID) )) "; } } } sql += " order by Infos.IID desc "; Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(sql); dbCommand.Parameters.Add(new SqlParameter("@TID", DbType.Int32) { Value = timodel.TID }); dbCommand.Parameters.Add(new SqlParameter("@SortNum", DbType.Int32) { Value = Request.QueryString["sortnum"] }); dbCommand.Parameters.Add(new SqlParameter("@TIID", DbType.Int32) { Value = timodel.TIID }); dbCommand.Parameters.Add(new SqlParameter("@ITID", DbType.Int32) { Value = timodel.ITID }); if (null != itmodel) { dbCommand.Parameters.Add(new SqlParameter("@SPID", DbType.Int32) { Value = itmodel.SPID }); } else { dbCommand.Parameters.Add(new SqlParameter("@SPID", DbType.Int32) { Value = "" }); } var dt = db.ExecuteDataSet(dbCommand).Tables[0]; ddlOrgName.DataSource = dt; ddlOrgName.DataTextField = "IName"; ddlOrgName.DataValueField = "IID"; ddlOrgName.DataBind(); ddlOrgName.Items.Insert(0, new ListItem("请选择", "-1")); ddlOrgName.SelectedIndex = 0; } }
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("", false); if (!IsPostBack) { #region 模板id var tiid = Request.QueryString["tiid"]; var itid = Request.QueryString["itid"]; var spid = Request.QueryString["spid"]; var pid = Request.QueryString["pid"]; var repage = Request.QueryString["repage"]; var parcount = Request.QueryString["parcount"]; if (!string.IsNullOrEmpty(repage) && !string.IsNullOrEmpty(parcount)) { List <SqlParameter> parDef = new List <SqlParameter>(); parDef.Add(new SqlParameter("@ParentID", DbType.AnsiString) { Value = parcount }); parDef.Add(new SqlParameter("@TIPage", DbType.AnsiString) { Value = repage }); parDef.Add(new SqlParameter("@ITID", DbType.AnsiString) { Value = itid }); var model = _tempInfoDal.GetModel(" ParentID=@ParentID and TIPage=@TIPage and ITID=@ITID ", parDef); if (null != model) { var template = _templatesDal.GetModel(Convert.ToInt32(model.TID)); if (null != template) { Response.Redirect(template.TLink + "?itid=" + model.ITID + "&tiid=" + model.TIID + "&spid=" + spid, true); } } } else if (!string.IsNullOrEmpty(tiid)) { var model = _tempInfoDal.GetModel(Convert.ToInt32(tiid)); if (null != model) { var template = _templatesDal.GetModel(Convert.ToInt32(model.TID)); if (null != template) { Response.Redirect(template.TLink + "?itid=" + model.ITID + "&tiid=" + tiid + "&spid=" + spid, true); } } } else if (!string.IsNullOrEmpty(pid)) { List <SqlParameter> parDef = new List <SqlParameter>(); parDef.Add(new SqlParameter("@ParentID", DbType.AnsiString) { Value = pid }); var timodel = _tempInfoDal.GetModel(" ParentID=@ParentID and TIPage=1 ", parDef); if (null != timodel) { var template = _templatesDal.GetModel(Convert.ToInt32(timodel.TID)); if (null != template) { var itmodel = _infoTypeDal.GetModel(Convert.ToInt32(timodel.ITID)); Response.Redirect(template.TLink + "?itid=" + timodel.ITID + "&tiid=" + timodel.TIID + "&spid=" + itmodel.SPID, true); } } else { var imodel = _infosDal.GetModel(Convert.ToInt32(pid)); if (null != imodel) { var tiModel = _tempInfoDal.GetModel(Convert.ToInt32(imodel.TIID)); if (null != tiModel) { var itmodel = _infoTypeDal.GetModel(Convert.ToInt32(tiModel.ITID)); if (null != itmodel) { Response.Redirect("/Manage/Systems/CreateFirstPage.aspx" + "?page=1&spid=" + itmodel.SPID + "&itid=" + itmodel.ITID + "&pid=" + pid, true); } } } } } else if (!string.IsNullOrEmpty(itid)) { var model = _infoTypeDal.GetModel(Convert.ToInt32(itid)); if (null != model) { List <SqlParameter> parDef = new List <SqlParameter>(); var itModel = _tempInfoDal.GetModel(" ITID=" + itid + " and TIPage=1 and ParentID=0 ", parDef); if (null != itModel) { var template = _templatesDal.GetModel(Convert.ToInt32(itModel.TID)); if (null != template) { Response.Redirect(template.TLink + "?spid=" + model.SPID + "&tiid=" + itModel.TIID + "&itid=" + itid, true); } } else { Response.Redirect("/Manage/Systems/CreateFirstPage.aspx" + "?page=1&spid=" + model.SPID + "&itid=" + itid, true); } } } else if (!string.IsNullOrEmpty(spid)) { List <SqlParameter> parDef = new List <SqlParameter>(); parDef.Add(new SqlParameter("@SPID", DbType.AnsiString) { Value = spid }); var itmodel = _infoTypeDal.GetModel(" SPID=@SPID and SortNum=1 ", parDef); if (null != itmodel) { List <SqlParameter> parDef1 = new List <SqlParameter>(); var tiModel = _tempInfoDal.GetModel(" ITID=" + itmodel.ITID + " and TIPage=1 and ParentID=0 ", parDef1); if (null != tiModel) { var template = _templatesDal.GetModel(Convert.ToInt32(tiModel.TID)); if (null != template) { Response.Redirect(template.TLink + "?itid=" + itmodel.ITID + "&tiid=" + tiModel.TIID + "&spid=" + itmodel.SPID, true); } } else { Response.Redirect("/Manage/Systems/CreateFirstPage.aspx" + "?page=1&spid=" + itmodel.SPID + "&itid=" + itmodel.ITID, true); } } else { Response.Redirect("/Manage/Systems/CreateFirstPage.aspx?page=1&spid=" + spid, true); } } #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 } } }