Пример #1
0
        public static string AgentLoginCom(int userid, int comid)
        {
            string message = "";

            B2b_company company = B2bCompanyData.GetCompany(comid);//根据公司id得到公司信息

            if (company == null)
            {
                message = "商家null";
                return(JsonConvert.SerializeObject(new { type = 1, msg = message }));
            }
            else
            {
                if (company.Com_state == (int)CompanyStatus.InBusiness)
                {
                }
                else
                {
                    message = "商家状态不正确";
                    return(JsonConvert.SerializeObject(new { type = 1, msg = message }));
                }
            }

            UserHelper.SetCookie(userid);
            return(JsonConvert.SerializeObject(new { type = 100, msg = "" }));
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["AccountId"] != null)
            {
                RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                }
            }

            if (comid == 101)
            {
                Session["AccountId"]   = null;
                Session["AccountName"] = null;
                Session["AccountCard"] = null;
                Response.Redirect("http://vctrip.etown.cn");
            }
            else
            {
                Session["AccountId"]   = null;
                Session["AccountName"] = null;
                Session["AccountCard"] = null;
                Response.Redirect("/ui/shangjiaui/ProductList.aspx");
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            comid_temp = Request["comid"].ConvertTo <int>(0);

            B2b_company companyinfo = B2bCompanyData.GetAllComMsg(comid_temp);

            if (companyinfo != null)
            {
                company = companyinfo.Com_name;
            }



            if (Session["Agentid"] != null)
            {
                //账户信息
                Agentid = Int32.Parse(Session["Agentid"].ToString());
                Account = Session["Account"].ToString();

                Agent_company agenginfo = AgentCompanyData.GetAgentWarrant(Agentid, comid_temp);
                if (agenginfo != null)
                {
                    yufukuan     = "您预付款:" + agenginfo.Imprest + " 元";
                    Warrant_type = agenginfo.Warrant_type;
                }
            }
        }
Пример #4
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目录
            }
        }
Пример #5
0
        public static string Masterpagelist(string employstate, int pageindex, int pagesize, string groupid, int childcomid, string key = "")
        {
            var totalcount = 0;

            try
            {
                var         list   = new B2bCompanyManagerUserData().Masterpagelist(employstate, pageindex, pagesize, groupid, childcomid, out totalcount, key);
                IEnumerable result = "";
                if (list != null)
                {
                    result = from model in list
                             select new
                    {
                        Accounts           = model.Accounts,
                        PassWord           = model.Passwords,
                        MasterId           = model.Id,
                        MasterName         = model.Employeename,
                        CompanyName        = B2bCompanyData.GetCompanyByUid(model.Id).Com_name,
                        Tel                = model.Tel,
                        GroupName          = new Sys_MasterGroupData().GetGroupNameStrByMasterId(model.Id),
                        ChannelCompanyName = model.Channelcompanyid == null || model.Channelcompanyid == 0 ? "--" : new MemberChannelcompanyData().GetCompanyById(int.Parse(model.Channelcompanyid.ToString())) == null ? "--" : new MemberChannelcompanyData().GetCompanyById(int.Parse(model.Channelcompanyid.ToString())).Companyname,
                        Employeestate      = model.Employeestate
                    }
                }
                ;

                return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result }));
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));

                throw;
            }
        }
Пример #6
0
        public static string MasterpagelistByComId(int pageindex, int pagesize, string comid, int userid)
        {
            var totalcount = 0;

            try
            {
                var         list   = new B2bCompanyManagerUserData().Manageuserpagelist(comid, pageindex, pagesize, out totalcount, userid);
                IEnumerable result = "";
                if (list != null)
                {
                    result = from model in list
                             select new
                    {
                        Accounts    = model.Accounts,
                        PassWord    = model.Passwords,
                        MasterId    = model.Id,
                        MasterName  = model.Employeename,
                        CompanyName = B2bCompanyData.GetCompanyByUid(model.Id).Com_name,
                        Tel         = model.Tel,
                        GroupName   = new Sys_MasterGroupData().GetGroupNameStrByMasterId(model.Id)
                    }
                }
                ;

                return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result }));
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));

                throw;
            }
        }
