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 == "" || pwd == "") { context.Response.Write("{\"msg\":\"提交出现异常!!\",\"success\":\"0\"}"); return; } BLL.wx_sTicket actBll = new BLL.wx_sTicket(); if (!actBll.ExistsPwd(aid, pwd)) { context.Response.Write("{\"msg\":\"商家兑换密码错误!!\",\"success\":\"0\"}"); return; } BLL.wx_sttAwardUser ubll = new BLL.wx_sttAwardUser(); Model.wx_sttAwardUser model = ubll.GetModel(id); if (model == null) { context.Response.Write("{\"msg\":\"提交出现异常2!!\",\"success\":\"0\"}"); return; } model.uTel = tel; model.hasLingQu = true; 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 aid = MyCommFun.RequestInt("aid", 0); if (aid == 0 ) { return; } BLL.wx_sTicket actbll = new BLL.wx_sTicket(); Model.wx_sTicket sstAction = actbll.GetModel(aid); if (sstAction != null) { imgEnd.ImageUrl = sstAction.endPic == null ? "images/end.jpg" : sstAction.endPic.ToString(); } } }
/// <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> yhqjdReponse(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_sTicket sttActBll = new BLL.wx_sTicket(); Model.wx_sTicket actModel = sttActBll.GetModel(id); if (actModel.beginDate > DateTime.Now) { //活动尚未开始 responseEntity.rcType = Model.ReponseContentType.text; responseEntity.rContent = "活动【" + actModel.actionName + "】将于" + 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/sticket/end.aspx?wid=" + apiid + "&aid=" + id; responseEntity.picUrl = actModel.endPic; } else { //活动正在进行中 responseEntity.rcType = Model.ReponseContentType.txtpic; responseEntity.rContent = actModel.actionName; responseEntity.rContent2 = actModel.brief; responseEntity.detailUrl = MyCommFun.getWebSite() + "/weixin/sticket/index.aspx?wid=" + apiid + "&aid=" + id; responseEntity.picUrl = actModel.beginPic; } responselist.Add(responseEntity); return responselist; }