コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         int type = 1;
         if (Request.QueryString["type"] != null)
         {
             int.TryParse(Request.QueryString["type"], out type);
         }
         string CookieKey    = WebUtil.GetOpenIDPrefix();
         string OpenID       = this.Request.Cookies[CookieKey].Value;
         string activityHome = "/html/newweixin/service/dcwj_list.html";
         string file         = Server.MapPath("~" + activityHome);
         if (System.IO.File.Exists(file))
         {
             this.Response.Cookies.Add(new HttpCookie(CookieKey, OpenID));
             this.Response.Redirect(WeixinHelper.ResolveClientUrl(activityHome + "?type=" + type + "&wxopenid=" + OpenID + "&t=" + DateTime.Now.Ticks), true);
             return;
         }
         else
         {
             Response.Write("调查问卷页面未创建");
             this.Response.End();
             return;
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteError("WeiXin", this.Request.Url.ToString(), ex);
         Response.Write("请求已过期,请刷新后重试");
         return;
     }
 }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         string activitypath = "/html/newweixin/service/tzgglist.html";
         string file         = Server.MapPath("~" + activitypath);
         if (System.IO.File.Exists(file))
         {
             this.Response.Redirect(WeixinHelper.ResolveClientUrl(activitypath + "?t=" + DateTime.Now.Ticks), true);
             return;
         }
         else
         {
             Response.Write("找不到相关页面");
             this.Response.End();
             return;
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteError("WeiXin", this.Request.Url.ToString(), ex);
         Response.Write("请求已过期,请刷新后重试");
         return;
     }
 }
コード例 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         string OpenID = this.Request.Cookies[WebUtil.GetOpenIDPrefix()].Value;
         var    list   = Project.GetProjectListByOpenid(OpenID);
         if (list.Length > 0)
         {
             string activitypath = "/html/newweixin/service/fycj.html";
             string file         = Server.MapPath("~" + activitypath);
             if (System.IO.File.Exists(file))
             {
                 this.Response.Redirect(WeixinHelper.ResolveClientUrl(activitypath + "?t=" + DateTime.Now.Ticks), true);
                 return;
             }
             else
             {
                 Response.Write("找不到相关页面");
                 this.Response.End();
                 return;
             }
         }
         else
         {
             this.Response.Redirect(WeixinHelper.ResovleOauth2Url("Weixin/RoomConnectRedirect.aspx", false), true);
             return;
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteError("WeiXin", this.Request.Url.ToString(), ex);
         Response.Write("请求已过期,请刷新后重试");
         return;
     }
 }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         string OpenID       = string.Empty;
         string CookieKey    = WebUtil.GetOpenIDPrefix();
         string activityHome = "/html/newweixin/service/businesslist.html";
         string file         = Server.MapPath("~" + activityHome);
         if (System.IO.File.Exists(file))
         {
             this.Response.Cookies.Add(new HttpCookie(CookieKey, OpenID));
             this.Response.Redirect(WeixinHelper.ResolveClientUrl(activityHome + "?t=" + DateTime.Now.Ticks), true);
             return;
         }
         else
         {
             Response.Write("找不到相关页面");
             this.Response.End();
             return;
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteError("WeiXin", this.Request.Url.ToString(), ex);
         Response.Write("请求已过期,请刷新后重试");
         return;
     }
 }
コード例 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         string CookieKey = WebUtil.GetOpenIDPrefix();
         string OpenID    = string.Empty;
         if (HttpContext.Current.Request.Cookies[CookieKey] != null)
         {
             OpenID = HttpContext.Current.Request.Cookies[CookieKey].Value;
         }
         if (string.IsNullOrEmpty(OpenID))
         {
             return;
         }
         string activitypath = "/html/newweixin/index.html";
         string file         = Server.MapPath("~" + activitypath);
         if (!System.IO.File.Exists(file))
         {
             activitypath = "/html/newweixin/home/index.html";
             file         = Server.MapPath("~" + activitypath);
         }
         if (System.IO.File.Exists(file))
         {
             this.Response.Redirect(WeixinHelper.ResolveClientUrl(activitypath + "?t=" + DateTime.Now.Ticks + "&index=0"), false);
             return;
         }
         else
         {
             Response.Write("找不到相关页面");
             return;
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteError("WeiXin", this.Request.Url.ToString(), ex);
         Response.Write("请求已过期,请刷新后重试");
         return;
     }
 }