Пример #7
0
        /// <summary>
        /// 用户登录
        /// </summary>
        public static bool Entry(string username, string password, out string message, out int userId)
        {
            userId = 0;
            var msg = "";
            B2b_company_manageuser user = B2bCompanyManagerUserData.VerifyUser(username, password, out msg);

            if (user == null)
            {
                message = msg;
                return(false);
            }


            userId = user.Id;
            B2b_company company = B2bCompanyData.GetCompany(user.Com_id);//根据公司id得到公司信息

            if (company == null)
            {
                message = "商家null";
                return(false);
            }
            else
            {
                if (company.Com_state == (int)CompanyStatus.InBusiness)
                {
                    message = "";
                    return(true);
                }
                else
                {
                    message = "商家状态不正确";
                    return(false);
                }
            }
        }
Пример #8
0
        public string contact_phone      = ""; //联系人电话
        protected void Page_Load(object sender, EventArgs e)
        {
            comid_temp = Request["comid"].ConvertTo <int>(0);
            projectid  = Request["projectid"].ConvertTo <int>(0);

            B2b_company companyinfo = B2bCompanyData.GetAllComMsg(comid_temp);

            if (companyinfo != null)
            {
                company       = companyinfo.Com_name;
                contact_phone = companyinfo.B2bcompanyinfo == null ? "" : companyinfo.B2bcompanyinfo.Tel;
            }

            if (projectid != 0)
            {
                B2b_com_projectData projectdata = new B2b_com_projectData();
                var projectinfo = projectdata.GetProject(projectid, comid_temp);
                if (projectinfo != null)
                {
                    projectname = projectinfo.Projectname + ": ";
                }
            }

            ishaslvyoubusproorder = new B2bOrderData().IsHasLvyoubusProOrder(comid_temp, (int)ProductServer_Type.LvyouBus);



            if (Session["Agentid"] != null)
            {
                //账户信息
                Agentid = Int32.Parse(Session["Agentid"].ToString());
                Account = Session["Account"].ToString();
            }
        }
Пример #9
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;
                    }
                }
            }
        }
Пример #10
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,点击微信菜单进来的);使用户处于登录状态(不包括点击转发链接的)
            }
        }
Пример #11
0
        public static string ChannelFPageList(string comid, int pageindex, int pagesize, string key, int channelcomid)
        {
            var totalcount = 0;

            if (channelcomid == 0)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = "传递参数错误" }));
            }

            try
            {
                var financedata = new B2bFinanceData();
                var orderdata   = new B2bOrderData();
                var channeldata = new MemberChannelcompanyData();


                var         list   = financedata.FinancePageList(comid, pageindex, pagesize, key, out totalcount, channelcomid);
                IEnumerable result = "";
                if (list != null)
                {
                    result = from finance in list
                             select new
                    {
                        Id                = finance.Id,
                        Com_id            = finance.Com_id,
                        ComName           = B2bCompanyData.GetCompany(finance.Com_id).Com_name,
                        Agent_id          = finance.Agent_id,
                        Eid               = finance.Eid,
                        Order_id          = finance.Order_id,
                        Servicesname      = finance.Servicesname,
                        ShortServicesname = finance.Servicesname.Length > 15 ? finance.Servicesname.Substring(0, 15) + "." : finance.Servicesname,
                        SerialNumber      = finance.SerialNumber,
                        Money             = finance.Money,
                        Money_come        = finance.Money_come,
                        Over_money        = finance.Over_money,
                        Payment           = finance.Payment,
                        Payment_type      = finance.Payment_type,
                        Subdate           = finance.Subdate,
                        Con_state         = finance.Con_state,
                        Remarks           = finance.Remarks,
                        PrintscreenUrl    = new FileUploadData().GetFileById(finance.Printscreen.ToString().ConvertTo <int>(0)) == null ? "" : new FileUploadData().GetFileById(finance.Printscreen.ToString().ConvertTo <int>(0)).Relativepath,
                        Pno               = orderdata.GetPnoByOrderId(finance.Order_id),
                        Channelid         = finance.Channelid,
                        ChannelName       = channeldata.GetChannelCompanyNameById(finance.Channelid),
                        Paychannelstate   = finance.Paychannelstate
                    }
                }
                ;

                return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result }));
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));

                throw;
            }
        }
