private void ShowInfo(int id) { hidid.Value = id.ToString(); Model.wx_albums_type type = tBll.GetModel(id); hidid.Value = type.id.ToString(); txttName.Text = type.typeName.ToString(); txttContent.Value = type.tContent.ToString(); txtseq.Text = type.sort_id.Value.ToString(); //banner图片 if (type.bannerPic != null && type.bannerPic.Trim() != "/images/noneimg.jpg") { txtbannerPic.Text = type.bannerPic; imgbannerPic.ImageUrl = type.bannerPic; } //图标 if (type.typeIco != null && type.typeIco.Trim() != "/images/noneimg.jpg") { txttypeIco.Text = type.typeIco; imgtypeIco.ImageUrl = type.typeIco; } }
protected void Page_Load(object sender, EventArgs e) { OnlyWeiXinLook(); if (!IsPostBack) { wid = MyCommFun.RequestInt("wid"); tid = MyCommFun.RequestInt("tid"); openid = MyCommFun.RequestOpenid(); if (wid == 0) { MessageBox.Show(this, "参数不正确!"); return; } BLL.wx_albums_type bll = new BLL.wx_albums_type(); Model.wx_albums_type type = bll.GetModel(tid); if (type != null && type.bannerPic != null && type.bannerPic.Trim() != "") { litBanner.Text = " <a href=\"javascript:;\"><img src=\"" + type.bannerPic + "\"></a> "; } BindAlbumsList(); litCopyRight.Text = getwebcopyright(wid); } }
protected void Page_Load(object sender, EventArgs e) { OnlyWeiXinLook(); if (!IsPostBack) { wid = MyCommFun.RequestInt("wid"); openid = MyCommFun.RequestOpenid(); if (wid == 0) { MessageBox.Show(this, "参数不正确!"); return; } litCopyRight.Text = getwebcopyright(wid); BLL.wx_albums_type tBll = new BLL.wx_albums_type(); IList<Model.wx_albums_type> tlist = tBll.GetModelList("wid=" + wid+ "order by sort_id asc"); if (tlist != null && tlist.Count > 0) { Model.wx_albums_type type = new Model.wx_albums_type(); StringBuilder sbtl = new StringBuilder(""); for (int i = 0; i < tlist.Count; i++) { type = tlist[i]; sbtl.Append(" <a class=\"ui_clearfix\" href=\"alubmslist.aspx?wid=" + wid + "&tid=" + type.id + "&openid=" + openid + "\">"); sbtl.Append("<img src='"+type.typeIco+"' class=\"ad_img ui_fluid\" />"); sbtl.Append("<div class=\"ad_detail\">"); sbtl.Append("<p class=\"qb_fs_l\"><strong>"+type.typeName+"</strong></p>"); sbtl.Append(" <p class=\"qb_fs_s\">"+type.tContent+"</p>"); sbtl.Append(" </div> </a>"); } litTypelist.Text = sbtl.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { OnlyWeiXinLook(); if (!IsPostBack) { wid = MyCommFun.RequestInt("wid"); openid = MyCommFun.RequestOpenid(); if (wid == 0) { MessageBox.Show(this,"参数不正确!"); return; } BLL.wx_albums_sys bll = new BLL.wx_albums_sys(); IList<Model.wx_albums_sys> modellist = bll.GetModelList("wid="+wid); if (modellist != null && modellist.Count > 0) { bgPic = modellist[0].bannerPic; } litCopyRight.Text = getwebcopyright(wid); BLL.wx_albums_type tBll = new BLL.wx_albums_type(); IList<Model.wx_albums_type> tlist = tBll.GetModelList("wid=" + wid +" order by sort_id asc"); if (tlist != null && tlist.Count > 0) { Model.wx_albums_type type = new Model.wx_albums_type(); StringBuilder sbtl = new StringBuilder(""); for (int i = 0; i < tlist.Count; i++) { type = new Model.wx_albums_type(); type = tlist[i]; sbtl.Append(" <li class=\"list_item\"><a href=\"alubmslist.aspx?wid=" + wid + "&tid=" + type.id + "&openid=" + openid + "\">" + type.typeName + "</a></li>"); } litTypelist.Text = sbtl.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { OnlyWeiXinLook(); if (!IsPostBack) { wid = MyCommFun.RequestInt("wid"); openid = MyCommFun.RequestOpenid(); if (wid == 0) { MessageBox.Show(this, "参数不正确!"); return; } litCopyRight.Text = getwebcopyright(wid); BLL.wx_albums_type tBll = new BLL.wx_albums_type(); IList <Model.wx_albums_type> tlist = tBll.GetModelList("wid=" + wid + " and showType=1 order by sort_id asc"); if (tlist != null && tlist.Count > 0) { Model.wx_albums_type type = new Model.wx_albums_type(); StringBuilder sbtl = new StringBuilder(""); for (int i = 0; i < tlist.Count; i++) { type = tlist[i]; sbtl.Append(" <a class=\"ui_clearfix\" href=\"alubmslist.aspx?wid=" + wid + "&tid=" + type.id + "&openid=" + openid + "\">"); sbtl.Append("<img src='" + type.typeIco + "' class=\"ad_img ui_fluid\" />"); sbtl.Append("<div class=\"ad_detail\">"); sbtl.Append("<p class=\"qb_fs_l\"><strong>" + type.typeName + "</strong></p>"); sbtl.Append(" <p class=\"qb_fs_s\">" + type.tContent + "</p>"); sbtl.Append(" </div> </a>"); } litTypelist.Text = sbtl.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { OnlyWeiXinLook(); if (!IsPostBack) { wid = MyCommFun.RequestInt("wid"); openid = MyCommFun.RequestOpenid(); if (wid == 0) { MessageBox.Show(this, "参数不正确!"); return; } BLL.wx_albums_sys bll = new BLL.wx_albums_sys(); IList <Model.wx_albums_sys> modellist = bll.GetModelList("wid=" + wid); if (modellist != null && modellist.Count > 0) { bgPic = modellist[0].bannerPic; } litCopyRight.Text = getwebcopyright(wid); BLL.wx_albums_type tBll = new BLL.wx_albums_type(); IList <Model.wx_albums_type> tlist = tBll.GetModelList("wid=" + wid + " order by sort_id asc"); if (tlist != null && tlist.Count > 0) { Model.wx_albums_type type = new Model.wx_albums_type(); StringBuilder sbtl = new StringBuilder(""); for (int i = 0; i < tlist.Count; i++) { type = new Model.wx_albums_type(); type = tlist[i]; sbtl.Append(" <li class=\"list_item\"><a href=\"alubmslist.aspx?wid=" + wid + "&tid=" + type.id + "&openid=" + openid + "\">" + type.typeName + "</a></li>"); } litTypelist.Text = sbtl.ToString(); } } }
//保存 protected void btnSubmit_Click(object sender, EventArgs e) { Model.wx_userweixin weixin = GetWeiXinCode(); int id = MyCommFun.Str2Int(hidid.Value); #region //先判断 string strErr = ""; if (this.txttName.Text.Trim().Length == 0) { strErr += "分类名称不能为空!"; } //if (this.txtbannerPic.Text.Trim().Length == 0) //{ // strErr += "头部图片不能为空!"; //} if (this.txttypeIco.Text.Trim().Length == 0) { strErr += "图标不能为空!"; } if (this.txtseq.Text.Trim().Length == 0) { strErr += "排序不能为空!"; } if (strErr != "") { JscriptMsg(strErr, "back", "Error"); return; } #endregion #region 赋值 Model.wx_albums_type type = new Model.wx_albums_type(); if (id > 0) { type = tBll.GetModel(id); } //string bannerPic = imgbannerPic.ImageUrl; //if (txtbannerPic.Text.Trim() != "") //{ // bannerPic = txtbannerPic.Text.Trim(); //} string bannerPic = txtbannerPic.Text.Trim(); string typeIco = imgtypeIco.ImageUrl; if (txttypeIco.Text.Trim() != "") { typeIco = txttypeIco.Text.Trim(); } type.typeName = txttName.Text.Trim(); type.tContent = txttContent.Value.Trim(); type.bannerPic = bannerPic; type.typeIco = typeIco; type.sort_id = MyCommFun.Str2Int(txtseq.Text.Trim()); #endregion if (id <= 0) { //新增 type.wid = weixin.id; type.createDate = DateTime.Now; //1新增主表 id = tBll.Add(type); AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加相册--分类信息,主键为" + id); //记录日志 JscriptMsg("添加相册--分类信息成功!", "typelist.aspx", "Success"); } else { //修改 tBll.Update(type); AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改相册--分类信息,主键为" + id); //记录日志 JscriptMsg("修改相册--分类信息成功!", "typelist.aspx", "Success"); } }