protected void Page_Load(object sender, EventArgs e)
        {
            base.OnInit(e);
            if (errInitTemplates != "")
            {
                Response.Write(errInitTemplates);
                return;
            }

            //1获得模版基本信息
            BLL.wx_module_templates tBll = new BLL.wx_module_templates();
            templateFileName = tBll.GetTemplatesFileNameByWid("shop", wid);
            if (templateFileName == null || templateFileName.Trim() == "")
            {
                errInitTemplates = "不存在该帐号或者该帐号尚未设置模版!";
                Response.Write(errInitTemplates);
                Response.End();
                return;
            }

            serverPath = MyCommFun.GetRootPath() + "/shop/templates/" + templateFileName + "/order_success.html";
            ShopTemplateMgr template = new ShopTemplateMgr("/shop/templates/" + templateFileName, serverPath, wid);

            template.tType  = TemplateType.orderSuccess;
            template.openid = MyCommFun.RequestOpenid();
            template.OutPutHtml(wid);
        }
예제 #2
0
        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);
            if (errInitTemplates != "")
            {
                Response.Write(errInitTemplates);
                return;
            }

            //1获得模版基本信息
            BLL.wx_module_templates tBll = new BLL.wx_module_templates();
            templateFileName = tBll.GetTemplatesFileNameByWid("shop", wid);
            if (templateFileName == null || templateFileName.Trim() == "")
            {
                errInitTemplates = "不存在该帐号或者该帐号尚未设置模版!";
                Response.Write(errInitTemplates);
                Response.End();
                return;
            }
            string _action = MyCommFun.QueryString("myact");

            if (_action == "editAddr")
            {
                EditAddr();
            }
            serverPath = MyCommFun.GetRootPath() + "/shop/templates/" + templateFileName + "/editaddr.html";
            ShopTemplateMgr template = new ShopTemplateMgr("/shop/templates/" + templateFileName, serverPath, wid);

            template.tType  = TemplateType.editaddr;
            template.openid = MyCommFun.RequestOpenid();
            template.OutPutHtml(wid);
        }
예제 #3
0
        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);
            if (errInitTemplates != "")
            {
                Response.Write(errInitTemplates);
                return;
            }

            //1获得模版基本信息
            BLL.wx_module_templates tBll = new BLL.wx_module_templates();
            templateFileName = tBll.GetTemplatesFileNameByWid("shop", wid);
            if (templateFileName == null || templateFileName.Trim() == "")
            {
                errInitTemplates = "不存在该帐号或者该帐号尚未设置模版!";
                Response.Write(errInitTemplates);
                Response.End();
                return;
            }
            MyCommFun.RequestOpenid();
            MyCommFun.getTotalUrl();

            serverPath = MyCommFun.GetRootPath() + "/shop/templates/" + templateFileName + "/index.html";
            ShopTemplateMgr template = new ShopTemplateMgr("/shop/templates/" + templateFileName, serverPath, wid);

            template.tType  = TemplateType.Index;
            template.openid = MyCommFun.RequestOpenid();
            template.OutPutHtml(wid);
        }