Пример #12
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");
                    }
                }
            }
        }
Пример #13
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,点击微信菜单进来的);使用户处于登录状态(不包括点击转发链接的)
            }
        }
Пример #14
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
        }
Пример #15
0
        public string Servermobile = ""; //服务专员手机


        protected void Page_Load(object sender, EventArgs e)
        {
            openid     = Request["openid"];
            weixinpass = Request["weixinpass"];

            //如果SESSION有值,进行赋值
            if (openid != "" && Session["Openid"] != null)
            {
                openid = Session["Openid"].ToString();
            }



            //获得商户ID
            RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();
            B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);

            if (companyinfo != null)
            {
                comid             = companyinfo.Com_id;
                Session["Com_id"] = comid;
            }


            //已登录直接跳转
            if (Session["AccountId"] != null)
            {
                AccountId = Int32.Parse(Session["AccountId"].ToString());
                B2bCrmData dateuser1 = new B2bCrmData();
                B2b_crm    modeluser = dateuser1.Readuser(AccountId, comid);

                if (modeluser != null)
                {
                    AccountWeixin = modeluser.Weixin;
                    AccountEmail  = modeluser.Email;
                    Accountphone  = modeluser.Phone;
                    AccountName   = modeluser.Name;
                    AccountCard   = modeluser.Idcard.ToString();
                    Servercard    = modeluser.Servercard;
                    Integral      = modeluser.Integral;
                    Imprest       = modeluser.Imprest;
                }

                //服务专员信息,服务专员ID
                if (Servercard != 0)
                {
                    MemberChannelData channeldate  = new MemberChannelData();
                    Member_Channel    channelmode2 = channeldate.GetChannelDetail(Int32.Parse(Servercard.ToString()));
                    if (channelmode2 != null)
                    {
                        Servername   = channelmode2.Name;
                        Servermobile = channelmode2.Mobile;
                    }
                }
            }
        }
Пример #16
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>";
            }
        }
Пример #17
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
        }
Пример #18
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("/", "\\\\\\/") + "\\\"";;
                    }
                }
            }
        }
Пример #19
0
        public string contact_phone      = ""; //联系人电话
        protected void Page_Load(object sender, EventArgs e)
        {
            comid_temp = Request["comid"].ConvertTo <int>(0);
            projectid  = Request["projectid"].ConvertTo <int>(0);

            B2b_company companyinfo = B2bCompanyData.GetAllComMsg(comid_temp);

            if (companyinfo != null)
            {
                company       = companyinfo.Com_name;
                contact_phone = companyinfo.B2bcompanyinfo == null ? "" : companyinfo.B2bcompanyinfo.Tel;
            }

            if (projectid != 0)
            {
                B2b_com_projectData projectdata = new B2b_com_projectData();
                var projectinfo = projectdata.GetProject(projectid, comid_temp);
                if (projectinfo != null)
                {
                    projectname = projectinfo.Projectname + ": ";
                }
            }

            // ishaslvyoubusproorder = new B2bOrderData().IsHasLvyoubusProOrder(comid_temp, (int)ProductServer_Type.LvyouBus);



            if (Session["Agentid"] != null)
            {
                //账户信息
                Agentid = Int32.Parse(Session["Agentid"].ToString());
                Account = Session["Account"].ToString();



                Agent_company agenginfo = AgentCompanyData.GetAgentWarrant(Agentid, comid_temp);
                if (agenginfo != null)
                {
                    yufukuan     = "您预付款:" + agenginfo.Imprest.ToString("0.00") + " 元";
                    Warrant_type = agenginfo.Warrant_type;
                    if (Warrant_type == 1)
                    {
                        Warrant_type_str = "销售扣款";
                    }
                    if (Warrant_type == 2)
                    {
                        Warrant_type_str = "验证扣款";
                    }
                }
                else
                {
                    Response.Redirect("/Agent/Default.aspx");
                }
            }
        }
