protected void Page_Load(object sender, EventArgs e) { int wid = MyCommFun.RequestWid(); int actid = MyCommFun.RequestInt("aid"); string thisUrl = MyCommFun.getWebSite() + "/weixin/cashred/index.aspx?wid=" + wid + "&aid=" + actid; //授权 BLL.wx_userweixin bll = new BLL.wx_userweixin(); Model.wx_userweixin uWeiXinModel = bll.GetModel(wid); OAuth2BaseProc(uWeiXinModel, "index", thisUrl); //授权 end BLL.wx_xjhongbao_action actBll = new BLL.wx_xjhongbao_action(); act = actBll.GetPageHongBaoModel(actid, wid); if (act == null) { litActionRemark.Text = "该时间段没有该活动"; return; } //jssdk this.Title = act.act_name; fxModel.fxImg = MyCommFun.getWebSite() + "" + act.share_imgurl; fxModel.fxTitle = act.act_name; fxModel.fxContent = act.share_content; jssdkInit(uWeiXinModel); //jssdk end ActionBaseInfo(wid); }
override protected void OnInit(EventArgs e) { base.OnInit(e); if (errInitTemplates != "") { Response.Write(errInitTemplates); return; } //1获得模版基本信息 BLL.wx_templates tBll = new BLL.wx_templates(); templateIndexFileName = tBll.GetTemplatesFileNameByWid(wid); if (templateIndexFileName == null || templateIndexFileName.Trim() == "") { errInitTemplates = "不存在该帐号或者该帐号尚未设置模版!"; Response.Write(errInitTemplates); Response.End(); return; } MyCommFun.RequestWid(); MyCommFun.getTotalUrl(); tPath = MyCommFun.GetRootPath() + "/templates/index/" + templateIndexFileName + "/index.html"; TemplateMgr template = new TemplateMgr(tPath, wid); template.tType = TemplateType.Index; template.openid = MyCommFun.RequestOpenid(); template.OutPutHtml(templateIndexFileName, wid); }
protected void Page_Load(object sender, EventArgs e) { //OAuth2 string thisUrl = MyCommFun.getWebSite() + "/weixin/restaurant/index.aspx" + Request.Url.Query; var bll = new BLL.wx_userweixin(); int widInt = MyCommFun.RequestWid(); Model.wx_userweixin uWeiXinModel = bll.GetModel(widInt); OAuth2BaseProc(uWeiXinModel, "index", thisUrl); this.shopid = string.IsNullOrEmpty(WebHelper.GetQueryString("shopid")) ? 0 : int.Parse(WebHelper.GetQueryString("shopid")); this.openid = string.IsNullOrEmpty(WebHelper.GetQueryString("openid")) ? "loseopenid" : WebHelper.GetQueryString("openid"); this.wid = string.IsNullOrEmpty(WebHelper.GetQueryString("wid")) ? "1" : WebHelper.GetQueryString("wid"); this.title = this.GetTitle(); if (!Page.IsPostBack) { if (this.shopid == 0) { this.hotelName = "无选定商铺"; } else { var shopinfo = new BLL.wx_diancai_shopinfo().GetModel(this.shopid); if (shopinfo == null) { return; } this.hotelName = shopinfo.hotelName; } } }
protected void Page_Load(object sender, EventArgs e) { this.category_id = Utils.StrToInt(MXRequest.GetQueryString("aid"), 0); int id = MyCommFun.RequestInt("id"); wid = MyCommFun.RequestWid(); if (!IsPostBack) { IList <Model.wx_qp_img> imglist = imgBLL.GetModelList("bId=" + category_id + "and iType=2 order by id desc "); for (int i = 0; i < imglist.Count; i++) { if (imglist[i].id == id) { actNum = i; break; } } int test = actNum; this.rptImgshow.DataSource = imglist; this.rptImgshow.DataBind(); Model.wx_qp_base baseMod = baseBll.GetModel(this.category_id); this.Page.Title = baseMod.bName; } }
override protected void OnInit(EventArgs e) { base.OnInit(e); if (errInitTemplates != "") { Response.Write(errInitTemplates); return; } //1获得模版基本信息 BLL.wx_templates tBll = new BLL.wx_templates(); string templateErJiFileName = tBll.GetErJiTemplatesFileNameByWid(wid); if (templateErJiFileName == null || templateErJiFileName.Trim() == "") { tPath = MyCommFun.GetRootPath() + "/templates/category/albums/category.html"; } else { tPath = MyCommFun.GetRootPath() + "/templates/category/" + templateErJiFileName + "/category.html"; } MyCommFun.RequestWid(); MyCommFun.getTotalUrl(); TemplateMgr template = new TemplateMgr(tPath, wid); template.tType = TemplateType.Channel; template.openid = MyCommFun.RequestOpenid(); template.OutPutHtml(templateErJiFileName, wid); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int shopid = MyCommFun.RequestInt("shopid"); if (shopid == 0) { Response.Redirect("index.aspx"); } float x = MyCommFun.RequestFloat("x", 0); float y = MyCommFun.RequestFloat("y", 0); int wid = MyCommFun.RequestWid(); if (wid == 0) { return; } if (x == 0 || y == 0) { Response.Redirect("index.aspx"); } BindData(wid, shopid, x, y); } }
public ShopBasePage() { serverPath = ""; templateFileName = ""; errInitTemplates = ""; wid = MyCommFun.RequestWid(); if (wid == 0) { errInitTemplates = "链接地址或者参数错误!"; return; } }
protected void Page_Load(object sender, EventArgs e) { var thisUrl = MyCommFun.getWebSite() + "/weixin/WeChatPay/getopenId.aspx" + Request.Url.Query; var widInt = MyCommFun.RequestWid(); var bll = new BLL.wx_userweixin(); var uWeiXinModel = bll.GetModel(widInt); if (uWeiXinModel == null) { throw new Exception("不合法的参数wid"); } OAuth2BaseProc(uWeiXinModel, "MyOrderCenter", thisUrl); }
protected void Page_Load(object sender, EventArgs e) { wid = MyCommFun.RequestWid(); aid = MyCommFun.RequestInt("aid", 0); if (!IsPostBack) { this.rptImglist.DataSource = imgBLL.GetList("bId=" + this.aid + " and iType=2 order by id desc"); this.rptImglist.DataBind(); this.openid = MyCommFun.RequestOpenid(); Model.wx_qp_base baseMod = baseBll.GetModel(this.aid); actName = baseMod.bName; } }
protected void Page_Load(object sender, EventArgs e) { openid = MyCommFun.RequestOpenid(); wid = MyCommFun.RequestWid(); aid = MyCommFun.RequestInt("aid"); joined = MXRequest.GetQueryString("join"); if (aid == 0 || wid == 0 || openid.Trim() == "loseopenid" || joined == "") { ErrLevel = 1; ErrorInfo = "访问参数错误!"; return; } ckState(); }
protected void Page_Load(object sender, EventArgs e) { BLL.wx_qp_base actBll = new BLL.wx_qp_base(); openid = MyCommFun.RequestOpenid(); wid = MyCommFun.RequestWid(); aid = MyCommFun.RequestInt("aid"); if (aid == 0 || wid == 0 || openid.Trim() == "loseopenid" || !actBll.Exists(aid)) { ErrLevel = 1; ErrorInfo = "访问参数错误!"; return; } BindData(); }
protected void Page_Load(object sender, EventArgs e) { //OAuth2认证 string thisUrl = MyCommFun.getWebSite() + "/weixin/restaurant/diancai_shoppingCart.aspx" + Request.Url.Query; int widInt = MyCommFun.RequestWid(); var bll = new BLL.wx_userweixin(); Model.wx_userweixin uWeiXinModel = bll.GetModel(widInt); OAuth2BaseProc(uWeiXinModel, "index", thisUrl); if (!Page.IsPostBack) { BindFormControl(); } }
protected void Page_Load(object sender, EventArgs e) { #if DEBUG openid = "obzTsw5qxlbwGYYZJC9b-91J-X1Y"; #else var thisUrl = MyCommFun.getWebSite() + "/weixin/WeChatPay/MyOrderCenter.aspx" + Request.Url.Query; var widInt = MyCommFun.RequestWid(); var bll = new BLL.wx_userweixin(); var uWeiXinModel = bll.GetModel(widInt); if (uWeiXinModel == null) { throw new Exception("不合法的参数wid"); } OAuth2BaseProc(uWeiXinModel, "MyOrderCenter", thisUrl); #endif }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { float xPoint = MyCommFun.RequestFloat("x", 0); float yPoint = MyCommFun.RequestFloat("y", 0); if (xPoint == 0 || yPoint == 0) { return; } int wid = MyCommFun.RequestWid(); if (wid == 0) { return; } BindData(xPoint, yPoint, wid); } }
override protected void OnInit(EventArgs e) { base.OnInit(e); if (errInitTemplates != "") { Response.Write(errInitTemplates); return; } MyCommFun.RequestWid(); MyCommFun.getTotalUrl(); tPath = MyCommFun.GetRootPath() + "/templates_portal/index.html"; PortalTemplate template = new PortalTemplate(tPath); template.tType = TemplateType.Index; template.OutPutHtml(templateIndexFileName); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { openid = MyCommFun.RequestOpenid(); otid = MyCommFun.RequestInt("otid"); int wid = MyCommFun.RequestWid(); if (openid == "" || otid == 0 || wid == 0) { return; } WeiXinCRMComm wxComm = new WeiXinCRMComm(); string err = ""; token = wxComm.getAccessToken(wid, out err); BLL.orders otBll = new BLL.orders(); ordertmp = otBll.GetModel(otid, wid); } }
protected void Page_Load(object sender, EventArgs e) { hotelid = MyCommFun.RequestInt("hotelid"); wid = MyCommFun.RequestInt("wid"); openid = MyCommFun.QueryString("openid"); string thisUrl = MyCommFun.getWebSite() + "/weixin/KNSHotel/index.aspx" + Request.Url.Query; var bll = new BLL.wx_userweixin(); this.wid = MyCommFun.RequestWid(); Model.wx_userweixin uWeiXinModel = bll.GetModel(wid); OAuth2BaseProc(uWeiXinModel, "index", thisUrl); if (!Page.IsPostBack) { BLL.wx_hotel_dingdan dingdanbll = new BLL.wx_hotel_dingdan(); DataSet dr = dingdanbll.GetList(openid, hotelid); if (dr.Tables[0].Rows.Count > 0) { dingdannum = dr.Tables[0].Rows.Count; numdingdan = " <ul class=\"round\">"; numdingdan += "<li><a href=\"hotel_order.aspx?openid=" + openid + "&hotelid=" + hotelid + "\"> "; numdingdan += "<span>我的订单<em class=\"ok\">" + dr.Tables[0].Rows.Count + "</em></span></a></li>"; numdingdan += " </ul>"; } else { numdingdan = ""; } if (hotelid != 0) { hoteList(hotelid); } } }
protected void Page_Load(object sender, EventArgs e) { hotelid = MyCommFun.RequestInt("hotelid"); openid = MyCommFun.QueryString("openid"); this.title = this.GetTitle(); string thisUrl = MyCommFun.getWebSite() + "/weixin/KNSHotel/index.aspx" + Request.Url.Query; var bll = new BLL.wx_userweixin(); this.wid = MyCommFun.RequestWid(); Model.wx_userweixin uWeiXinModel = bll.GetModel(wid); OAuth2BaseProc(uWeiXinModel, "index", thisUrl); if (!Page.IsPostBack) { if (!string.IsNullOrEmpty(this.openid) && this.hotelid > 0) { var dingdanbll = new BLL.wx_hotel_dingdan(); var hotelInfo = new BLL.wx_hotels_info().GetModel(this.hotelid); if (hotelInfo != null) { this.wid = hotelInfo.wid.Value; } DataSet dr = dingdanbll.GetList(this.openid, this.hotelid); if (dr.Tables[0].Rows.Count > 0) { this.dingdannum = dr.Tables[0].Rows.Count; } else { this.dingdannum = 0; } } } }
protected void Page_Load(object sender, EventArgs e) { OnlyWeiXinLook(); MyCommFun.getTotalUrl(); id = MyCommFun.RequestInt("id", 0); wid = MyCommFun.RequestWid(); openid = MyCommFun.RequestOpenid(); string whereStr = " wid=" + wid + " and id=" + id; wx_dati_base baseBll = new wx_dati_base(); Model.wx_dati_base baseDT = baseBll.GetModel(whereStr); //红包设置 bool hbreISopen = false; int reMsg = 0; bool hbISopen = true; //红包是否开启 int hbWhere = 0; //红包参与条件 int hbMTnum = 10; //第天领取人数 int hbMRnum = 5; //每人领取次数 int hbRCnum = 3; //容错次数 if (hbISopen) { hbreISopen = true; } //红包参与条件 //取用户答题记录 // int getUseridCount = baseBll.GetRecordCount(" openid='" + openid + "'"); // if (getUseridCount >= hbRCnum) hbreISopen = false; //用户信息 wx_dati_user userBLL = new wx_dati_user(); Model.wx_dati_user usermodel = userBLL.GetModel(" openid='" + openid + "' "); int getUseridCount = userBLL.GetRecordCount(" openid='" + openid + "'"); if (getUseridCount >= 3) { isusersub = true; } if (usermodel != null) { usersum = usermodel.score.ToString(); } ///end if (id == 0 || wid == 0 || openid.Trim() == "") { Response.Redirect("err.aspx?rev=1"); return; } if (baseDT.starttime > DateTime.Now) { //说明活动未开始 Response.Redirect("err.aspx?rev=2"); return; } if (baseDT.endtime <= DateTime.Now) { //说明活动已经结束 Response.Redirect("err.aspx?rev=3"); return; } htmlTitle = baseDT.title; summary = baseDT.summary; headimg = baseDT.headimg; bjcolor = baseDT.bjcolor; dtime = baseDT.dttime; dxgetnum = int.Parse(baseDT.dxgetnum.ToString()); ////// string dxwhereStr; if (dxgetnum > 0) {//抽取 int count = dxBLL.GetRecordCount(" pid=" + id); //////生成随机题号 string inStr = ""; Hashtable hashtable = new Hashtable(); Random rm = new Random(); int RmNum = dxgetnum; for (int i = 0; hashtable.Count < RmNum; i++) { int nValue = rm.Next(1, count); if (!hashtable.ContainsValue(nValue) && nValue != 0) { hashtable.Add(nValue, nValue); } } foreach (DictionaryEntry de in hashtable) { inStr += de.Value.ToString() + ","; } ///// dxwhereStr = " pid=" + id + " and isshow=1 and sid in (" + inStr.Substring(0, inStr.Length - 1) + ")"; } else { dxwhereStr = " pid=" + id + " and isshow=1 "; } dxDT = dxBLL.GetList(dxwhereStr); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/json"; int aid = MyCommFun.RequestInt("aid"); int wid = MyCommFun.RequestWid(); string openid = MyCommFun.RequestOpenid(); string _action = MXRequest.GetQueryString("mycat"); BLL.wx_qp_base actBll = new wx_qp_base(); BLL.wx_qp_users userBll = new BLL.wx_qp_users(); //验证码 if (_action == "sendCardCheckCode") { Model.wx_qp_base actModel = actBll.GetModel(aid); string actName = actModel.bName; smsMgr smgr = null; string Number = string.Empty; string smsStatus = string.Empty; string telephone = MXRequest.GetQueryString("telephone"); #region 验证码 Dictionary <string, string> jsonDict = new Dictionary <string, string>(); IList <Model.wx_qp_users> userList = userBll.GetModelList(string.Format(" (openid='{0}'and bId={2}) or (uTel='{1}' and bId={2})", openid, telephone, aid)); try { if (Regexlib.IsValidMobile(telephone)) { //判断是否超过活动最大人数 if (actModel.cyPersonNum >= actModel.maxPersonNum) { jsonDict.Add("errno", "sys"); jsonDict.Add("content", "活动人数已满!"); context.Response.Write(MyCommFun.getJsonStr(jsonDict)); return; } if (userList.Count > 0)//已参加过本次活动,不发送验证码 { jsonDict.Add("errno", "sys"); jsonDict.Add("content", "你已参加过本次活动!"); context.Response.Write(MyCommFun.getJsonStr(jsonDict)); return; } smgr = new smsMgr(wid); Number = Utils.Number(6, true); smsStatus = smgr.SendSMS(telephone, Number + "(动态验证码),您于" + DateTime.Now.ToString("yyyy年MM月dd日 hh点mm分") + "参与\"" + actName + "\"抢票活动,请在10分钟内输入该验证码!", Number, actName, aid); if (smsStatus == "成功") { //获取验证码 jsonDict.Add("errno", "0"); jsonDict.Add("content", "获取验证码成功"); context.Response.Write(MyCommFun.getJsonStr(jsonDict)); return; } else { jsonDict.Add("errno", "sys"); jsonDict.Add("content", "发送验证码失败!"); context.Response.Write(MyCommFun.getJsonStr(jsonDict)); return; } } else { jsonDict.Add("errno", "sys"); jsonDict.Add("content", "手机格式错误!"); context.Response.Write(MyCommFun.getJsonStr(jsonDict)); return; } } catch (Exception ex) { jsonDict.Add("errno", "sys"); jsonDict.Add("content", "发送验证码失败!"); context.Response.Write(MyCommFun.getJsonStr(jsonDict)); return; } #endregion } //index页面抢票时判断是否已参加过活动 if (_action == "qp_ckJoined") { Dictionary <string, string> jsonDict = new Dictionary <string, string>(); //判断此人是否已参与过活动 bool joined = userBll.GetModelList(string.Format(" bId={0} and openid='{1}'", aid, openid)).Count > 0; if (joined)//已参与,跳转结果显示页面 { string goUrl = string.Format("order_Result.aspx?wid={0}&aid={1}&openid={2}&join=false", wid, aid, openid); jsonDict.Add("errno", "0"); jsonDict.Add("content", goUrl); context.Response.Write(MyCommFun.getJsonStr(jsonDict)); return; } else//还未参与,跳转订单页面 { string goUrl = string.Format("order.aspx?wid={0}&aid={1}&openid={2}", wid, aid, openid); jsonDict.Add("errno", "0"); jsonDict.Add("content", goUrl); context.Response.Write(MyCommFun.getJsonStr(jsonDict)); return; } } //抢票得到订单 if (_action == "qp_ckOrder") { string identCode = MyCommFun.QueryString("identCode"); string telephone = MyCommFun.QueryString("telephone"); BLL.wx_sms_info smsBll = new BLL.wx_sms_info(); Dictionary <string, string> jsonDict = new Dictionary <string, string>(); string goUrl = ""; //判断用户是否已经参与过活动 IList <Model.wx_qp_users> userList = userBll.GetModelList(string.Format(" (openid='{0}'and bId={2}) or (uTel='{1}' and bId={2}) ", openid, telephone, aid)); //判断验证码 bool ckIdentcode = smsBll.ExistsYzm(telephone, identCode); Model.wx_qp_base actModel = actBll.GetModel(aid); //判断是否超过活动最大人数 if (actModel.cyPersonNum >= actModel.maxPersonNum) { jsonDict.Add("errno", "sys"); jsonDict.Add("content", "活动人数已满!"); context.Response.Write(MyCommFun.getJsonStr(jsonDict)); return; } if (userList.Count > 0) { jsonDict.Add("errno", "sys"); jsonDict.Add("content", "你已参加过活动,每人只能参加一次!"); context.Response.Write(MyCommFun.getJsonStr(jsonDict)); return; } if (!Regexlib.IsValidMobile(telephone)) { jsonDict.Add("errno", "sys"); jsonDict.Add("content", "手机格式错误!"); context.Response.Write(MyCommFun.getJsonStr(jsonDict)); return; } if (!ckIdentcode) { jsonDict.Add("errno", "sys"); jsonDict.Add("content", "验证码错误!"); context.Response.Write(MyCommFun.getJsonStr(jsonDict)); return; } Model.wx_qp_users model = new Model.wx_qp_users(); model.bId = aid; model.openid = openid; model.uTel = telephone; model.createDate = DateTime.Now; model.sn = "sn_" + Utils.Number(6, true); //添加参与活动用户并给递加活动人数 int res = userBll.Add(model); actModel.cyPersonNum = actModel.cyPersonNum + 1; actModel.yingyuanlist = null; actBll.Update(actModel); //判断该活动是否发送SN码通知用户 if (actModel.isSnSendsms && res > 0)//发送 { smsMgr smgr = new smsMgr(wid); string smsStatus = smgr.SendSMS("您于" + DateTime.Now.ToString("yyyy年MM月dd日 hh点mm分") + "参与\"" + actModel.bName + "\"抢票活动!恭喜你,抢票成功!(SN码)" + telephone, model.sn, model.sn, actModel.bName, aid); } goUrl = string.Format("order_Result.aspx?wid={0}&aid={1}&openid={2}&join=true", wid, aid, openid); jsonDict.Add("errno", "0"); jsonDict.Add("content", goUrl); context.Response.Write(MyCommFun.getJsonStr(jsonDict)); } }