Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string u  = Request.ServerVariables["HTTP_USER_AGENT"];
            bool   bo = detectmobilebrowser.HttpUserAgent(u);

            orderid = Request["orderid"].ConvertTo <int>(0);

            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl));
            }

            if (comid == 0)//如果非标准格式,查询 是否有绑定的域名
            {
                var domaincomid = B2bCompanyData.GetComId(RequestUrl);
                if (domaincomid != null)
                {
                    comid = domaincomid.Com_id;
                }
            }

            if (comid != 0)
            {
                var commodel = B2bCompanyData.GetCompany(comid);

                if (commodel != null)
                {
                    title = commodel.Com_name;
                }
            }


            //从cookie中得到微信号
            if (Request.Cookies["openid"] != null)
            {
                openid = Request.Cookies["openid"].Value;
            }
            if (Request.Cookies["AccountId"] != null)
            {
                AccountId = int.Parse(Request.Cookies["AccountId"].Value);
            }



            //获取微信平台端code
            string weixincode = Request["code"].ConvertTo <string>("");

            openid = Request["openid"].ConvertTo <string>("");
            string weixinpass = Request["weixinpass"].ConvertTo <string>("");

            GetMemberCard(openid, weixincode, weixinpass, comid);//登陆或得到会员信息



            //最后判断登陆
            if (AccountId == 0)
            {
                Response.Redirect("/h5/order/login.aspx?come=/h5/order/order.aspx");//非手机的跳转到V目录
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Request.ValidateInput();

            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                //先通过正则表达式获取COMid
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
                if (comid == 0)
                {
                    comid = new WeiXinBasicData().GetWeiXinBasicByDomain(RequestUrl).Comid;
                }
                if (comid != 0)
                {
                    comName = B2bCompanyData.GetCompany(comid).Com_name;

                    B2b_company_saleset pro = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                }
            }
            else
            {
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                    if (comid != 0)
                    {
                        //comName = B2bCompanyData.GetCompany(comid).Com_name;
                    }
                }
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string u  = Request.ServerVariables["HTTP_USER_AGENT"];
            bool   bo = detectmobilebrowser.HttpUserAgent(u);


            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl));
            }
            else
            {
                if (bo == false)
                {
                    Response.Redirect("http://vctrip.etown.cn/");
                }
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                    if (bo == false)
                    {
                        if (comid == 101)
                        {
                            Response.Redirect("http://vctrip.etown.cn/");
                        }
                        Response.Redirect("http://shop" + comid + ".etown.cn");
                    }
                }
            }


            //从cookie中得到微信号
            if (Request.Cookies["openid"] != null)
            {
                openid = Request.Cookies["openid"].Value;
            }
            if (Request.Cookies["AccountId"] != null)
            {
                AccountId = Request.Cookies["AccountId"].Value;
            }



            //获取微信平台端code
            string weixincode = Request["code"].ConvertTo <string>("");

            if (weixincode != "")
            {
                int questtype = 2;//1=微信授权验证
                DealUserinfo1("", weixincode, comid, questtype);
            }
            else
            {
                string openid     = Request["openid"].ConvertTo <string>("");
                string weixinpass = Request["weixinpass"].ConvertTo <string>("");
                int    questtype  = 1;                               //1=一次性密码验证
                DealUserinfo1(openid, weixinpass, comid, questtype); //判断用户微信号(1,点击的转发链接进来的2,点击微信菜单进来的);使用户处于登录状态(不包括点击转发链接的)
            }
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //string u = Request.ServerVariables["HTTP_USER_AGENT"];
            //bool bo = detectmobilebrowser.HttpUserAgent(u);
            bool bo = true;

            string RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();

            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
            }
            else
            {
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                }
            }
            if (comid != 0)
            {
                //根据公司id得到公司logo地址和公司名称
                comname = B2bCompanyData.GetCompany(comid).Com_name;
                B2b_company_saleset pro = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                if (pro != null)
                {
                    comlogo = FileSerivce.GetImgUrl(pro.Logo.ConvertTo <int>(0));
                }

                //获取微信平台端code
                string weixincode = Request["code"].ConvertTo <string>("");

                if (weixincode != "")
                {
                    int questtype = 2;//1=微信授权验证
                    DealUserinfo1("", weixincode, comid, questtype);
                }
                else
                {
                    string openid     = Request["openid"].ConvertTo <string>("");
                    string weixinpass = Request["weixinpass"].ConvertTo <string>("");
                    int    questtype  = 1;                               //1=一次性密码验证
                    DealUserinfo1(openid, weixinpass, comid, questtype); //判断用户微信号(1,点击的转发链接进来的2,点击微信菜单进来的);使用户处于登录状态(不包括点击转发链接的)
                }

                B2bModelData mdate = new B2bModelData();
                //判断模板,进行跳转
                var h5model = mdate.SelectModelSearchComid(comid);
                if (h5model != null)
                {
                    if (h5model.Modelid != 1)
                    {
                        Response.Redirect("/h5/Default" + h5model.Modelid + ".aspx");
                    }
                }
            }
        }