コード例 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.Response.Redirect(WeixinHelper.ResolveClientUrl("http://mp.weixin.qq.com/bizmall/mallshelf?id=&t=mall/list&biz=MzI5NDQ2MDk4Mw==&shelf_id=1&showwxpaytitle=1#wechat_redirect"), true);
 }
コード例 #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (string.IsNullOrEmpty(Request.QueryString["ID"]))
         {
             Response.Write("非法的请求");
             this.Response.End();
             return;
         }
         int activityID = Convert.ToInt32(Request.QueryString["ID"]);
         var activity   = LotteryHelper.GetActivity(activityID);
         if (activity == null)
         {
             Response.Write("活动已关闭");
             this.Response.End();
             return;
         }
         string CookieKey      = WebUtil.GetOpenIDPrefix();
         string OpenID         = this.Request.Cookies[CookieKey].Value;
         string activityid_key = string.IsNullOrEmpty(WebUtil.getApplicationPath()) ? "activity" : WebUtil.getApplicationPath() + "_activity";
         string activityHome   = string.Empty;
         string file           = string.Empty;
         if (activity.UserLimit)
         {
             var joinuser = Foresight.DataAccess.Wechat_LotteryActivityUser.GetWechatLotteryActivityUserByOpenID(activity.ID, OpenID);
             if (joinuser == null)
             {
                 activityHome = "/html/newweixin/lottery/lotteryinfocollect.html";
                 file         = Server.MapPath("~" + activityHome);
                 if (System.IO.File.Exists(file))
                 {
                     this.Response.Cookies.Add(new HttpCookie(CookieKey, OpenID));
                     this.Response.Cookies.Add(new HttpCookie(activityid_key, activity.ID.ToString()));
                     this.Response.Redirect(WeixinHelper.ResolveClientUrl(activityHome + "?t=" + DateTime.Now.Ticks), true);
                     return;
                 }
                 else
                 {
                     Response.Write("活动页面未创建");
                     this.Response.End();
                     return;
                 }
             }
         }
         if (string.IsNullOrEmpty(activityHome))
         {
             activityHome = string.Format("/html/newweixin/lottery/{0}/index.html", activity.ID.ToString());
             file         = Server.MapPath("~" + activityHome);
             if (!System.IO.File.Exists(file))
             {
                 activityHome = string.Format("/html/newweixin/lottery/{0}/index.html", activity.Type);
                 file         = Server.MapPath("~" + activityHome);
             }
             if (!System.IO.File.Exists(file))
             {
                 activityHome = string.Format("/html/newweixin/lottery/{0}/index.html", activity.Type);
                 if (activity.Type.Equals(Utility.EnumModel.LotteryTypeDefine.Goldenegg.ToString()))
                 {
                     activityHome = "/html/newweixin/lottery/lottery_zjd/index.html";
                 }
                 else if (activity.Type.Equals(Utility.EnumModel.LotteryTypeDefine.Shake.ToString()))
                 {
                     activityHome = "/html/newweixin/lottery/lottery_yly/index.html";
                 }
                 else if (activity.Type.Equals(Utility.EnumModel.LotteryTypeDefine.Shave.ToString()))
                 {
                     activityHome = "/html/newweixin/lottery/lottery_ggl/index.html";
                 }
                 else if (activity.Type.Equals(Utility.EnumModel.LotteryTypeDefine.Turntable.ToString()))
                 {
                     activityHome = "/html/newweixin/lottery/lottery_zp/index.html";
                 }
                 file = Server.MapPath("~" + activityHome);
             }
         }
         this.Response.Clear();
         this.Response.Cookies.Add(new HttpCookie(CookieKey, OpenID));
         this.Response.Cookies.Add(new HttpCookie(activityid_key, activity.ID.ToString()));
         this.Response.Redirect(WeixinHelper.ResolveClientUrl(activityHome + "?t=" + DateTime.Now.Ticks), true);
     }
     catch (Exception ex)
     {
         LogHelper.WriteError("WeiXin", this.Request.Url.ToString(), ex);
         Response.Write("请求已过期,请刷新后重试");
         return;
     }
 }