private void bindData() { BLL.wx_ucard_cardinfo cardBll = new BLL.wx_ucard_cardinfo(); Model.wx_ucard_cardinfo cardinfo = cardBll.GetModelBySid(sid); if (cardinfo != null) { imgTopPic.ImageUrl = cardinfo.contactusPic; } BLL.wx_ucard_store_fendian scoreBll = new BLL.wx_ucard_store_fendian(); IList <Model.wx_ucard_store_fendian> slist = scoreBll.GetModelList("sid=" + sid + " order by sort_id asc"); StringBuilder fdStr = new StringBuilder(); if (slist != null && slist.Count > 0) { Model.wx_ucard_store_fendian fd = new Model.wx_ucard_store_fendian(); string tel = ""; for (int i = 0; i < slist.Count; i++) { fd = slist[i]; fdStr.Append(" <h2>" + fd.area + "</h2>"); fdStr.Append(" <ul class=\"round\">"); fdStr.Append(" <li class=\"addr\">"); fdStr.Append("<a href=\"http://api.map.baidu.com/marker?location=" + fd.yPoint + "," + fd.xPoint + "&title=" + fd.addr + "&content=" + fd.area + "&output=html\">"); fdStr.Append("<span>" + fd.addr + "</span></a>"); fdStr.Append("</li>"); tel = MyCommFun.ObjToStr(fd.tel); fdStr.Append("<li class=\"tel\"><a href=\"tel:" + tel + "\"><span>" + tel + "</span></a></li>"); fdStr.Append("</ul>"); } } litFenDianList.Text = fdStr.ToString(); }
private void bindData() { BLL.wx_ucard_cardinfo cardBll = new BLL.wx_ucard_cardinfo(); Model.wx_ucard_cardinfo cardinfo = cardBll.GetModelBySid(sid); if (cardinfo != null) { imgTopPic.ImageUrl = cardinfo.contactusPic; } BLL.wx_ucard_store_fendian scoreBll = new BLL.wx_ucard_store_fendian(); IList<Model.wx_ucard_store_fendian> slist = scoreBll.GetModelList("sid=" + sid + " order by sort_id asc"); StringBuilder fdStr = new StringBuilder(); if (slist != null && slist.Count > 0) { Model.wx_ucard_store_fendian fd = new Model.wx_ucard_store_fendian(); string tel = ""; for (int i = 0; i < slist.Count; i++) { fd = slist[i]; fdStr.Append(" <h2>"+fd.area+"</h2>"); fdStr.Append(" <ul class=\"round\">"); fdStr.Append(" <li class=\"addr\">"); fdStr.Append("<a href=\"http://api.map.baidu.com/marker?location=" + fd.yPoint + "," + fd.xPoint + "&title=" + fd.addr + "&content=" + fd.area + "&output=html\">"); fdStr.Append("<span>" + fd.addr + "</span></a>"); fdStr.Append("</li>"); tel = MyCommFun.ObjToStr(fd.tel); fdStr.Append("<li class=\"tel\"><a href=\"tel:" + tel + "\"><span>"+tel+"</span></a></li>"); fdStr.Append("</ul>"); } } litFenDianList.Text = fdStr.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.txtarea.Text.Trim().Length == 0) { strErr += "区域不能为空!"; } if (strErr != "") { JscriptMsg(strErr, "back", "Error"); return; } #endregion Model.wx_ucard_store_fendian fendian = new Model.wx_ucard_store_fendian(); if (id > 0) { fendian = fdBll.GetModel(id); } fendian.area = txtarea.Text.Trim(); fendian.addr = txtaddr.Text.Trim(); fendian.xPoint = MyCommFun.Str2Decimal(txtLatXPoint.Text); fendian.yPoint = MyCommFun.Str2Decimal(txtLngYPoint.Text); fendian.sort_id = MyCommFun.Obj2Int(txtSortId.Text.Trim()); fendian.tel = txttel.Text.Trim(); fendian.sId = sid; if (id <= 0) { ChkAdminLevel("ucard_fd", MXEnums.ActionEnum.Add.ToString()); //检查权限 //新增 fendian.createDate = DateTime.Now; //1新增主表 id = fdBll.Add(fendian); AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加会员卡分店,主键为" + id); //记录日志 JscriptMsg("添加会员卡分店成功!", "store_fendian.aspx?id=" + sid, "Success"); } else { ChkAdminLevel("ucard_fd", MXEnums.ActionEnum.Edit.ToString()); //检查权限 //修改 //1修改主表 fdBll.Update(fendian); AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改会员卡分店,主键为" + id); //记录日志 JscriptMsg("修改会员卡分店成功!", "store_fendian.aspx?id=" + sid, "Success"); } }
private void ShowInfo(int id) { hidid.Value = id.ToString(); Model.wx_ucard_store_fendian fendian = fdBll.GetModel(id); txtarea.Text = fendian.area; txtaddr.Text = fendian.addr; txttel.Text = fendian.tel; txtLatXPoint.Text = fendian.xPoint.ToString(); txtLngYPoint.Text = fendian.yPoint.ToString(); txtSortId.Text = fendian.sort_id.Value.ToString(); ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript'> $(\"#baiduframe\").attr(\"src\", \"../lbs/MapSelectPoint.aspx?yjindu=" + fendian.yPoint.Value.ToString() + "&xweidu=" + fendian.xPoint.Value.ToString() + "\");</script>"); }
//保存 protected void btnSubmit_Click(object sender, EventArgs e) { Model.wx_userweixin weixin = GetWeiXinCode(); int id = MyCommFun.Str2Int(hidid.Value); #region //先判断 string strErr = ""; if (this.txtarea.Text.Trim().Length == 0) { strErr += "区域不能为空!"; } if (strErr != "") { JscriptMsg(strErr, "back", "Error"); return; } #endregion Model.wx_ucard_store_fendian fendian = new Model.wx_ucard_store_fendian(); if (id > 0) { fendian = fdBll.GetModel(id); } fendian.area = txtarea.Text.Trim(); fendian.addr = txtaddr.Text.Trim(); fendian.xPoint = MyCommFun.Str2Decimal(txtLatXPoint.Text); fendian.yPoint = MyCommFun.Str2Decimal(txtLngYPoint.Text); fendian.sort_id = MyCommFun.Obj2Int(txtSortId.Text.Trim()); fendian.tel = txttel.Text.Trim(); fendian.sId = sid; if (id <= 0) { //新增 fendian.createDate = DateTime.Now; //1新增主表 id = fdBll.Add(fendian); AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加会员卡分店,主键为" + id); //记录日志 JscriptMsg("添加会员卡分店成功!", "store_fendian.aspx?id=" + sid, "Success"); } else { //修改 //1修改主表 fdBll.Update(fendian); AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改会员卡分店,主键为" + id); //记录日志 JscriptMsg("修改会员卡分店成功!", "store_fendian.aspx?id="+sid, "Success"); } }