Ejemplo n.º 5
0
        public string gongsilogo   = "";   //公司logo

        protected void Page_Load(object sender, EventArgs e)
        {
            string u  = Request.ServerVariables["HTTP_USER_AGENT"];
            bool   bo = detectmobilebrowser.HttpUserAgent(u);//判断是否是手机访问


            string RequestUrl = HttpContext.Current.Request.ServerVariables["SERVER_NAME"].Trim().ToLower();

            #region 如果符合shop101.etown.cn的格式,根据微信配置信息获得公司信息(基本信息和扩展信息)
            if (Domain_def.Domain_yanzheng(RequestUrl))
            {
                WeiXinBasic wxbasic = new WeiXinBasicData().GetWeiXinBasicByDomain(RequestUrl);

                #region 如果配置了微信接口信息,获得公司信息
                if (wxbasic != null)
                {
                    int comid = wxbasic.Comid;
                    cominfo = B2bCompanyData.GetAllComMsg(comid);


                    //判断访问路径来源:1.微信认证商家直接点击自定义菜单链接过来,微信端传递过来code ;
                    string weixincode = Request["code"].ConvertTo <string>("");
                    if (weixincode != "")
                    {
                        if (cominfo != null)
                        {
                            GetOpenId(weixincode, cominfo.ID);
                            GetComLogo(cominfo.ID);
                        }
                    }
                    //2.微信未认证商家点击链接过来,传递过来openid和一次性密码(a.正确的openid和一次性密码,则实现会员登录和获得会员信息所在公司信息;b.一次性密码错误或者没有传递则 通过客户端保存数据获得用户信息)
                    string openid     = Request["openid"].ConvertTo <string>("");
                    string weixinpass = Request["weixinpass"].ConvertTo <string>("");
                    if (openid != "")
                    {
                        if (cominfo != null)
                        {
                            VerifyOneOffPass(openid, weixinpass, cominfo.ID);
                            GetComLogo(cominfo.ID);
                        }
                    }
                }
                #endregion
                #region 如果没有配置微信接口信息,不处理
                else
                {
                }
                #endregion
            }
            #endregion

            #region 如果不符合shop101.etown.cn的格式,不处理
            else
            {
            }
            #endregion
        }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            come = Request["come"].ConvertTo <string>("");

            string RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();

            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
            }
            else
            {
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                }
            }
            if (comid != 0)
            {
                //根据公司id得到公司logo地址和公司名称

                var commodel = B2bCompanyData.GetCompany(comid);
                if (commodel != null)
                {
                    title       = commodel.Com_name;
                    CompanyName = commodel.Com_name;
                }

                B2b_company_saleset pro = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                if (pro != null)
                {
                    if (pro.Smalllogo != null && pro.Smalllogo != "")
                    {
                        comlogo = FileSerivce.GetImgUrl(pro.Smalllogo.ConvertTo <int>(0));
                    }
                }
            }



            //获取微信平台端code
            string weixincode = Request["code"].ConvertTo <string>("");

            if (weixincode != "")
            {
                int questtype = 2;//1=微信授权验证
                DealUserinfo1("", weixincode, comid, questtype);
            }
            else
            {
                string openid     = Request["openid"].ConvertTo <string>("");
                string weixinpass = Request["weixinpass"].ConvertTo <string>("");
                int    questtype  = 1;                               //1=一次性密码验证
                DealUserinfo1(openid, weixinpass, comid, questtype); //判断用户微信号(1,点击的转发链接进来的2,点击微信菜单进来的);使用户处于登录状态(不包括点击转发链接的)
            }
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();

            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
            }
            else
            {
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                }
            }


            if (comid != 0)
            {
                B2b_company company = B2bCompanyData.GetCompany(comid);
                if (company != null)
                {
                    companyname = company.Com_name;
                    tel         = company.B2bcompanyinfo.Tel;
                }
            }


            //Banner
            int totalcount = 0;
            B2bCompanyImageData      imgdata = new B2bCompanyImageData();
            List <B2b_company_image> imglist = imgdata.PageGetimageList(comid, 0, out totalcount);

            if (imglist != null)
            {
                bannerstr   = "<ul> ";
                bannerolstr = " <ol>";


                for (int i = 0; i < totalcount; i++)
                {
                    bannerstr += "<li><a onclick=\"return false;\">	<img src=\"" + FileSerivce.GetImgUrl(imglist[i].Imgurl) + "\" alt=\"" + imglist[i].Title + "\" style=\"width:100%;\" /></a></li>";
                    if (i == 0)
                    {
                        bannerolstr += "<li class=\"on\"></li>";
                    }
                    else
                    {
                        bannerolstr += "<li ></li>";
                    }
                }

                bannerstr += "</ul>" + bannerolstr + "</ol>";
            }
        }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            userweixin  = Request["userweixin"].ConvertTo <string>("");
            guwenweixin = Request["guwenweixin"].ConvertTo <string>("");



            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                //先通过正则表达式获取COMid
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
            }
            if (comid == 0)//如果非标准格式,查询 是否有绑定的域名
            {
                var domaincomid = B2bCompanyData.GetComId(RequestUrl);
                if (domaincomid != null)
                {
                    comid = domaincomid.Com_id;
                }
            }
            #region  微信语音播放接口会用到
            string url = Request.Url.ToString();

            //根据传入参数openid、comid 得到 access_token、jsapi_ticket、noncestr、timestamp、 url(当前网页的URL,不包含#及其后面部分)
            WeiXinBasic basic = new WeiXinBasicData().GetWxBasicByComId(comid);
            if (basic != null)
            {
                appId     = basic.AppId;
                timestamp = new WeixinVoiceUtil().CreatenTimestamp();
                nonceStr  = new WeixinVoiceUtil().CreatenNonce_str();

                WXAccessToken maccesstoken = new WeixinVoiceUtil().GetAccessToken(comid, basic.AppId, basic.AppSecret);
                if (maccesstoken != null)
                {
                    string jsapi_ticket = new WeixinVoiceUtil().GetTickect(maccesstoken.ACCESS_TOKEN, comid);
                    if (jsapi_ticket == "")
                    {
                        isrightwxset = 0;
                    }
                    else
                    {
                        string beforesha1_signature = "";
                        signature = new WeixinVoiceUtil().GetSignature(jsapi_ticket, nonceStr, timestamp, url, out beforesha1_signature);
                    }
                }
                else
                {
                    isrightwxset = 0;
                }
            }
            else
            {
                isrightwxset = 0;
            }
            #endregion
        }
Ejemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //string u = Request.ServerVariables["HTTP_USER_AGENT"];
            //bool bo = detectmobilebrowser.HttpUserAgent(u);
            bool bo = true;

            string RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();

            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
            }
            else
            {
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                }
            }


            if (comid != 0)
            {
                B2b_company company = B2bCompanyData.GetCompany(comid);
                if (company != null)
                {
                    companyname = company.Com_name;
                }
            }


            //Banner
            int totalcount = 0;
            B2bCompanyImageData      imgdata = new B2bCompanyImageData();
            List <B2b_company_image> imglist = imgdata.PageGetimageList(comid, 0, out totalcount);

            if (imglist != null)
            {
                for (int i = 0; i < totalcount; i++)
                {
                    if (title_arr == "")
                    {
                        title_arr = "\\\"" + imglist[i].Title + "\\\"";
                        img_arr   = "\\\"" + FileSerivce.GetImgUrl(imglist[i].Imgurl).Replace("/", "\\\\\\/") + "\\\"";
                        url_arr   = "\\\"" + imglist[i].Linkurl.Replace("/", "\\\\\\/") + "\\\"";;
                    }
                    else
                    {
                        title_arr += "," + "\\\"" + imglist[i].Title + "\\\"";
                        img_arr   += "," + "\\\"" + FileSerivce.GetImgUrl(imglist[i].Imgurl).Replace("/", "\\\\\\/") + "\\\"";
                        url_arr   += "," + "\\\"" + imglist[i].Linkurl.Replace("/", "\\\\\\/") + "\\\"";;
                    }
                }
            }
        }
Ejemplo n.º 10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (comid == 0)
     {
         if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
         {
             comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl));
         }
     }
 }
Ejemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //创建支付应答对象
            ResponseHandler resHandler = new ResponseHandler(Context);

            resHandler.init();

            int    comid      = 0;
            string RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();
            string u          = Request.ServerVariables["HTTP_USER_AGENT"];

            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式
            {
                //先通过正则表达式获取COMid
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
                B2b_finance_paytype modelfinance = new B2b_finance_paytypeData().GetFinancePayTypeByComid(comid);
                resHandler.setKey(modelfinance.Wx_partnerkey, modelfinance.Wx_paysignkey);
            }
            else
            {
                Response.Write("获取商家支付参数失败");
                return;
            }

            ////判断签名
            //if (resHandler.isTenpaySign())
            //{
            //    if (resHandler.isWXsign())
            //    {
            if (Request.HttpMethod.ToLower() == "post")
            {
                byte[] ar;
                ar = new byte[this.Request.InputStream.Length];

                this.Request.InputStream.Read(ar, 0, ar.Length);

                string sXML = this.Request.ContentEncoding.GetString(ar);

                //回复服务器处理成功
                string sql = "insert into wxwarning(responsexml,comid) values('" + sXML + "'," + comid + ")";
                ExcelSqlHelper.ExecuteNonQuery(sql);

                Response.Write("success");
                Response.Write("success:" + resHandler.getDebugInfo());
                //    }
                //}
                //else
                //{
                //    //sha1签名失败
                //    Response.Write("fail");
                //    Response.Write("fail:" + resHandler.getDebugInfo());
                //}
                Response.End();
            }
        }
Ejemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                //先通过正则表达式获取COMid
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
                if (comid == 0)
                {
                    comid = new WeiXinBasicData().GetWeiXinBasicByDomain(RequestUrl).Comid;
                }

                if (comid != 0)
                {
                    comName = B2bCompanyData.GetCompany(comid).Com_name;

                    B2b_company_saleset pro = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                }
            }
            else
            {
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                    if (comid != 0)
                    {
                        comName = B2bCompanyData.GetCompany(comid).Com_name;
                    }
                }
            }

            if (comid != 0)
            {
                B2b_company companyinfo = B2bCompanyData.GetCompany(comid);
                if (companyinfo != null)
                {
                    comName = companyinfo.Com_name;
                    if (comName.Length >= 9)
                    {
                        comName = comName.Substring(0, 9) + "..";
                    }
                }

                B2b_company_saleset saleset = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                if (saleset != null)
                {
                    phone = saleset.Service_Phone;
                }
            }
        }
Ejemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string u  = Request.ServerVariables["HTTP_USER_AGENT"];
            bool   bo = detectmobilebrowser.HttpUserAgent(u);

            #region 限制手机端访问
            //if (bo == false)
            //{
            //    if (comid == 101)
            //    {
            //        Response.Redirect("http://vctrip.etown.cn/");
            //    }
            //    Response.Redirect("http://shop" + comid + ".etown.cn");
            //}
            #endregion

            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                //先通过正则表达式获取COMid
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
                if (comid == 0)
                {
                    comid = new WeiXinBasicData().GetWeiXinBasicByDomain(RequestUrl).Comid;
                }
                if (comid != 0)
                {
                    title = B2bCompanyData.GetCompany(comid).Com_name;

                    B2b_company_saleset pro = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                    if (pro != null)
                    {
                        if (pro.Smalllogo != null && pro.Smalllogo != "")
                        {
                            comlogo = FileSerivce.GetImgUrl(pro.Smalllogo.ConvertTo <int>(0));
                        }
                    }

                    //获取微信平台端code
                    string weixincode = Request["code"].ConvertTo <string>("");
                    //获取微信号和一次性密码
                    openid = Request["openid"].ConvertTo <string>("");
                    string weixinpass = Request["weixinpass"].ConvertTo <string>("");

                    //获得会员信息
                    GetCrmInfo(weixincode, openid, weixinpass);
                }
            }
        }
Ejemplo n.º 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            comid = Request["comid"].ConvertTo <int>(0);


            if (comid == 0)                                 //shop101标准格式获取comid
            {
                if (Domain_def.Domain_yanzheng(RequestUrl)) //如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
                {
                    //先通过正则表达式获取COMid
                    comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
                }
            }

            if (comid == 0)//如果非标准格式,查询 是否有绑定的域名
            {
                var domaincomid = B2bCompanyData.GetComId(RequestUrl);
                if (domaincomid != null)
                {
                    comid = domaincomid.Com_id;
                }
            }


            if (comid != 0)
            {
                var commodel = B2bCompanyData.GetCompany(comid);

                if (commodel != null)
                {
                    company = commodel.Com_name;
                    if (commodel.B2bcompanyinfo != null)
                    {
                        tel = commodel.B2bcompanyinfo.Tel;
                    }
                }


                var comtDirect = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                if (comtDirect != null)
                {
                    if (comtDirect.Smalllogo != null && comtDirect.Smalllogo != "")
                    {
                        comlogo = FileSerivce.GetImgUrl(comtDirect.Smalllogo.ConvertTo <int>(0));
                    }
                }
            }
        }
Ejemplo n.º 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            come = Request["come"].ConvertTo <string>("");

            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                //先通过正则表达式获取COMid
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
            }
            if (comid == 0)//如果非标准格式,查询 是否有绑定的域名
            {
                var domaincomid = B2bCompanyData.GetComId(RequestUrl);
                if (domaincomid != null)
                {
                    comid = domaincomid.Com_id;
                }
            }
        }
Ejemplo n.º 16
0
        private void ShowImgBind()
        {
            //var comid = Context.Request["comid"].ConvertTo<int>(0);

            string RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();

            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
            }
            else
            {
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                }
            }

            if (id != 0 && comid != 0)
            {
                var actdata = new WxAdData();
                var pro     = actdata.Getwxad(id, comid);

                if (pro != null)
                {
                    id         = pro.Id;
                    Title      = pro.Title;
                    Link       = pro.Link;
                    Author     = pro.Author;
                    Keyword    = pro.Keyword;
                    Musicid    = pro.Musicid;
                    Applystate = pro.Applystate;

                    if (Musicid != 0)
                    {
                        Musicscr = FileSerivce.GetImgUrl(Musicid);
                    }
                }
            }
        }
Ejemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //string u = Request.ServerVariables["HTTP_USER_AGENT"];
            //bool bo = detectmobilebrowser.HttpUserAgent(u);
            bool bo = true;

            string RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();

            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
            }
            else
            {
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                }
            }
        }
Ejemplo n.º 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();

            //根据域名读取商户ID,如果没有绑定域名直接跳转后台
            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                //先通过正则表达式获取COMid
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
                if (comid == 0)
                {
                    comid = new WeiXinBasicData().GetWeiXinBasicByDomain(RequestUrl).Comid;
                }
            }
            else
            {
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                }
            }


            WxMaterialData wxdate = new WxMaterialData();

            aid = wxdate.FrowardingSetList(comid);
            if (aid != 0)
            {
                WxMaterial wxinfo = wxdate.GetWxMaterial(aid);
                if (wxinfo != null)
                {
                    wxTitle   = wxinfo.Title;
                    wxsummary = wxinfo.Summary;
                }
            }
        }
Ejemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            evatype   = Request["evatype"].ConvertTo <int>(0);
            channelid = Request["channelid"].ConvertTo <int>(0);

            RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();
            //根据域名读取商户ID,如果没有绑定域名直接跳转后台
            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                //先通过正则表达式获取COMid
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
                if (comid == 0)
                {
                    comid = new WeiXinBasicData().GetWeiXinBasicByDomain(RequestUrl).Comid;
                }
            }
            else
            {
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                }
            }

            if (comid != 0)
            {
                title = B2bCompanyData.GetCompany(comid).Com_name;
                B2b_company_saleset pro = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());

                if (pro != null)
                {
                    logoimg = FileSerivce.GetImgUrl(pro.Logo.ConvertTo <int>(0));
                }
            }
        }
Ejemplo n.º 20
0
        public static int GetComid(string RequestUrl)
        {
            int comid = 0;

            if (RequestUrl == "agent.maikexing.com")
            {
                comid = 1305;
            }

            if (comid == 0)
            {
                if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
                {
                    comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
                }
            }
            if (comid == 0)
            {
                //根据域名读取商户ID
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                }
            }
            if (comid == 0)
            {
                //根据绑定的管理后台域名读取商户ID
                B2b_company_info companyinfo1 = B2bCompanyData.GetComIdByAdmindomain(RequestUrl);
                if (companyinfo1 != null)
                {
                    comid = companyinfo1.Com_id;
                }
            }
            return(comid);
        }
