public string BuildLinkString() { StringBuilder builder = new StringBuilder(); DataTable list = new B_InfoModel().GetList(); if ((list == null) || (list.Rows.Count <= 0)) { return ""; } foreach (DataRow row in list.Rows) { builder.Append(" | <a href=\"RecycleInfo.aspx"); builder.Append("?ModelId="); builder.Append(row["ModelId"].ToString()); builder.Append("\">"); builder.Append(row["ModelName"].ToString()); builder.Append("</a>"); } return builder.ToString(); }
protected void Page_Load(object sender, EventArgs e) { litMsg.Text = ""; UserBll.CheckIsLogin(); UserModel = UserBll.GetUser(UserBll.GetCookie().LogName); UserGroupModel = UserGroupBll.GetModel(UserModel.GroupID); SiteModel = SiteBll.GetSiteModel(); if (SiteModel == null) Function.ShowMsg(0, "<li>全站参数获取错误</li><li><a href='javascript:history.back()'>返回上一级</a></li>"); if (!string.IsNullOrEmpty(Request.QueryString["Id"])) { try { Id = Convert.ToInt32(Request.QueryString["Id"]); } catch { } } if (!string.IsNullOrEmpty(Request.QueryString["ChId"])) { ChId = int.Parse(Request.QueryString["ChId"]); } ChannelModel = ChId <= 0 ? null : ChannelBll.GetChannel(ChId); if (ChannelModel == null || ChId < 0) Function.ShowMsg(0, "<li>频道参数错误</li><li><a href='javascript:history.back()'>返回上一级</a></li>"); if (!UserGroupBll.Power_ColumnPower(ChId, 0, UserGroupModel.ColumnPower, 3)) Function.ShowMsg(0, "<li>本频道没有添加" + ChannelModel.TypeName + "的权限</li><li><a href='javascript:history.back()'>返回上一级</a></li>"); if (!ColumnBll.ChkHasColumnByChId(ChId)) Function.ShowMsg(0, "<li>本频道下没有栏目,不能添加" + ChannelModel.TypeName + "</li><li><a href='javascript:history.back()'>返回上一级</a></li>"); if (!string.IsNullOrEmpty(Request.QueryString["ColId"])) ColId = Convert.ToInt32(Request.QueryString["ColId"]); ColumnModel = ColId <= 0 ? null : ColumnBll.GetColumn(ColId); if (ColId > 0 && ColumnModel == null) Function.ShowMsg(0, "<li>所选栏目不存在或已经被删除</li><li><a href='javascript:history.back()'>返回上一级</a></li>"); B_InfoModel infoModelBll = new B_InfoModel(); M_InfoModel infoModel = infoModelBll.GetModel(ChannelModel.ModelType); FilePicPath.Text = infoModel.UploadPath + "|" + infoModel.UploadSize.ToString(); if (!IsPostBack) { UserCateBound(); ddlBind(); if (Id > 0) ShowInfo(Id); } }
protected void Page_Load(object sender, EventArgs e) { AdminBll.CheckMulitLogin(); AdminModel = AdminBll.GetLoginModel(); litMsg.Text = ""; SiteModel = SiteBll.GetSiteModel(); if(SiteModel==null) { Function.ShowSysMsg(0, "<li>全站参数获取错误</li>"); } txtSoftTemplatePath.Attributes.Add("readonly", ""); txtTitleImgPath.Attributes.Add("readonly",""); if(!string.IsNullOrEmpty(Request.QueryString["ChId"])) { ChannelId = int.Parse(Request.QueryString["ChId"]); } if(!ColumnBll.ChkHasColumnByChId(ChannelId)) { Function.ShowSysMsg(0, "<li>本频道下没有栏目,不能添加信息</li><li>建议您先添加栏目</li><li><a href='info/SetColumn.aspx?ChId=" + ChannelId + "'>添加栏目</a> <a href='info/ColumnList.aspx?ChId=" + ChannelId + "'>栏目管理</a></li>"); } ChannelModel = ChannelBll.GetChannel(ChannelId); if(ChannelId<=0 || ChannelModel==null || ChannelModel.ModelType!=3) { Function.ShowSysMsg(0, "<li>频道参数错误</li>"); } if (!string.IsNullOrEmpty(Request.QueryString["ColId"])) { ColumnId = int.Parse(Request.QueryString["ColId"]); } if (ColumnId != 0 && ColumnBll.GetColumn(ColumnId) == null) { Function.ShowSysMsg(0, "<li>所选栏目不存在或已经被删除</li>"); } if (!string.IsNullOrEmpty(Request.QueryString["Id"])) { try { Id = int.Parse(Request.QueryString["Id"]); } catch{} } B_InfoModel infoModelBll=new B_InfoModel(); M_InfoModel infoModel = infoModelBll.GetModel(ChannelModel.ModelType); FilePicPath.Text = infoModel.UploadPath+"|"+infoModel.UploadSize.ToString(); if(Id>0) litNav.Text = "<a href='ColumnList.aspx?Chid=" + ChannelId + "'>" + ChannelModel.ChName + "</a> >> 修改" + ChannelModel.TypeName; else litNav.Text = "<a href='ColumnList.aspx?Chid=" + ChannelId + "'>" + ChannelModel.ChName + "</a> >> 添加" + ChannelModel.TypeName; if (!IsPostBack) { BindGroup(); BindDownServerType(); BindSpeacil(); if (Id > 0) ShowDownLoadInfo(Id); ddlBind(); } }