예제 #4
0
        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);
            if (errInitTemplates != "")
            {
                Response.Write(errInitTemplates);
                return;
            }

            //1获得模版基本信息
            BLL.wx_module_templates tBll = new BLL.wx_module_templates();
            templateFileName = tBll.GetTemplatesFileNameByWid("shop", wid);
            if (templateFileName == null || templateFileName.Trim() == "")
            {
                errInitTemplates = "不存在该帐号或者该帐号尚未设置模版!";
                Response.Write(errInitTemplates);
                Response.End();
                return;
            }

            BLL.wx_userweixin   bll     = new BLL.wx_userweixin();
            Model.wx_userweixin wxModel = bll.GetModel(wid);
            string thisUrl = MyCommFun.getTotalUrl();

            OAuth2BaseProc(wxModel, "cart", thisUrl);

            serverPath = MyCommFun.GetRootPath() + "/shop/templates/" + templateFileName + "/category.html";
            ShopTemplateMgr template = new ShopTemplateMgr("/shop/templates/" + templateFileName, serverPath, wid);

            template.tType  = TemplateType.Index;
            template.openid = MyCommFun.RequestOpenid();
            template.OutPutHtml(wid);
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            base.OnInit(e);
            if (errInitTemplates != "")
            {
                Response.Write(errInitTemplates);
                return;
            }


            //1获得模版基本信息
            BLL.wx_module_templates tBll = new BLL.wx_module_templates();
            templateFileName = tBll.GetTemplatesFileNameByWid("shop", wid);
            if (templateFileName == null || templateFileName.Trim() == "")
            {
                errInitTemplates = "不存在该帐号或者该帐号尚未设置模版!";
                Response.Write(errInitTemplates);
                Response.End();
                return;
            }


            //授权

            int orderId = MyCommFun.RequestInt("orderid");

            BLL.wx_userweixin   bll     = new BLL.wx_userweixin();
            Model.wx_userweixin wxModel = bll.GetModel(wid);
            string thisUrl = MyCommFun.getWebSite() + "/shop/order_detail.aspx?wid=" + wid + "&orderid=" + orderId;

            OAuth2BaseProc(wxModel, "order_detail", thisUrl);

            //授权结束



            BLL.wx_shop_user_addr           uAddrBll  = new BLL.wx_shop_user_addr();
            IList <Model.wx_shop_user_addr> uaddrList = uAddrBll.GetOpenidAddr(openid, wid);

            if (uaddrList == null || uaddrList.Count <= 0 || uaddrList[0].id <= 0)
            {
                //该微信用户没有添加地址
                Response.Redirect("/shop/editaddr.aspx?wid=" + wid + "&openid=" + openid + "&frompage=confirmOrder.aspx");
                // MessageBox.ResponseScript(this, "window.location.href =/shop/editaddr.aspx?wid=" + wid + "&openid=" + openid + "&frompage=confirmOrder.aspx");
                return;
            }
            serverPath = MyCommFun.GetRootPath() + "/shop/templates/" + templateFileName + "/order_detail.html";
            ShopTemplateMgr template = new ShopTemplateMgr("/shop/templates/" + templateFileName, serverPath, wid);

            template.tType  = TemplateType.orderDetail;
            template.openid = openid;
            template.OutPutHtml(wid);
        }
예제 #6
0
파일: index.aspx.cs 프로젝트: yidane/51wine
        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);
            if (errInitTemplates != "")
            {
                Response.Write(errInitTemplates);
                return;
            }

            //1获得模版基本信息
            BLL.wx_module_templates tBll = new BLL.wx_module_templates();
            templateFileName = tBll.GetTemplatesFileNameByWid("shop", wid);
            if (templateFileName == null || templateFileName.Trim() == "")
            {
                errInitTemplates = "不存在该帐号或者该帐号尚未设置模版!";
                Response.Write(errInitTemplates);
                Response.End();
                return;
            }



            //授权
            string openid = MyCommFun.RequestOpenid();

            //BLL.wx_userweixin bll = new BLL.wx_userweixin();
            //Model.wx_userweixin wxModel = bll.GetModel(wid);
            //string code = MyCommFun.QueryString("code");
            //if (code == null || code.Trim() == "")
            //{

            //    openid = MyCommFun.RequestOpenid();
            //    string thisUrl = MyCommFun.getWebSite() + "/shop/index.aspx?wid=" + wid;
            //    string newUrl = OAuthApi.GetAuthorizeUrl(wxModel.AppId, thisUrl, "reg", OAuthScope.snsapi_base);
            //    Response.Redirect(newUrl);
            //}
            //else
            //{
            //    var result = OAuthApi.GetAccessToken(wxModel.AppId, wxModel.AppSecret, code);
            //    openid = result.openid;
            //}
            //授权结束

            serverPath = MyCommFun.GetRootPath() + "/shop/templates/" + templateFileName + "/index.html";
            ShopTemplateMgr template = new ShopTemplateMgr("/shop/templates/" + templateFileName, serverPath, wid);

            template.tType = TemplateType.Index;
            //template.openid = MyCommFun.RequestOpenid();
            template.openid = openid;
            template.OutPutHtml(wid);
        }