Ejemplo n.º 21
0
        public int viewtop        = 1; //头部及左侧相关显示控制
        protected void Page_Load(object sender, EventArgs e)
        {
            Request.ValidateInput();


            if (Session["AccountId"] != null)
            {
                AccountId   = Session["AccountId"].ToString();
                AccountName = Session["AccountName"].ToString();
                AccountCard = Session["AccountCard"].ToString();
                Today       = DateTime.Now.ToString("yyyy-MM-dd");
            }

            comid      = Request["comid"].ConvertTo <int>(0);
            proid      = Request["proid"].ConvertTo <string>("");
            orderid    = Request["orderid"].ConvertTo <int>(0);
            ordertype  = Request["ordertype"].ConvertTo <string>("1");
            RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();

            if (orderid != 0)
            {
                B2bOrderData dataorder     = new B2bOrderData();
                B2b_order    modelb2border = dataorder.GetOrderById(orderid);
                if (modelb2border != null)
                {
                    proid = modelb2border.Pro_id.ToString();
                }
            }

            if (proid != "")
            {
                B2b_com_pro pro = new B2bComProData().GetProById(proid);
                if (pro != null)
                {
                    //如果是 云顶旅游大巴的 不显示头部
                    if (pro.Projectid == 2179)
                    {
                        viewtop     = 0;
                        Scenic_name = pro.Pro_name;
                        Com_name    = pro.Pro_name;
                    }

                    //绿野 不显示头部
                    if (pro.Com_id == 2553)
                    {
                        viewtop = 0;
                    }
                }
            }


            //根据域名读取商户ID,如果没有绑定域名直接跳转后台
            B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);

            if (companyinfo != null)
            {
                comid = companyinfo.Com_id;
            }
            else
            {
                //判定是否为自助域名规则安 shop1.etown.cn
                if (Domain_def.Domain_yanzheng(RequestUrl))
                {
                    comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl));
                }
            }

            //判断商户ID(域名未绑定)
            if (comid != 0)
            {
                B2b_company         com        = B2bCompanyData.GetAllComMsg(comid);
                B2b_company_saleset comsetinfo = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                if (com != null)
                {
                    if (Com_name == "")
                    {
                        Com_name = com.Com_name;
                    }
                    if (Scenic_name == "")
                    {
                        Scenic_name = com.Scenic_name;
                    }
                    Scenic_intro = com.B2bcompanyinfo.Scenic_intro;

                    if (comsetinfo != null)
                    {
                        Logourl = comsetinfo.Logo;
                        if (Logourl != "")
                        {
                            FileUploadModel url = new FileUploadData().GetFileById(int.Parse(Logourl));
                            if (url != null)
                            {
                                Logourl = "<img src=\"" + fileUrl + url.Relativepath + "\" alt=\"" + Scenic_name + "\" height=\"24\" />";
                            }
                        }

                        Service_Phone = comsetinfo.Service_Phone;
                        if (Service_Phone != "")
                        {
                            Service_Phone = "客服电话:" + Service_Phone;
                        }

                        Copyright = comsetinfo.Copyright;
                    }
                }
            }
            else
            {
                //如果没有商户ID(域名未绑定) 则跳转管理登陆页面。
                // Response.Redirect("/Manage/index1.html");
            }
        }
Ejemplo n.º 22
0
        public string comlogo = ""; //公司logo地址

        protected void Page_Load(object sender, EventArgs e)
        {
            comid      = Request["comid"].ConvertTo <int>(0);
            openid     = Request["openid"].ConvertTo <string>("");
            weixinpass = Request["weixinpass"].ConvertTo <string>("");

            RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();
            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                //先通过正则表达式获取COMid
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
                if (comid == 0)
                {
                    comid = new WeiXinBasicData().GetWeiXinBasicByDomain(RequestUrl).Comid;
                }
            }
            else
            {
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                }
            }
            if (comid != 0)
            {
                //根据公司id得到公司logo地址和公司名称
                comname = B2bCompanyData.GetCompany(comid).Com_name;
                B2b_company_saleset pro = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                if (pro != null)
                {
                    comlogo = FileSerivce.GetImgUrl(pro.Logo.ConvertTo <int>(0));
                }
            }


            if (openid != null && openid != "")
            {
                //只要传递过来微信ID 直接SESSION
                Session["Openid"] = openid;
            }



            //判断登陆状态
            if (Session["AccountId"] != null)
            {//先判断Session
                AccountId   = Session["AccountId"].ToString();
                AccountName = Session["AccountName"].ToString();
                AccountCard = Session["AccountCard"].ToString();
                Today       = DateTime.Now.ToString("yyyy-MM-dd");

                B2bCrmData dateuser = new B2bCrmData();
                dateuser.WeixinConPass(openid, comid);//只要包含SESSION登陆成功,清空微信密码
            }
            else
            {//再判断COOKIES
                if (Request.Cookies["AccountId"] != null && Request.Cookies["AccountKey"] != null)
                {
                    AccountId = Request.Cookies["AccountId"].Value;
                    string  accountmd5 = Request.Cookies["AccountKey"].Value;
                    B2b_crm userinfo;

                    var data = CrmMemberJsonData.WeixinCookieLogin(AccountId, accountmd5, comid, out userinfo);
                    if (data == "OK")
                    {
                        Session["AccountId"]   = userinfo.Id;
                        Session["AccountName"] = userinfo.Name;
                        Session["AccountCard"] = userinfo.Idcard;

                        HttpCookie cookie = new HttpCookie("AccountId", userinfo.Id.ToString());     //实例化HttpCookie类并添加值
                        cookie.Expires = DateTime.Now.AddDays(120);
                        Response.Cookies.Add(cookie);
                        cookie         = new HttpCookie("AccountName", userinfo.Name.ToString()); //实例化HttpCookie类并添加值
                        cookie.Expires = DateTime.Now.AddDays(120);
                        Response.Cookies.Add(cookie);
                        var returnmd5 = EncryptionHelper.ToMD5(userinfo.Idcard.ToString() + userinfo.Id.ToString(), "UTF-8");
                        cookie         = new HttpCookie("AccountKey", returnmd5); //实例化HttpCookie类并添加值
                        cookie.Expires = DateTime.Now.AddDays(120);
                        Response.Cookies.Add(cookie);
                        Response.Redirect(Request.Url.ToString()); //登陆成功,刷新页面
                    }
                    else
                    {
                        //如果微信ID,递实现自动登陆
                        if (openid != null && openid != "" && weixinpass != "" && weixinpass != null)
                        {
                            //只要传递过来微信ID 直接SESSION
                            Session["Openid"] = openid;

                            B2bCrmData dateuser = new B2bCrmData();

                            data = CrmMemberJsonData.WeixinLogin(openid, weixinpass, comid, out userinfo);

                            if (data == "OK")
                            {
                                dateuser.WeixinConPass(openid, comid);//登陆成功,清空微信密码
                                Session["AccountId"]   = userinfo.Id;
                                Session["AccountName"] = userinfo.Name;
                                Session["AccountCard"] = userinfo.Idcard;

                                HttpCookie cookie = new HttpCookie("AccountId", userinfo.Id.ToString());     //实例化HttpCookie类并添加值
                                cookie.Expires = DateTime.Now.AddDays(120);
                                Response.Cookies.Add(cookie);
                                cookie         = new HttpCookie("AccountName", userinfo.Name.ToString()); //实例化HttpCookie类并添加值
                                cookie.Expires = DateTime.Now.AddDays(120);
                                Response.Cookies.Add(cookie);
                                var returnmd5 = EncryptionHelper.ToMD5(userinfo.Idcard.ToString() + userinfo.Id.ToString(), "UTF-8");
                                cookie         = new HttpCookie("AccountKey", returnmd5); //实例化HttpCookie类并添加值
                                cookie.Expires = DateTime.Now.AddDays(120);
                                Response.Cookies.Add(cookie);
                                Response.Redirect(Request.Url.ToString());
                            }
                        }
                    }
                }
                else
                {  //最后判断传递过来的微信一次性密码
                    //如果微信ID,递实现自动登陆
                    if (openid != null && openid != "" && weixinpass != "" && weixinpass != null)
                    {
                        //只要传递过来微信ID 直接SESSION
                        Session["Openid"] = openid;

                        B2bCrmData dateuser = new B2bCrmData();

                        B2b_crm userinfo = new B2b_crm();
                        var     data     = CrmMemberJsonData.WeixinLogin(openid, weixinpass, comid, out userinfo);

                        if (data == "OK")
                        {
                            dateuser.WeixinConPass(openid, comid);//登陆成功,清空微信密码
                            Session["AccountId"]   = userinfo.Id;
                            Session["AccountName"] = userinfo.Name;
                            Session["AccountCard"] = userinfo.Idcard;

                            HttpCookie cookie = new HttpCookie("AccountId", userinfo.Id.ToString());     //实例化HttpCookie类并添加值
                            cookie.Expires = DateTime.Now.AddDays(120);
                            Response.Cookies.Add(cookie);
                            cookie         = new HttpCookie("AccountName", userinfo.Name.ToString()); //实例化HttpCookie类并添加值
                            cookie.Expires = DateTime.Now.AddDays(120);
                            Response.Cookies.Add(cookie);
                            var returnmd5 = EncryptionHelper.ToMD5(userinfo.Idcard.ToString() + userinfo.Id.ToString(), "UTF-8");
                            cookie         = new HttpCookie("AccountKey", returnmd5); //实例化HttpCookie类并添加值
                            cookie.Expires = DateTime.Now.AddDays(120);
                            Response.Cookies.Add(cookie);
                            Response.Redirect(Request.Url.ToString());
                        }
                    }
                }
            }
        }