Пример #20
0
        public int comid         = 0;  //公司id

        protected void Page_Load(object sender, EventArgs e)
        {
            RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();
            //根据域名读取商户ID,如果没有绑定域名直接跳转后台
            B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);

            if (companyinfo != null)
            {
                comid = companyinfo.Com_id;
            }
        }
Пример #21
0
        public static string ComFinancePageList(string comid, int pageindex, int pagesize, string key, int oid = 0, string payment_type = "", string money_come = "", string starttime = "", string endtime = "")
        {
            var totalcount = 0;

            try
            {
                var financedata = new B2bFinanceData();
                var orderdata   = new B2bOrderData();
                var channeldata = new MemberChannelcompanyData();

                B2bPayData  datapay = new B2bPayData();
                var         list    = financedata.FinancePageList(comid, pageindex, pagesize, key, out totalcount, 0, oid, payment_type, money_come, starttime, endtime);
                IEnumerable result  = "";
                if (list != null)
                {
                    result = from finance in list
                             select new
                    {
                        Id                = finance.Id,
                        Com_id            = finance.Com_id,
                        ComName           = B2bCompanyData.GetCompany(finance.Com_id).Com_name,
                        Agent_id          = finance.Agent_id,
                        Eid               = finance.Eid,
                        Order_id          = finance.Order_id,
                        Servicesname      = finance.Servicesname,
                        ShortServicesname = finance.Servicesname.Length > 15 ? finance.Servicesname.Substring(0, 15) + "." : finance.Servicesname,
                        SerialNumber      = finance.SerialNumber,
                        Money             = finance.Money,
                        Money_come        = finance.Money_come,
                        Over_money        = finance.Over_money,
                        Payment           = finance.Payment,
                        Payment_type      = finance.Payment_type,
                        Subdate           = finance.Subdate,
                        Con_state         = finance.Con_state,
                        Remarks           = finance.Remarks,
                        Pno               = orderdata.GetPnoByOrderId(finance.Order_id),
                        Channelid         = finance.Channelid,
                        ChannelName       = channeldata.GetChannelCompanyNameById(finance.Channelid),
                        Paychannelstate   = finance.Paychannelstate,
                        Agentname         = financedata.GetAgentNamebyorderid(finance.Order_id),
                        Payinfo           = datapay.GetPayByoId(finance.Order_id)
                    }
                }
                ;

                return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result }));
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));

                throw;
            }
        }
Пример #22
0
 public static string GetAllComMsg(int comid)
 {
     try
     {
         B2b_company com = B2bCompanyData.GetAllComMsg(comid);
         return(JsonConvert.SerializeObject(new { type = 100, msg = com }));
     }
     catch (Exception ex)
     {
         return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));
     }
 }
Пример #23
0
        public static string Getqunarbycomid(int comid)
        {
            B2b_company company_qunar = new B2bCompanyData().Getqunarbycomid(comid);

            if (company_qunar != null)
            {
                return(JsonConvert.SerializeObject(new { type = 100, msg = company_qunar }));
            }
            else
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = "查询信息失败" }));
            }
        }
Пример #24
0
        public static string Editqunarbycomid(int comid, int isqunar, string qunar_username, string qunar_pass)
        {
            int r = new B2bCompanyData().Editqunarbycomid(comid, isqunar, qunar_username, qunar_pass);

            if (r > 0)
            {
                return(JsonConvert.SerializeObject(new { type = 100, msg = r }));
            }
            else
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = "" }));
            }
        }
