protected void Page_Load(object sender, EventArgs e) { openid = MyCommFun.RequestOpenid(); if (!IsPostBack) { if (MyCommFun.RequestInt("tid") == 0) { return; } BLL.wx_product_type sbll = new BLL.wx_product_type(); Model.wx_product_type type = sbll.GetModel(tid); if (type != null) { imgBanner.ImageUrl = type.icoPic; this.Title = type.tName; } else { imgBanner.Style.Add("display", "none"); } BindData(); BindRepeater(MyCommFun.RequestInt("page", 1)); } }
private bool DoAdd() { try { Model.wx_product_type model = new Model.wx_product_type(); BLL.wx_product_type bll = new BLL.wx_product_type(); model.tName = txtTitle.Text.Trim(); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.tUrl = txtLinkUrl.Text.Trim(); int parentid = int.Parse(ddlParentId.SelectedValue); model.parentId = parentid; if (parentid > 0) { Model.wx_product_type parentModel = bll.GetModel(parentid); model.class_layer = parentModel.class_layer + 1; } else { model.class_layer = 1; } model.store_id = int.Parse(ddlPStore.SelectedValue); model.remark = txtContent.Value; model.icoPic = Request.Form["txtImgICO"].Trim();// txtImgICO.Text; Model.wx_userweixin weixin = GetWeiXinCode(); model.wid = weixin.id; model.creatDate = DateTime.Now; model.tel = txttel.Text; model.daohangurl = txtdaohangurl.Text; model.showDefault = rblshowDefault.SelectedItem.Value == "1"?true:false; if (bll.Add(model) > 0) { AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加产品库分类:" + model.tName); //记录日志 return(true); } } catch { return(false); } return(false); }
private void ShowInfo(int _id) { BLL.wx_product_type bll = new BLL.wx_product_type(); Model.wx_product_type model = bll.GetModel(_id); txtTitle.Text = model.tName; txtSortId.Text = model.sort_id.ToString(); txtLinkUrl.Text = model.tUrl; txtContent.Value = model.remark; txtImgICO.Text = model.icoPic; if (model.icoPic != null && model.icoPic.Trim() != "") { if (model.icoPic.Contains("/")) { imgIco.ImageUrl = model.icoPic; } else { imgIco.Style.Add("display", "none"); litImgIco.Text = "<span class=\"" + model.icoPic + "\"></span>"; } } //父级分类 ddlParentId.SelectedValue = model.parentId.ToString(); if (model.store_id != null) { ddlPStore.SelectedValue = model.store_id.Value.ToString(); } txttel.Text = model.tel; txtdaohangurl.Text = model.daohangurl; rblshowDefault.SelectedValue = model.showDefault == null ? "0" : (model.showDefault ? "1" : "0"); }
private bool DoAdd() { try { Model.wx_product_type model = new Model.wx_product_type(); BLL.wx_product_type bll = new BLL.wx_product_type(); model.tName = txtTitle.Text.Trim(); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.tUrl = txtLinkUrl.Text.Trim(); int parentid=int.Parse(ddlParentId.SelectedValue); model.parentId = parentid; if (parentid > 0) { Model.wx_product_type parentModel = bll.GetModel(parentid); model.class_layer = parentModel.class_layer + 1; } else { model.class_layer = 1; } model.store_id = int.Parse(ddlPStore.SelectedValue) ; model.remark = txtContent.Value; model.icoPic = Request.Form["txtImgICO"].Trim();// txtImgICO.Text; Model.wx_userweixin weixin = GetWeiXinCode(); model.wid = weixin.id; model.creatDate = DateTime.Now; model.tel = txttel.Text; model.daohangurl = txtdaohangurl.Text; model.showDefault = rblshowDefault.SelectedItem.Value=="1"?true:false; if (bll.Add(model) > 0) { AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加产品库分类:" + model.tName); //记录日志 return true; } } catch { return false; } return false; }
public void BindData(int id) { BLL.wx_product hdBll = new BLL.wx_product(); Model.wx_product huodong = hdBll.GetModel(id); Page.Title = huodong.hdName; litTheme.Text = huodong.pSubject; litCreateDate.Text = huodong.createDate == null ? "" : huodong.createDate.Value.ToString("yyyy-MM-dd"); if (huodong.extStr2 == null || huodong.extStr2.ToString().Trim() == "") { imgPic.Style.Add("display", "none"); } else { imgPic.ImageUrl = huodong.extStr2; } StringBuilder detailSB = new StringBuilder(); if (isNotNullFun(huodong.beginDate)) { detailSB.Append(" <li class=\"newsmore\"><div class=\"olditem\">"); detailSB.Append("时间 :" + huodong.beginDate.Value.ToShortDateString() + " ~ "); if (isNotNullFun(huodong.endDate)) { detailSB.Append(huodong.endDate.Value.ToShortDateString()); } detailSB.Append(" </div></li>\r\n"); } if (isNotNullFun(huodong.addr)) { detailSB.Append(" <li class=\"newsmore\"><div class=\"olditem\">"); detailSB.Append("地点 :" + huodong.addr); detailSB.Append(" </div></li>\r\n"); } if (isNotNullFun(huodong.pContent)) { //detailSB.Append(" <li class=\"newsmore\"><div class=\"olditem\">"); //detailSB.Append("活动内容 :"); //detailSB.Append(" </div></li>\r\n"); //detailSB.Append(" <li class=\"newsmore\"><div class=\"olditem\">"); //detailSB.Append(" " + huodong.hdContent); //detailSB.Append(" </div></li>\r\n"); litContent.Text = huodong.pContent; } litDetail.Text = detailSB.ToString(); //底部菜单设置 int wid = MyCommFun.RequestInt("wid"); string openid = MyCommFun.RequestOpenid(); BLL.wx_product_type hdtypeBll = new BLL.wx_product_type(); Model.wx_product_type type = hdtypeBll.GetModel(huodong.typeId.Value); StringBuilder bottomMenu = new StringBuilder(""); int num_dh = 0; if (isNotNullFun(type.tel)) { num_dh++; bottomMenu.Append(" <li> <a href=\"tel:" + type.tel + "\">"); bottomMenu.Append(" <img src=\"/images/templates/bottommenu/181.png\"><label>联系电话</label></a></li>"); } if (isNotNullFun(type.daohangurl)) { num_dh++; bottomMenu.Append(" <li> <a href=\"" + type.daohangurl + "\">"); bottomMenu.Append(" <img src=\"/images/templates/bottommenu/131.png\"><label>一键导航</label></a> </li>"); } if (isNotNullFun(type.showDefault) && type.showDefault) { bottomMenu.Append(" <li class=\"home\"><a href=\"/index.aspx?wid=" + wid + "&openid=" + openid + "\"></a></li>"); } num_dh++; if (isNotNullFun(huodong.url)) { num_dh++; string yudingName = "在线预定"; if (isNotNullFun(huodong.btnName)) { yudingName = huodong.btnName; } bottomMenu.Append(" <li> <a href=\"" + huodong.url + "\">"); bottomMenu.Append(" <img src=\"/images/templates/bottommenu/127.png\"><label>" + yudingName + "</label></a> </li>"); } if (num_dh == 4) { bottomMenu.Append("<li> <a href=\"http://m.baidu.com\">"); bottomMenu.Append("<img src=\"/images/templates/bottommenu/43.png\"><label>百度搜索</label></a> </li>"); } litdaohang.Text = bottomMenu.ToString(); }