Ejemplo n.º 23
0
        public string projectserviceintroduce = ""; //项目服务介绍

        protected void Page_Load(object sender, EventArgs e)
        {
            string u  = Request.ServerVariables["HTTP_USER_AGENT"];
            bool   bo = detectmobilebrowser.HttpUserAgent(u);


            if (comid == 0)
            {
                string RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();
                if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
                {
                    //先通过正则表达式获取COMid
                    comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
                    if (comid == 0)
                    {
                        comid = new WeiXinBasicData().GetWeiXinBasicByDomain(RequestUrl).Comid;
                    }
                }
                else
                {
                    B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                    if (companyinfo != null)
                    {
                        comid = companyinfo.Com_id;
                    }
                }
            }
            //根据项目id得到项目信息
            projectid = Request["id"].ConvertTo <int>(0);
            B2b_com_project mod = new B2b_com_projectData().GetProject(projectid, comid);

            if (mod != null)
            {
                projectname             = mod.Projectname;
                projectbrief            = mod.Briefintroduce;
                projectserviceintroduce = mod.Serviceintroduce;
            }



            if (comid != 0)
            {
                //if (bo == false)
                //{
                //    if (comid == 101)
                //    {
                //        Response.Redirect("http://vctrip.etown.cn/");
                //    }
                //    Response.Redirect("http://shop" + comid + ".etown.cn");
                //}
                B2b_company_info info = new B2bCompanyInfoData().GetCompanyInfo(comid);

                B2b_company com = B2bCompanyData.GetCompany(comid);
                if (com != null)
                {
                    title = com.Com_name;
                }
                if (info != null)
                {
                    article        = info.Scenic_intro;
                    merchant_intro = info.Merchant_intro;
                    if (merchant_intro == "")//如果商家介绍为空的话,赋值景区介绍
                    {
                        merchant_intro = info.Scenic_intro;
                    }
                    serviceinfo       = info.Serviceinfo;
                    Scenic_Takebus    = info.Scenic_Takebus;
                    Scenic_Drivingcar = info.Scenic_Drivingcar;
                }
            }


            if (comid != 0)
            {
                //获取微信平台端code
                string weixincode = Request["code"].ConvertTo <string>("");

                if (weixincode != "")
                {
                    int questtype = 2;//1=微信授权验证
                    DealUserinfo1("", weixincode, comid, questtype);
                }
                else
                {
                    string openid     = Request["openid"].ConvertTo <string>("");
                    string weixinpass = Request["weixinpass"].ConvertTo <string>("");
                    int    questtype  = 1;                               //1=一次性密码验证
                    DealUserinfo1(openid, weixinpass, comid, questtype); //判断用户微信号(1,点击的转发链接进来的2,点击微信菜单进来的);使用户处于登录状态(不包括点击转发链接的)
                }
            }
        }
Ejemplo n.º 24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     lock (lockobj)
     {
         string RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();
         if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式
         {
             //先通过正则表达式获取COMid
             int comid = Domain_def.Domain_Huoqu(RequestUrl).ToString().ConvertTo <int>(0);
             B2b_finance_paytype model = new B2b_finance_paytypeData().GetFinancePayTypeByComid(comid);
             if (model != null)
             {
                 //商家微信支付的所有参数都存在
                 if (model.Wx_appid != "" && model.Wx_appkey != "" && model.Wx_partnerid != "" && model.Wx_paysignkey != "")
                 {
                 }
                 else
                 {
                     model = new B2b_finance_paytypeData().GetFinancePayTypeByComid(106);
                 }
             }
             else
             {
                 model = new B2b_finance_paytypeData().GetFinancePayTypeByComid(106);
             }
             #region  把支付结果通知数据记录一下
             try
             {
                 WxPayConfig config = new WxPayConfig
                 {
                     APPID            = model.Wx_appid,
                     APPSECRET        = model.Wx_appkey,
                     KEY              = model.Wx_paysignkey,
                     MCHID            = model.Wx_partnerid,
                     IP               = CommonFunc.GetRealIP(),
                     SSLCERT_PATH     = model.wx_SSLCERT_PATH,
                     SSLCERT_PASSWORD = model.wx_SSLCERT_PASSWORD,
                     PROXY_URL        = "",
                     LOG_LEVENL       = 3, //日志级别
                     REPORT_LEVENL    = 0, //上报信息配置
                     NOTIFY_URL       = "http://shop" + comid + ".etown.cn/wxpay/backpaynotice.aspx"
                 };
                 Log.Error(this.GetType().ToString(), "进入统一下单页面");
                 ProcessNotify(config, model);
             }
             catch (Exception ex)
             {
                 Log.Error(this.GetType().ToString(), "微信支付通知意外错误(" + ex.Message + ")");
                 Response.Write("<xml><return_code>FAIL</return_code><return_msg>微信支付通知意外错误</return_msg></xml>");
                 return;
             }
             #endregion
         }
         else
         {
             Log.Error(this.GetType().ToString(), "微信支付通知参数格式错误");
             Response.Write("<xml><return_code>FAIL</return_code><return_msg>微信支付通知参数格式错误</return_msg></xml>");
             return;
         }
     }
 }
Ejemplo n.º 25
0
        public string Pro_name = ""; //产品名称

        protected void Page_Load(object sender, EventArgs e)
        {
            string u  = Request.ServerVariables["HTTP_USER_AGENT"];
            bool   bo = detectmobilebrowser.HttpUserAgent(u);

            oid     = Request["oid"].ConvertTo <int>(0);
            evatype = Request["evatype"].ConvertTo <int>(0);

            RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();
            //根据域名读取商户ID,如果没有绑定域名直接跳转后台
            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                //先通过正则表达式获取COMid
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
                if (comid == 0)
                {
                    comid = new WeiXinBasicData().GetWeiXinBasicByDomain(RequestUrl).Comid;
                }
            }
            else
            {
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                }
            }

            if (openid != null && openid != "")
            {
                //只要传递过来微信ID 直接SESSION
                Session["Openid"] = openid;
            }

            if (comid != 0)
            {
                //根据公司id得到公司logo地址和公司名称
                title = B2bCompanyData.GetCompany(comid).Com_name;
                B2b_company_saleset pro = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());

                if (pro != null)
                {
                    logoimg = FileSerivce.GetImgUrl(pro.Logo.ConvertTo <int>(0));
                }


                //获取微信平台端code
                weixincode = Request["code"].ConvertTo <string>("");
                openid     = Request["openid"].ConvertTo <string>("");
                weixinpass = Request["weixinpass"].ConvertTo <string>("");

                GetMemberCard(openid, weixincode, weixinpass, comid);//登陆或得到会员信息


                //最后判断登陆
                if (AccountId == 0)
                {
                    Response.Redirect("/h5/order/login.aspx");
                }

                //读取订单
                var orderdata = new B2bOrderData();
                var orderinfo = orderdata.GetOrderById(oid);
                if (orderinfo != null)
                {
                    var prodata = new B2bComProData();
                    var proinfo = prodata.GetProById(orderinfo.Pro_id.ToString(), orderinfo.Speciid, orderinfo.channelcoachid);
                    if (proinfo != null)
                    {
                        Pro_name = proinfo.Pro_name;
                        if (evatype == 1)
                        {
                            Pro_name = "教练为用户提交教学档案:" + Pro_name + " 预约时间:" + orderinfo.U_traveldate.ToString("yyyy-MM-dd HH:mm");
                        }
                    }


                    uid       = orderinfo.U_id;
                    channelid = orderinfo.channelcoachid;
                }


                //权限不匹配 跳转会员登陆页面
                if (evatype == 0)
                {
                    //if (AccountId != uid)
                    //{
                    //    Response.Redirect("/h5/order/login.aspx");
                    //}
                }
                else  //如果是 教练评价 客户
                      //查询渠道是否匹配,可能遇到不针对教练预约 ,暂时不做判定,这样 出现所有教练都有可能对客户进行评价,未指定教练,如何评价



                {
                }
            }
        }