Пример #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string u  = Request.ServerVariables["HTTP_USER_AGENT"];
            bool   bo = detectmobilebrowser.HttpUserAgent(u);

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

            if (materialid != 0)
            {
                //if (bo == false)
                //{
                //    if (materialid == 101)
                //    {
                //        Response.Redirect("http://vctrip.etown.cn/");
                //    }
                //    Response.Redirect("http://shop" + materialid + ".etown.cn");
                //}
                B2b_company_info info = new B2bCompanyInfoData().GetCompanyInfo(materialid);
                if (info != null)
                {
                    phone   = info.Tel;
                    address = info.Scenic_address;
                }
                B2b_company com = B2bCompanyData.GetCompany(materialid);
                if (com != null)
                {
                    name = com.Com_name;
                }


                if (Request.Cookies["AccountId"] != null)//判断是否有登陆COOKI
                {
                    string accountmd5 = "";
                    int    AccountId  = int.Parse(Request.Cookies["AccountId"].Value);
                    if (Request.Cookies["AccountKey"] != null)
                    {
                        accountmd5 = Request.Cookies["AccountKey"].Value;
                    }
                    B2b_crm userinfo;
                    var     data = CrmMemberJsonData.WeixinCookieLogin(AccountId.ToString(), accountmd5, materialid, out userinfo);
                    if (data == "OK")
                    {
                        if (userinfo != null)
                        {
                            string openid_temp = userinfo.Weixin;
                            GetMenshiDetail(openid_temp, materialid);
                        }
                    }
                }
            }
        }
Пример #26
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;
                }
            }
        }
Пример #27
0
        public bool IsParentCompanyUser = true; //判断操作账户类型(总公司账户;门市账户)
        protected void Page_Load(object sender, EventArgs e)
        {
            qunfa = Request["qunfa"].ConvertTo <string>("no");
            phone = Request["phone"].ConvertTo <string>("");

            //获取公司微信号
            B2b_company com = B2bCompanyData.GetAllComMsg(UserHelper.CurrentCompany.ID);

            weixinname = com.B2bcompanyinfo.Weixinname;

            int userid = UserHelper.CurrentUserId();

            IsParentCompanyUser = new B2bCompanyManagerUserData().IsParentCompanyUser(userid);
        }
Пример #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            comid   = Request["comid"].ConvertTo <int>(0);
            md5info = Request["md5info"].ConvertTo <string>("");

            string companyName = new B2bCompanyData().GetCompanyNameById(comid);


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

            if (Returnmd5 == md5info)//验证MD5
            {
                //ExcelRender.RenderToExcel(
                //               ExcelSqlHelper.ExecuteDataTable(CommandType.Text, "select idcard [会员卡号], name [姓名],phone [手机],email [邮件],imprest [预付款],Integral [积分],regidate [注册时间] from b2b_crm where com_id=" + comid),
                //               Context, companyName + "会员信息" + ".xls");

                DataTable crmdt = ExcelSqlHelper.ExecuteDataTable(CommandType.Text, "select idcard [会员卡号], name [姓名],phone [手机],email [邮件],imprest [预付款],Integral [积分],regidate [注册时间] from b2b_crm where com_id=" + comid);

                DataTable dt = new DataTable();
                dt.Columns.Add("会员卡号");
                dt.Columns.Add("姓名");
                dt.Columns.Add("手机");
                dt.Columns.Add("邮件");
                dt.Columns.Add("预付款");
                dt.Columns.Add("积分");
                dt.Columns.Add("注册时间");

                dt.Columns.Add("渠道单位");
                dt.Columns.Add("推荐人");
                DataRow dr = dt.NewRow();
                foreach (DataRow rr in crmdt.Rows)
                {
                    dr         = dt.NewRow();
                    dr["会员卡号"] = rr["会员卡号"].ToString();
                    dr["姓名"]   = rr["姓名"].ToString();
                    dr["手机"]   = rr["手机"].ToString();
                    dr["邮件"]   = rr["邮件"].ToString();
                    dr["预付款"]  = rr["预付款"].ToString();
                    dr["积分"]   = rr["积分"].ToString();
                    dr["注册时间"] = rr["注册时间"].ToString();
                    dr["渠道单位"] = new MemberChannelcompanyData().UpCompanyById(rr["会员卡号"].ToString());
                    dr["推荐人"]  = MemberChannelData.SearchNamestring(rr["会员卡号"].ToString());

                    dt.Rows.Add(dr);
                }

                ExcelRender.RenderToExcel(dt, Context, companyName + "会员信息" + ".xls");
            }
        }
