public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/json"; string _action = MyCommFun.QueryString("myact"); string openid = MyCommFun.RequestOpenid(); //得到微信用户的openid if (_action == "update") { try { #region 提交手机 /// 提交手机号码 string tel = MyCommFun.QueryString("tel"); string pwd = MyCommFun.QueryString("pwd"); string snumber = MyCommFun.QueryString("snumber"); int id = MyCommFun.RequestInt("id"); int aid = MyCommFun.RequestInt("aid"); if (aid==0 || id == 0 || snumber == "" || tel == "") { context.Response.Write("{\"msg\":\"提交出现异常!!\",\"success\":\"0\"}"); return; } BLL.wx_ggkActionInfo actBll = new BLL.wx_ggkActionInfo(); if (pwd.Trim().Length>0 &&(!actBll.ExistsPwd(aid, pwd))) { context.Response.Write("{\"msg\":\"商家兑换密码错误!!\",\"success\":\"0\"}"); return; } BLL.wx_ggkAwardUser ubll = new BLL.wx_ggkAwardUser(); Model.wx_ggkAwardUser model = ubll.GetModel(id); if (model == null) { context.Response.Write("{\"msg\":\"提交出现异常2!!\",\"success\":\"0\"}"); return; } model.uTel = tel; if (pwd.Trim().Length > 0) { model.hasLingQu = true; } else { model.hasLingQu = false; } ubll.Update(model); context.Response.Write("{\"msg\":\"提交成功!\",\"success\":\"1\"}"); return; #endregion } catch { context.Response.Write("{\"msg\":\"提交出现异常!!\",\"success\":\"0\"}"); return; } } }
protected void Page_Load(object sender, EventArgs e) { OnlyWeiXinLook(); if (!IsPostBack) { int id = MyCommFun.RequestInt("aid"); if (id == 0) { return; } BLL.wx_ggkActionInfo aBll = new BLL.wx_ggkActionInfo(); Model.wx_ggkActionInfo action = aBll.GetModel(id); if (action == null) { return; } litEndNotice.Text = action.endContent; } }
/// <summary> /// 刮刮卡回复内容 /// </summary> /// <param name="id">模块主键Id</param> /// <param name="apiid">微帐号主键id</param> /// <param name="openid">openid</param> /// <param name="responseType">回复类型:1纯文字,2图文</param> /// <param name="responseVaule">回复的内容</param> private IList<Model.ResponseContentEntity> GGKReponse(int id, int apiid, string openid) { IList<Model.ResponseContentEntity> responselist = new List<Model.ResponseContentEntity>(); Model.ResponseContentEntity responseEntity = new Model.ResponseContentEntity(); responseEntity.id = id; responseEntity.wid = apiid; BLL.wx_ggkActionInfo ggkActBll = new BLL.wx_ggkActionInfo(); Model.wx_ggkActionInfo actModel = ggkActBll.GetModel(id); if (actModel.beginDate > DateTime.Now) { //活动尚未开始 responseEntity.rcType = Model.ReponseContentType.text; responseEntity.rContent = "活动【" + actModel.actName + "】将于" + actModel.beginDate + "开始。"; } else if (actModel.endDate <= DateTime.Now) { //活动结束 responseEntity.rcType = Model.ReponseContentType.txtpic; responseEntity.rContent = actModel.endNotice; responseEntity.rContent2 = actModel.endContent; responseEntity.detailUrl = MyCommFun.getWebSite() + "/weixin/ggk/end.aspx?wid=" + apiid + "&aid=" + id; responseEntity.picUrl = actModel.endPic; } else { //活动正在进行中 responseEntity.rcType = Model.ReponseContentType.txtpic; responseEntity.rContent = actModel.actName; responseEntity.rContent2 = actModel.brief; responseEntity.detailUrl = MyCommFun.getWebSite() + "/weixin/ggk/index.aspx?wid=" + apiid + "&aid=" + id; responseEntity.picUrl = actModel.beginPic; } responselist.Add(responseEntity); return responselist; }
/// <summary> /// 刮刮卡回复内容 /// </summary> /// <param name="id">模块主键Id</param> /// <param name="apiid">微帐号主键id</param> /// <param name="openid">openid</param> /// <param name="responseType">回复类型:1纯文字,2图文</param> /// <param name="responseVaule">回复的内容</param> private IList <Model.ResponseContentEntity> GGKReponse(int id, int apiid, string openid) { IList <Model.ResponseContentEntity> responselist = new List <Model.ResponseContentEntity>(); Model.ResponseContentEntity responseEntity = new Model.ResponseContentEntity(); responseEntity.id = id; responseEntity.wid = apiid; BLL.wx_ggkActionInfo ggkActBll = new BLL.wx_ggkActionInfo(); Model.wx_ggkActionInfo actModel = ggkActBll.GetModel(id); if (actModel.beginDate > DateTime.Now) { //活动尚未开始 responseEntity.rcType = Model.ReponseContentType.text; responseEntity.rContent = "活动【" + actModel.actName + "】将于" + actModel.beginDate + "开始。"; } else if (actModel.endDate <= DateTime.Now) { //活动结束 responseEntity.rcType = Model.ReponseContentType.txtpic; responseEntity.rContent = actModel.endNotice; responseEntity.rContent2 = actModel.endContent; responseEntity.detailUrl = MyCommFun.getWebSite() + "/weixin/ggk/end.aspx?wid=" + apiid + "&aid=" + id; responseEntity.picUrl = actModel.endPic; } else { //活动正在进行中 responseEntity.rcType = Model.ReponseContentType.txtpic; responseEntity.rContent = actModel.actName; responseEntity.rContent2 = actModel.actContent; responseEntity.detailUrl = MyCommFun.getWebSite() + "/weixin/ggk/index.aspx?wid=" + apiid + "&aid=" + id; responseEntity.picUrl = actModel.beginPic; } responselist.Add(responseEntity); return(responselist); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/json"; string _action = MyCommFun.QueryString("myact"); string openid = MyCommFun.RequestOpenid(); //得到微信用户的openid if (_action == "update") { try { #region 提交手机 /// 提交手机号码 string tel = MyCommFun.QueryString("tel"); string pwd = MyCommFun.QueryString("pwd"); string snumber = MyCommFun.QueryString("snumber"); int id = MyCommFun.RequestInt("id"); int aid = MyCommFun.RequestInt("aid"); if (aid == 0 || id == 0 || snumber == "" || tel == "") { context.Response.Write("{\"msg\":\"提交出现异常!!\",\"success\":\"0\"}"); return; } BLL.wx_ggkActionInfo actBll = new BLL.wx_ggkActionInfo(); if (pwd.Trim().Length > 0 && (!actBll.ExistsPwd(aid, pwd))) { context.Response.Write("{\"msg\":\"商家兑换密码错误!!\",\"success\":\"0\"}"); return; } BLL.wx_ggkAwardUser ubll = new BLL.wx_ggkAwardUser(); Model.wx_ggkAwardUser model = ubll.GetModel(id); if (model == null) { context.Response.Write("{\"msg\":\"提交出现异常2!!\",\"success\":\"0\"}"); return; } model.uTel = tel; if (pwd.Trim().Length > 0) { model.hasLingQu = true; } else { model.hasLingQu = false; } ubll.Update(model); context.Response.Write("{\"msg\":\"提交成功!\",\"success\":\"1\"}"); return; #endregion } catch { context.Response.Write("{\"msg\":\"提交出现异常!!\",\"success\":\"0\"}"); return; } } }