Ejemplo n.º 26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["AccountId"] != null)
            {
                AccountId   = Session["AccountId"].ToString();
                AccountName = Session["AccountName"].ToString();
                AccountCard = Session["AccountCard"].ToString();
                Today       = DateTime.Now.ToString("yyyy-MM-dd");
            }

            comid      = Request["comid"].ConvertTo <int>(0);
            proid      = Request["proid"].ConvertTo <string>("");
            orderid    = Request["orderid"].ConvertTo <int>(0);
            ordertype  = Request["ordertype"].ConvertTo <string>("1");
            RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();
            if (Request.QueryString["out_trade_no"] != null)
            {
                orderid = Request.QueryString["out_trade_no"].ConvertTo <int>(0);
                //根据订单id得到订单信息
                B2bOrderData dataorder     = new B2bOrderData();
                B2b_order    modelb2border = dataorder.GetOrderById(orderid);
                proid = modelb2border.Pro_id.ToString();
            }


            //读产品信息
            if (proid != "")
            {
                //根据产品id得到产品信息
                B2bComProData datapro     = new B2bComProData();
                B2b_com_pro   modelcompro = datapro.GetProById(proid);

                if (modelcompro != null)
                {
                    proname = modelcompro.Pro_name;
                    comid   = modelcompro.Com_id;
                }
            }

            //针对支付同步返回页,暂时无法绑定域名
            if (Request.QueryString["out_trade_no"] == null)
            {
                //根据域名读取商户ID,如果没有绑定域名直接跳转后台
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                }
                else
                {
                    //判定是否为自助域名规则安 shop1.etown.cn
                    if (Domain_def.Domain_yanzheng(RequestUrl))
                    {
                        comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl));
                    }
                    else
                    {
                        if (RequestUrl == "shop.etown.cn" || RequestUrl == "test.etown.cn" || RequestUrl == "admin.etown.cn" || RequestUrl == "admin.vctrip.com")
                        {
                            Response.Redirect("/Manage/index1.html");
                        }
                        else
                        {
                            Response.Redirect("/admin/");
                        }
                    }
                }
            }



            //判断商户ID(域名未绑定)
            if (comid != 0)
            {
                B2b_company         com        = B2bCompanyData.GetAllComMsg(comid);
                B2b_company_saleset comsetinfo = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                if (com != null)
                {
                    Com_name     = com.Com_name;
                    Scenic_name  = com.Scenic_name;
                    Scenic_intro = com.B2bcompanyinfo.Scenic_intro;

                    if (comsetinfo != null)
                    {
                        if (comsetinfo.Logo != "")
                        {
                            FileUploadModel comlogo = new FileUploadData().GetFileById(int.Parse(comsetinfo.Logo));
                            if (comlogo != null)
                            {
                                Logourl = "<img src=\"" + fileUrl + comlogo.Relativepath + "\" alt=\"" + Scenic_name + "\" height=\"80\"  id=\"imglogo\" />";
                            }
                        }
                        else
                        {
                            Logourl = "";
                        }

                        Service_Phone = comsetinfo.Service_Phone;
                        if (Service_Phone != "")
                        {
                            Service_Phone = "客服电话:" + Service_Phone;
                        }

                        Copyright = comsetinfo.Copyright;
                    }
                }
            }
            else
            {
                //如果没有商户ID(域名未绑定) 则跳转管理登陆页面。
                Response.Redirect("/Manage/index1.html");
            }
        }
Ejemplo n.º 27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string u  = Request.ServerVariables["HTTP_USER_AGENT"];
            bool   bo = detectmobilebrowser.HttpUserAgent(u);


            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl));
            }

            if (comid == 0)//如果非标准格式,查询 是否有绑定的域名
            {
                var domaincomid = B2bCompanyData.GetComId(RequestUrl);
                if (domaincomid != null)
                {
                    comid = domaincomid.Com_id;
                }
            }

            if (comid != 0)
            {
                var commodel = B2bCompanyData.GetCompany(comid);

                if (commodel != null)
                {
                    title = commodel.Com_name;
                }
            }


            //从cookie中得到微信号
            if (Request.Cookies["openid"] != null)
            {
                openid = Request.Cookies["openid"].Value;
            }
            if (Request.Cookies["AccountId"] != null)
            {
                AccountId = int.Parse(Request.Cookies["AccountId"].Value);
            }



            //获取微信平台端code
            string weixincode = Request["code"].ConvertTo <string>("");

            openid = Request["openid"].ConvertTo <string>("");
            string weixinpass = Request["weixinpass"].ConvertTo <string>("");

            startime = DateTime.Now.ToString("yyyy-MM-dd");
            viewtype = Request["type"].ConvertTo <int>(0);



            GetMemberCard(openid, weixincode, weixinpass, comid);//登陆或得到会员信息



            //最后判断登陆
            if (AccountId == 0)
            {
                Response.Redirect("/h5/order/login.aspx?come=/h5/order/Coachappointment.aspx");//非手机的跳转到V目录
            }

            if (channelid != 0)
            {
                var jiaolianorderdata = new B2bOrderData().channelcoachOrderPageList(comid.ToString(), channelid);
                if (jiaolianorderdata != null)
                {
                    for (int i = 0; i < jiaolianorderdata.Count; i++)
                    {
                        datelist += jiaolianorderdata[i].Address + ",";
                        numlist  += jiaolianorderdata[i].U_num + ",";
                    }
                    if (datelist != "")
                    {
                        datelist = datelist.Substring(0, datelist.Length - 1);
                    }
                    if (numlist != "")
                    {
                        numlist = numlist.Substring(0, numlist.Length - 1);
                    }
                }
            }
        }