Пример #29
0
 public static string Getchannelcompanyname(int channelcompanyid, int comid = 0)
 {
     if (comid == 0)
     {
         if (channelcompanyid == 0)
         {
             return(JsonConvert.SerializeObject(new { type = 1, msg = "" }));
         }
         else
         {
             Member_Channel_company company = new MemberChannelcompanyData().GetChannelCompany(channelcompanyid.ToString());
             if (company == null)
             {
                 return(JsonConvert.SerializeObject(new { type = 1, msg = "" }));
             }
             else
             {
                 return(JsonConvert.SerializeObject(new { type = 100, msg = company.Companyname }));
             }
         }
     }
     else
     {
         if (channelcompanyid == 0)
         {
             B2b_company company = B2bCompanyData.GetCompany(comid);
             if (company == null)
             {
                 return(JsonConvert.SerializeObject(new { type = 1, msg = "" }));
             }
             else
             {
                 return(JsonConvert.SerializeObject(new { type = 100, msg = company.Com_name }));
             }
         }
         else
         {
             Member_Channel_company company = new MemberChannelcompanyData().GetChannelCompany(channelcompanyid.ToString());
             if (company == null)
             {
                 return(JsonConvert.SerializeObject(new { type = 1, msg = "" }));
             }
             else
             {
                 return(JsonConvert.SerializeObject(new { type = 100, msg = company.Companyname }));
             }
         }
     }
 }
Пример #30
0
        public string contact_phone      = ""; //联系人电话
        protected void Page_Load(object sender, EventArgs e)
        {
            DateTime gooutdate = Request["gooutdate"].ConvertTo <DateTime>(DateTime.Now);

            nowdate   = gooutdate.ToString("yyyy-MM-dd");
            monthdate = DateTime.Parse(nowdate).AddDays(6).ToString("yyyy-MM-dd");

            servertype = (int)ProductServer_Type.LvyouBus;

            comid_temp = Request["comid"].ConvertTo <int>(0);
            if (comid_temp == 0)
            {
                Response.Redirect("/Agent/Default.aspx");
            }
            ishaslvyoubusproorder = new B2bOrderData().IsHasLvyoubusProOrder(comid_temp, (int)ProductServer_Type.LvyouBus);

            B2b_company companyinfo = B2bCompanyData.GetAllComMsg(comid_temp);

            if (companyinfo != null)
            {
                company       = companyinfo.Com_name;
                contact_phone = companyinfo.B2bcompanyinfo == null ? "" : companyinfo.B2bcompanyinfo.Tel;
            }
            if (Session["Agentid"] != null)
            {
                //账户信息
                Agentid = Int32.Parse(Session["Agentid"].ToString());
                Account = Session["Account"].ToString();
                Agent_company agenginfo = AgentCompanyData.GetAgentWarrant(Agentid, comid_temp);
                if (agenginfo != null)
                {
                    yufukuan     = "您预付款:" + agenginfo.Imprest.ToString("0.00") + " 元";
                    Warrant_type = agenginfo.Warrant_type;
                    if (Warrant_type == 1)
                    {
                        Warrant_type_str = "销售扣款";
                    }
                    if (Warrant_type == 2)
                    {
                        Warrant_type_str = "验证扣款";
                    }
                }
                else
                {
                    Response.Redirect("/Agent/Default.aspx");
                }
            }
        }