private void ShowInfo(int _id) { BLL.wx_product bll = new BLL.wx_product(); Model.wx_product model = bll.GetModel(_id); ddlCategoryId.SelectedValue = model.typeId.Value.ToString(); this.lblid.Text = model.id.ToString(); this.txtTitle.Text = model.hdName; this.txtpSubject.Text = model.pSubject; this.txtbeginDate.Text = model.beginDate == null ? "" : model.beginDate.Value.ToString("yyyy-MM-dd HH:mm:ss"); this.txtendDate.Text = model.endDate == null ? "" : model.endDate.Value.ToString("yyyy-MM-dd HH:mm:ss"); this.txtaddr.Text = model.addr; this.txtContent.Value = model.pContent; txtImgUrl.Text = model.extStr2; this.txtPrice.Text = model.price == null ? "" : model.price.Value.ToString(); this.chkShowDate.Checked = model.showDate; this.chkShowPrice.Checked = model.showPrice; this.chkShowYuDing.Checked = model.showYuDing; this.txtAnNiuTxt.Text = model.btnName == "" ? "预定" : model.btnName; this.txtSortId.Text = model.extInt == null ? "99" : model.extInt.Value.ToString(); txtUrl.Text = model.url == null ? "" : model.url; }
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(); }
private bool DoEdit(int _id) { Model.wx_userweixin weixin = GetWeiXinCode(); bool result = false; BLL.wx_product bll = new BLL.wx_product(); Model.wx_product model = bll.GetModel(_id); string hdName = this.txtTitle.Text; string hdSubject = this.txtpSubject.Text; string hdAddr = this.txtaddr.Text; string hdContent = this.txtContent.Value; DateTime createTime = DateTime.Now; string tupian = txtImgUrl.Text;//封面图片 decimal price = decimal.Parse(txtPrice.Text); bool showDate = chkShowDate.Checked; bool showPrice = chkShowPrice.Checked; bool showYuDing = chkShowYuDing.Checked; int seq = MyCommFun.Str2Int(txtSortId.Text); model.hdName = hdName; model.pSubject = hdSubject; model.addr = hdAddr; model.pContent = hdContent; model.extStr2 = tupian; model.btnName = txtAnNiuTxt.Text.Trim(); model.typeId = MyCommFun.Str2Int(ddlCategoryId.SelectedItem.Value); model.price = price; model.showDate = showDate; model.showPrice = showPrice; model.showYuDing = showYuDing; model.extInt = seq; if (txtbeginDate.Text.Trim() != "") { if (MyCommFun.isDateTime(txtbeginDate.Text)) { model.beginDate = DateTime.Parse(txtbeginDate.Text); } } else { model.beginDate = null; } if (txtendDate.Text.Trim() != "") { if (MyCommFun.isDateTime(txtendDate.Text)) { model.endDate = DateTime.Parse(txtendDate.Text); } } else { model.endDate = null; } //model.wid = weixin.id; model.url = txtUrl.Text.Trim(); if (bll.Update(model)) { AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改产品库内容id:" + model.id); //记录日志 result = true; } return(result); }
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(); }
private bool DoEdit(int _id) { Model.wx_userweixin weixin = GetWeiXinCode(); bool result = false; BLL.wx_product bll = new BLL.wx_product(); Model.wx_product model = bll.GetModel(_id); string hdName = this.txtTitle.Text; string hdSubject = this.txtpSubject.Text; string hdAddr = this.txtaddr.Text; string hdContent = this.txtContent.Value; DateTime createTime = DateTime.Now; string tupian = txtImgUrl.Text;//封面图片 decimal price = decimal.Parse(txtPrice.Text); bool showDate = chkShowDate.Checked; bool showPrice = chkShowPrice.Checked; bool showYuDing = chkShowYuDing.Checked; int seq = MyCommFun.Str2Int(txtSortId.Text); model.hdName = hdName; model.pSubject = hdSubject; model.addr = hdAddr; model.pContent = hdContent; model.extStr2 = tupian; model.btnName = txtAnNiuTxt.Text.Trim(); model.typeId = MyCommFun.Str2Int(ddlCategoryId.SelectedItem.Value); model.price = price; model.showDate = showDate; model.showPrice = showPrice; model.showYuDing = showYuDing; model.extInt = seq; if (txtbeginDate.Text.Trim() != "") { if (MyCommFun.isDateTime(txtbeginDate.Text)) { model.beginDate = DateTime.Parse(txtbeginDate.Text); } } else { model.beginDate = null; } if (txtendDate.Text.Trim() != "") { if (MyCommFun.isDateTime(txtendDate.Text)) { model.endDate = DateTime.Parse(txtendDate.Text); } } else { model.endDate = null; } //model.wid = weixin.id; model.url = txtUrl.Text.Trim(); if (bll.Update(model)) { AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改产品库内容id:" + model.id); //记录日志 result = true; } return result; }