Ejemplo n.º 28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Request.ValidateInput();
            string u = Request.ServerVariables["HTTP_USER_AGENT"];

            //bool bo = detectmobilebrowser.HttpUserAgent(u);
            proclass = Request["proclass"].ConvertTo <int>(0);

            uid = Request["uid"].ConvertTo <int>(0);
            //获取IP地址
            uip = CommonFunc.GetRealIP();

            buyuid    = Request["buyuid"].ConvertTo <int>(0);
            tocomid   = Request["tocomid"].ConvertTo <int>(0);
            projectid = Request["id"].ConvertTo <int>(0);

            pno = Request["pno"].ConvertTo <string>("");

            string pno1 = EncryptionHelper.EticketPnoDES(pno, 1);//解密

            var B2bEticketdata = new B2bEticketData();
            var eticketinfo    = B2bEticketdata.GetEticketDetail(pno1);

            if (eticketinfo != null)
            {
                comid     = eticketinfo.Com_id;
                usepnonum = eticketinfo.Use_pnum;
            }


            if (comid == 0)
            {
                if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
                {
                    comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl));
                }
                else
                {
                    B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                    if (companyinfo != null)
                    {
                        comid = companyinfo.Com_id;
                    }
                }
            }

            //微信转发访问归属渠道
            if (uid != 0)//必须记录转发用户信息才能继续统计
            {
                //判断有转发人的渠道
                var    crmdata       = new B2bCrmData();
                var    pro           = crmdata.Readuser(uid, comid);//读取转发人用户信息
                string zhuanfa_phone = "";
                if (pro != null)
                {
                    zhuanfa_phone = pro.Phone;
                }

                if (zhuanfa_phone != "")
                {                                                                                  //转发人手机存在
                    MemberChannelData channeldata = new MemberChannelData();
                    var channeinfo = channeldata.GetPhoneComIdChannelDetail(zhuanfa_phone, comid); //查询渠道
                    if (channeinfo != null)
                    {
                        //转发人渠道记录COOKI
                        HttpCookie cookie = new HttpCookie("ZF_ChanneId");     //实例化HttpCookie类并添加值
                        cookie.Value   = channeinfo.Id.ToString();
                        cookie.Expires = DateTime.Now.AddDays(120);
                        Response.Cookies.Add(cookie);
                    }
                }
            }


            //根据项目id得到项目信息
            if (projectid != 0)
            {
                B2b_com_project mod = new B2b_com_projectData().GetProject(projectid, comid);
                if (mod != null)
                {
                    projectname   = mod.Projectname;
                    projectimgurl = FileSerivce.GetImgUrl(mod.Projectimg);
                    projectbrief  = mod.Briefintroduce;
                }


                B2bComProData prodata1 = new B2bComProData();
                var           prohotel = prodata1.Selectpro_hotel(comid, projectid);
                if (prohotel == 1)
                {
                    // Response.Redirect("hotel/hotelshow.aspx?projectid=" + projectid + "&id=" + comid + "&uid =" + uid + "&buyuid=" + buyuid + "&tocomid=" + tocomid + " ");
                }
            }


            if (comid != 0)
            {
                B2b_company companyinfo = B2bCompanyData.GetCompany(comid);

                B2bCompanyInfoData info = new B2bCompanyInfoData();
                if (companyinfo != null)
                {
                    comName = companyinfo.Com_name;
                    if (comName.Length >= 9)
                    {
                        comName = comName.Substring(0, 9) + "..";
                    }

                    remark = info.GetCompanyInfo(comid).Scenic_intro + "&nbsp;&nbsp;<a style=\"color:#1a9ed9\" href=\"OrderinfoTitle.aspx?id=" + comid + "\">(查看全部)</a>";
                    if (remark.Length > 42)
                    {
                        remark = remark.Substring(0, 42) + "&nbsp;&nbsp;<a style=\"color:#1a9ed9\" href=\"OrderinfoTitle.aspx?id=" + comid + "\">(查看全部)</a>";
                    }


                    if (companyinfo.B2bcompanyinfo != null)
                    {
                        Wxfocus_url    = companyinfo.B2bcompanyinfo.Wxfocus_url;
                        Wxfocus_author = companyinfo.B2bcompanyinfo.Wxfocus_author;;
                    }
                }

                B2b_company_saleset saleset = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                if (saleset != null)
                {
                    if (saleset.Smalllogo != null && saleset.Smalllogo != "")
                    {
                        headPortraitImgSrc = FileSerivce.GetImgUrl(saleset.Smalllogo.ConvertTo <int>(0));
                    }
                }
            }


            //------------------------------新添加代码(主要目的就是获取微信号使用户处于登录状态以及判断用户转发时引发的微信号混乱问题)===========================

            string weixincode = Request["code"].ConvertTo <string>("");

            if (weixincode == "")//未认证微信
            {
                openid     = Request["openid"].ConvertTo <string>("");
                weixinpass = Request["weixinpass"].ConvertTo <string>("");
                int questtype = 1;                                   //1=一次性密码验证
                DealUserinfo1(openid, weixinpass, comid, questtype); //判断用户微信号(1,点击的转发链接进来的2,点击微信菜单进来的);使用户处于登录状态(不包括点击转发链接的)
            }
            else//已认证微信

            {
                int questtype = 2;                               //1=微信授权验证
                DealUserinfo1("", weixincode, comid, questtype); //获取微信号;使用户处于登录状态
            }
        }
Ejemplo n.º 29
0
        public string userid  = "0";//用户临时 Uid 或 实际Uid



        public void Page_Load(object sender, EventArgs e)
        {
            string u  = Request.ServerVariables["HTTP_USER_AGENT"];
            bool   bo = detectmobilebrowser.HttpUserAgent(u);

            uid = Request["uid"].ConvertTo <int>(0);
            //获取IP地址
            uip = CommonFunc.GetRealIP();

            key = Request["key"].ConvertTo <string>("");

            if (key != "")
            {
                biaoti = key;
            }

            proclass = Request["class"].ConvertTo <int>(0);
            price    = Request["price"].ConvertTo <int>(0);

            //获取随机用户ID
            if (Request.Cookies["temp_userid"] != null)
            {
                userid = Request.Cookies["temp_userid"].Value;
            }
            else
            {
                userid = Domain_def.HuoQu_Temp_UserId();
                //Response.Cookies("userid").val();

                HttpCookie cookie = new HttpCookie("temp_userid");     //实例化HttpCookie类并添加值
                cookie.Value   = userid;
                cookie.Expires = DateTime.Now.AddDays(365);
                Response.Cookies.Add(cookie);
            }



            if (proclass != 0)
            {
                var prodata = new B2bComProData();
                var result  = prodata.Proclassbyid(proclass);
                if (result != null)
                {
                    biaoti = result.Classname;
                }
            }



            buyuid  = Request["buyuid"].ConvertTo <int>(0);
            tocomid = Request["tocomid"].ConvertTo <int>(0);


            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                //先通过正则表达式获取COMid
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
            }
            if (comid == 0)//如果非标准格式,查询 是否有绑定的域名
            {
                var domaincomid = B2bCompanyData.GetComId(RequestUrl);
                if (domaincomid != null)
                {
                    comid = domaincomid.Com_id;
                }
            }


            if (comid != 0)
            {
                var commodel = B2bCompanyData.GetCompany(comid);

                if (commodel != null)
                {
                    if (commodel.B2bcompanyinfo != null)
                    {
                        Wxfocus_url    = commodel.B2bcompanyinfo.Wxfocus_url;
                        Wxfocus_author = commodel.B2bcompanyinfo.Wxfocus_author;
                        weixinname     = commodel.B2bcompanyinfo.Weixinname;
                        Scenic_intro   = commodel.B2bcompanyinfo.Scenic_intro;
                    }

                    title = commodel.Com_name;
                }


                B2b_company_saleset pro = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                if (pro != null)
                {
                    if (pro.Smalllogo != null && pro.Smalllogo != "")
                    {
                        comlogo = FileSerivce.GetImgUrl(pro.Smalllogo.ConvertTo <int>(0));
                    }
                }

                //获取微信平台端code
                string weixincode = Request["code"].ConvertTo <string>("");
                //获取微信号和一次性密码
                openid = Request["openid"].ConvertTo <string>("");
                string weixinpass = Request["weixinpass"].ConvertTo <string>("");

                //获得会员信息
                GetCrmInfo(weixincode, openid, weixinpass);
            }



            //获取BANNER,及logo
            if (comid != 0)
            {
                var imagedata  = new B2bCompanyImageData();
                int totalcount = 0;
                List <B2b_company_image> list = imagedata.PageGetimageList(comid, 2, out totalcount);

                if (list != null)
                {
                    for (int i = 0; i < totalcount; i++)
                    {
                        bannerimg   = FileSerivce.GetImgUrl(list[i].Imgurl);
                        bannerlink  = list[i].Linkurl;
                        bannertitle = list[i].Title;
                    }
                }

                //根据公司id得到 直销设置
                B2b_company_saleset saleset = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                if (saleset != null)
                {
                    logoimg = FileSerivce.GetImgUrl(saleset.Smalllogo.ConvertTo <int>(0));
                }


                //读取首页栏目,只读取前10个栏目,太多影响打开
                var shopmenudata = new B2bCompanyMenuData();
                menulist = shopmenudata.GetMenuList(comid, 1, 10, out menutotalcount, 1);
                if (menulist != null)
                {
                    for (int i = 0; i < menutotalcount; i++)
                    {
                        menulist[i].Imgurl_address = FileSerivce.GetImgUrl(menulist[i].Imgurl);
                    }
                }
            }



            //微信转发访问归属渠道
            if (uid != 0)//必须记录转发用户信息才能继续统计
            {
                //判断有转发人的渠道
                var    crmdata       = new B2bCrmData();
                var    pro           = crmdata.Readuser(uid, comid);//读取转发人用户信息
                string zhuanfa_phone = "";
                if (pro != null)
                {
                    zhuanfa_phone = pro.Phone;
                }

                if (zhuanfa_phone != "")
                {                                                                                  //转发人手机存在
                    MemberChannelData channeldata = new MemberChannelData();
                    var channeinfo = channeldata.GetPhoneComIdChannelDetail(zhuanfa_phone, comid); //查询渠道
                    if (channeinfo != null)
                    {
                        //转发人渠道记录COOKI
                        HttpCookie cookie = new HttpCookie("ZF_ChanneId");     //实例化HttpCookie类并添加值
                        cookie.Value   = channeinfo.Id.ToString();
                        cookie.Expires = DateTime.Now.AddDays(120);
                        Response.Cookies.Add(cookie);
                    }
                }
            }
        }