예제 #7
0
파일: list.aspx.cs 프로젝트: yidane/51wine
        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);
            if (errInitTemplates != "")
            {
                Response.Write(errInitTemplates);
                return;
            }

            //1获得模版基本信息04e11d01b9df2865
            BLL.wx_module_templates tBll = new BLL.wx_module_templates();
            templateFileName = tBll.GetTemplatesFileNameByWid("shop", wid);
            if (templateFileName == null || templateFileName.Trim() == "")
            {
                errInitTemplates = "不存在该帐号或者该帐号尚未设置模版!";
                Response.Write(errInitTemplates);
                Response.End();
                return;
            }

            //授权
            BLL.wx_userweixin   bll     = new BLL.wx_userweixin();
            Model.wx_userweixin wxModel = bll.GetModel(wid);

            string type = MyCommFun.QueryString("type");

            if (type != "")
            {
                type = "&type=new";
            }

            string thisUrl = MyCommFun.getWebSite() + "/shop/list.aspx?wid=" + wid + "&cid=" + MyCommFun.RequestInt("cid") + type;

            OAuth2BaseProc(wxModel, "list", thisUrl);
            //授权结束


            serverPath = MyCommFun.GetRootPath() + "/shop/templates/" + templateFileName + "/list.html";
            ShopTemplateMgr template = new ShopTemplateMgr("/shop/templates/" + templateFileName, serverPath, wid);

            template.tType  = TemplateType.Class;
            template.openid = openid;
            template.OutPutHtml(wid);
            DataSet ds = new DataSet();
        }
예제 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            base.OnInit(e);
            if (errInitTemplates != "")
            {
                Response.Write(errInitTemplates);
                return;
            }

            //1获得模版基本信息
            BLL.wx_module_templates tBll = new BLL.wx_module_templates();
            templateFileName = tBll.GetTemplatesFileNameByWid("shop", wid);
            if (templateFileName == null || templateFileName.Trim() == "")
            {
                errInitTemplates = "不存在该帐号或者该帐号尚未设置模版!";
                Response.Write(errInitTemplates);
                Response.End();
                return;
            }

            //授权
            BLL.wx_userweixin   bll     = new BLL.wx_userweixin();
            Model.wx_userweixin wxModel = bll.GetModel(wid);
            string openid = "";
            string code   = MyCommFun.QueryString("code");

            if (code == null || code.Trim() == "")
            {
                // openid = MyCommFun.RequestOpenid();
                int    orderId = MyCommFun.RequestInt("orderid");
                string thisUrl = MyCommFun.getWebSite() + "/shop/confirmOrder.aspx?wid=" + wid;
                string newUrl  = OAuth.GetAuthorizeUrl(wxModel.AppId, thisUrl, "confirmOrder", OAuthScope.snsapi_base);
                Response.Redirect(newUrl);
            }
            else
            {
                var result = OAuth.GetAccessToken(wxModel.AppId, wxModel.AppSecret, code);
                openid = result.openid;
            }
            //授权结束



            BLL.wx_shop_user_addr           uAddrBll  = new BLL.wx_shop_user_addr();
            IList <Model.wx_shop_user_addr> uaddrList = uAddrBll.GetOpenidAddr(openid, wid);

            if (uaddrList == null || uaddrList.Count <= 0 || uaddrList[0].id <= 0)
            {
                //该微信用户没有添加地址
                Response.Redirect("/shop/editaddr.aspx?wid=" + wid + "&openid=" + openid + "&frompage=confirmOrder.aspx");
                // MessageBox.ResponseScript(this, "window.location.href =/shop/editaddr.aspx?wid=" + wid + "&openid=" + openid + "&frompage=confirmOrder.aspx");
                return;
            }

            serverPath = MyCommFun.GetRootPath() + "/shop/templates/" + templateFileName + "/confirmOrder.html";
            ShopTemplateMgr template = new ShopTemplateMgr("/shop/templates/" + templateFileName, serverPath, wid);

            template.tType  = TemplateType.confirmOrder;
            template.openid = openid;
            template.OutPutHtml(wid);
        }