Ejemplo n.º 30
0
        public void Page_Load(object sender, EventArgs e)
        {
            string u  = Request.ServerVariables["HTTP_USER_AGENT"];
            bool   bo = detectmobilebrowser.HttpUserAgent(u);

            id = Request["id"].ConvertTo <int>(0);
            string md5 = Request["md5"].ConvertTo <string>("");

            string Returnmd5 = EncryptionHelper.ToMD5(id.ToString() + "lixh1210", "UTF-8");


            var orderdata = new B2bOrderData();
            var orderinfo = orderdata.GetOrderById(id);

            if (orderinfo != null)
            {
                u_name = orderinfo.U_name;

                //判断登陆状态
                //if (Session["AccountId"] != null)
                //{
                //先判断Session
                //int AccountId = int.Parse(Session["AccountId"].ToString());

                if (Returnmd5 == md5)       //必须符合加密的才能打开
                {
                    yuyuetime = orderinfo.U_traveldate.ToString("yyyy-MM-dd hh:mm:ss");
                    var prodata = new B2bComProData();
                    var proinfo = prodata.GetProById(orderinfo.Pro_id.ToString());
                    if (proinfo != null)
                    {
                        Pro_name  = proinfo.Pro_name;
                        bindiname = proinfo.bookpro_bindname;
                        bindphone = proinfo.bookpro_bindphone;

                        var managedata = new B2bCompanyManagerUserData();
                        var manageinfo = managedata.GetCompanyUserByPhone(bindphone, proinfo.Com_id);
                        if (manageinfo != null)
                        {
                            bindimg = FileSerivce.GetImgUrl(manageinfo.Headimg);
                        }
                    }
                }
                //}
            }



            uid = Request["uid"].ConvertTo <int>(0);
            //获取IP地址
            uip = CommonFunc.GetRealIP();

            key = Request["key"].ConvertTo <string>("");

            if (key != "")
            {
                biaoti = key;
            }

            proclass = Request["class"].ConvertTo <int>(0);
            price    = Request["price"].ConvertTo <int>(0);



            if (proclass != 0)
            {
                var prodata = new B2bComProData();
                var result  = prodata.Proclassbyid(proclass);
                if (result != null)
                {
                    biaoti = result.Classname;
                }
            }

            //获取随机用户ID
            if (Request.Cookies["temp_userid"] != null)
            {
                userid = Request.Cookies["temp_userid"].Value;
            }
            else
            {
                userid = Domain_def.HuoQu_Temp_UserId();
                //Response.Cookies("userid").val();

                HttpCookie cookie = new HttpCookie("temp_userid");     //实例化HttpCookie类并添加值
                cookie.Value   = userid;
                cookie.Expires = DateTime.Now.AddDays(365);
                Response.Cookies.Add(cookie);
            }

            buyuid  = Request["buyuid"].ConvertTo <int>(0);
            tocomid = Request["tocomid"].ConvertTo <int>(0);


            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                //先通过正则表达式获取COMid
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
            }
            if (comid == 0)//如果非标准格式,查询 是否有绑定的域名
            {
                var domaincomid = B2bCompanyData.GetComId(RequestUrl);
                if (domaincomid != null)
                {
                    comid = domaincomid.Com_id;
                }
            }



            if (comid != 0)
            {
                //根据产品判断商家是否含有自己的微信支付:a.含有的话支付到商家;b.没有的话支付到平台的微信公众号账户中
                B2b_finance_paytype model = new B2b_finance_paytypeData().GetFinancePayTypeByComid(comid);
                //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "b");
                if (model != null)
                {
                    //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "c");
                    //商家微信支付的所有参数都存在
                    if (model.Wx_appid != "" && model.Wx_appkey != "" && model.Wx_partnerid != "" && model.Wx_paysignkey != "")
                    {
                        //appId = model.Wx_appid;
                        //appsecret = model.Wx_appkey;
                        //appkey = model.Wx_paysignkey;
                        //mchid = model.Wx_partnerid;
                        //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "d");
                        issetfinancepaytype = true;
                    }
                }


                var commodel = B2bCompanyData.GetCompany(comid);

                if (commodel != null)
                {
                    if (commodel.B2bcompanyinfo != null)
                    {
                        Wxfocus_url    = commodel.B2bcompanyinfo.Wxfocus_url;
                        Wxfocus_author = commodel.B2bcompanyinfo.Wxfocus_author;;
                        weixinname     = commodel.B2bcompanyinfo.Weixinname;
                        Scenic_intro   = commodel.B2bcompanyinfo.Scenic_intro;
                    }

                    title = commodel.Com_name;
                }


                B2b_company_saleset pro = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                if (pro != null)
                {
                    if (pro.Smalllogo != null && pro.Smalllogo != "")
                    {
                        comlogo = FileSerivce.GetImgUrl(pro.Smalllogo.ConvertTo <int>(0));
                    }
                }

                //获取微信平台端code
                string weixincode = Request["code"].ConvertTo <string>("");
                //获取微信号和一次性密码
                openid = Request["openid"].ConvertTo <string>("");
                string weixinpass = Request["weixinpass"].ConvertTo <string>("");

                //获得会员信息
                GetCrmInfo(weixincode, openid, weixinpass);
            }


            //获取BANNER,及logo
            if (comid != 0)
            {
                //根据公司id得到 直销设置
                B2b_company_saleset saleset = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                if (saleset != null)
                {
                    logoimg = FileSerivce.GetImgUrl(saleset.Smalllogo.ConvertTo <int>(0));
                }
            }



            //微信转发访问归属渠道
            if (uid != 0)//必须记录转发用户信息才能继续统计
            {
                //判断有转发人的渠道
                var    crmdata       = new B2bCrmData();
                var    pro           = crmdata.Readuser(uid, comid);//读取转发人用户信息
                string zhuanfa_phone = "";
                if (pro != null)
                {
                    zhuanfa_phone = pro.Phone;
                }

                if (zhuanfa_phone != "")
                {                                                                                  //转发人手机存在
                    MemberChannelData channeldata = new MemberChannelData();
                    var channeinfo = channeldata.GetPhoneComIdChannelDetail(zhuanfa_phone, comid); //查询渠道
                    if (channeinfo != null)
                    {
                        //转发人渠道记录COOKI
                        HttpCookie cookie = new HttpCookie("ZF_ChanneId");     //实例化HttpCookie类并添加值
                        cookie.Value   = channeinfo.Id.ToString();
                        cookie.Expires = DateTime.Now.AddDays(120);
                        Response.Cookies.Add(cookie);
                    }
                }
            }
        }