コード例 #1
0
 private void GetMenshiDetail(string openid, int comid)
 {
     if (openid == "")
     {
         errlog = "未获得微信号";
     }
     else
     {
         //判断用户身份:1.公司所属门店会员;2.公司会员
         Member_Card card = new MemberCardData().GetMemberCardByOpenId(openid);
         if (card != null)
         {
             if (card.IssueCard > 0)//门店会员
             {
                 menshi = new MemberChannelcompanyData().GetMenShiByOpenId(openid, comid);
                 if (menshi != null)
                 {
                     menshiimgurl = FileSerivce.GetImgUrl(menshi.Companyimg);
                 }
                 else
                 {
                     errlog = "获得门店信息为空";
                 }
             }
             else //公司会员
             {
                 Response.Redirect("OrderinfoTitle.aspx?id=" + comid);
             }
         }
         else
         {
             errlog = "未判断初用户身份";
         }
     }
 }
コード例 #2
0
 public int EditChannelCompany(Member_Channel_company company)
 {
     using (var helper = new SqlHelper())
     {
         var id = new InternalMemberChannelcompany(helper).EditChannelCompany(company);
         return(id);
     }
 }
コード例 #3
0
 public string GetChannelCompanyName(int crmid)
 {
     if (crmid == 0)
     {
         return("");
     }
     else
     {
         Member_Channel_company m = GetChannelCompanyByCrmId(crmid);
         if (m == null)
         {
             return("");
         }
         else
         {
             return(m.Companyname);
         }
     }
 }
コード例 #4
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string oper = context.Request["oper"].ConvertTo <string>("");

            if (oper != "")
            {
                if (oper == "getunitlist")
                {
                    int    unittype = context.Request["unittype"].ConvertTo <int>(0);//默认显示内部渠道
                    string data     = ChannelJsonData.GetUnitList(unittype);
                    context.Response.Write(data);
                }
                if (oper == "getunitlistneww")
                {
                    int unittype = context.Request["unittype"].ConvertTo <int>(0);//默认显示内部渠道,加公司限制
                    int comid    = context.Request["comid"].ConvertTo <int>(0);
                    int actid    = context.Request["actid"].ConvertTo <int>(0);
                    int userid   = context.Request["userid"].ConvertTo <int>(0);

                    string data = ChannelJsonData.GetUnitList(comid, unittype, userid, actid);
                    context.Response.Write(data);
                }
                if (oper == "getunitlist2")                                                //只是用于员工管理页面
                {
                    string ischosen = context.Request["ischosen"].ConvertTo <string>("0"); //渠道来源中“所属门市”是否选中
                    int    userid   = context.Request["userid"].ConvertTo <int>(0);
                    string unittype = context.Request["unittype"].ConvertTo <string>("0"); //默认显示内部渠道,加公司限制
                    int    comid    = context.Request["comid"].ConvertTo <int>(0);

                    string data = ChannelJsonData.GetUnitList(comid, unittype, ischosen, userid);
                    context.Response.Write(data);
                }
                if (oper == "GetChannelCompanyList")
                {
                    string channeltype = context.Request["channeltype"].ConvertTo <string>("");
                    int    comid       = context.Request["comid"].ConvertTo <int>();
                    int    pageindex   = context.Request["pageindex"].ConvertTo <int>(1);
                    int    pagesize    = context.Request["pagesize"].ConvertTo <int>(10);

                    string data = ChannelJsonData.GetChannelCompanyList(comid, channeltype, pageindex, pagesize);
                    context.Response.Write(data);
                }
                if (oper == "GetChannelCompany")
                {
                    string channelcompanyid = context.Request["channelcompanyid"].ConvertTo <string>("");
                    string data             = ChannelJsonData.GetChannelCompany(channelcompanyid);
                    context.Response.Write(data);
                }
                if (oper == "getchanneldetail")
                {
                    int channelid = context.Request["channelid"].ConvertTo <int>(0);

                    string date = ChannelJsonData.GetChannelDetail(channelid);
                    context.Response.Write(date);
                }
                if (oper == "getchanneldetailnew")
                {
                    int    channelid = context.Request["channelid"].ConvertTo <int>(0);
                    int    comid     = context.Request["comid"].ConvertTo <int>(0);
                    string date      = ChannelJsonData.GetChannelDetail(channelid, comid);
                    context.Response.Write(date);
                }
                if (oper == "getchannelcompanyname")
                {
                    int comid            = context.Request["comid"].ConvertTo <int>(0);
                    int channelcompanyid = context.Request["channelcompanyid"].ConvertTo <int>(0);

                    string date = ChannelJsonData.Getchannelcompanyname(channelcompanyid, comid);
                    context.Response.Write(date);
                }
                if (oper == "editchannel")
                {
                    var id            = context.Request["id"];
                    var comid         = context.Request["comid"];
                    var Issuetype     = context.Request["Issuetype"];
                    var companyid     = context.Request["companyid"];
                    var name          = context.Request["name"];
                    var mobile        = context.Request["mobile"];
                    var cardcode      = context.Request["cardcode"].ConvertTo <decimal>(0);
                    var chadress      = context.Request["chadress"];
                    var chobjects     = context.Request["chobjects"];
                    var rebateopen    = context.Request["rebateopen"];
                    var rebateconsume = context.Request["rebateconsume"];
                    var rebateleval   = context.Request["rebateleval"];

                    var opencardnum  = context.Request["opencardnum"];
                    var firstdealnum = context.Request["firstdealnum"];
                    var summoney     = context.Request["summoney"];

                    int whetherdefaultchannel = context.Request["whetherdefaultchannel"].ConvertTo <int>(0);
                    int runstate = context.Request["runstate"].ConvertTo <int>(1);

                    Member_Channel channel = new Member_Channel()
                    {
                        Id                    = id.ConvertTo <int>(0),
                        Com_id                = comid.ConvertTo <int>(0),
                        Issuetype             = Issuetype.ConvertTo <int>(1),
                        Companyid             = companyid.ConvertTo <int>(0),
                        Name                  = name,
                        Mobile                = mobile,
                        Cardcode              = cardcode,
                        Chaddress             = chadress,
                        ChObjects             = chobjects,
                        RebateOpen            = rebateopen.ConvertTo <decimal>(0),
                        RebateConsume         = rebateconsume.ConvertTo <decimal>(0),
                        RebateConsume2        = 0,
                        RebateLevel           = rebateleval.ConvertTo <int>(0),
                        Opencardnum           = opencardnum.ConvertTo <int>(0),
                        Firstdealnum          = firstdealnum.ConvertTo <int>(0),
                        Summoney              = summoney.ConvertTo <decimal>(0),
                        Whetherdefaultchannel = whetherdefaultchannel,
                        Runstate              = runstate
                    };

                    string data = ChannelJsonData.EditChannel(channel);
                    context.Response.Write(data);
                }
                if (oper == "pagelist")
                {
                    var comid     = context.Request["comid"];
                    var pageindex = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize  = context.Request["pagesize"].ConvertTo <int>(10);
                    var issuetype = context.Request["issuetype"].ConvertTo <string>("all");

                    var userid = context.Request["userid"].ConvertTo <int>(0);

                    string data = ChannelJsonData.PageList(comid, pageindex, pagesize, issuetype, userid);

                    context.Response.Write(data);
                }
                if (oper == "channellistbycomid")
                {
                    var comid     = context.Request["comid"];
                    var pageindex = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize  = context.Request["pagesize"].ConvertTo <int>(10);


                    string data = ChannelJsonData.Channellistbycomid(comid, pageindex, pagesize);

                    context.Response.Write(data);
                }

                //渠道查询
                if (oper == "searchpagelist")
                {
                    var comid     = context.Request["comid"];
                    var pageindex = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize  = context.Request["pagesize"].ConvertTo <int>(10);
                    var key       = context.Request["key"].ConvertTo <string>("");
                    var select    = context.Request["select"].ConvertTo <int>(0);

                    var    userid = context.Request["userid"].ConvertTo <int>(0);
                    string data   = ChannelJsonData.SeachList(comid, pageindex, pagesize, key, select, userid);

                    context.Response.Write(data);
                }
                if (oper == "editchannelcompany")
                {
                    var channelcompanyid = context.Request["channelcompanyid"].ConvertTo <int>(0);
                    var comid            = context.Request["comid"].ConvertTo <int>(0);
                    var Issuetype        = context.Request["Issuetype"].ConvertTo <int>(1);
                    var companyname      = context.Request["companyname"].ConvertTo <string>("");

                    string  companyaddress    = context.Request["companyaddress"].ConvertTo <string>("");
                    string  companyphone      = context.Request["companyphone"].ConvertTo <string>("");
                    decimal companyCoordinate = context.Request["companycoordinate"].ConvertTo <decimal>(0);
                    string  companyLocate     = context.Request["companyLocate"].ConvertTo <string>("");

                    int    companyimg     = context.Request["companyimg"].ConvertTo <int>(0);
                    string companyintro   = context.Request["companyintro"].ConvertTo <string>("");
                    string companyproject = context.Request["companyproject"].ConvertTo <string>("");

                    int companystate      = context.Request["companystate"].ConvertTo <int>(1);
                    int whetherdepartment = context.Request["whetherdepartment"].ConvertTo <int>(0);

                    string bookurl  = context.Request["bookurl"].ConvertTo <string>("");
                    string city     = context.Request["city"].ConvertTo <string>("");
                    string province = context.Request["Province"].ConvertTo <string>("");

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

                    Member_Channel_company company = new Member_Channel_company()
                    {
                        Id                = channelcompanyid,
                        Companyname       = companyname,
                        Com_id            = comid,
                        Issuetype         = Issuetype,
                        Companyaddress    = companyaddress,
                        Companyphone      = companyphone,
                        CompanyCoordinate = companyCoordinate,
                        CompanyLocate     = companyLocate,
                        Companyimg        = companyimg,
                        Companyintro      = companyintro,
                        Companyproject    = companyproject,
                        Companystate      = companystate,
                        Whetherdepartment = whetherdepartment,
                        Bookurl           = bookurl,
                        City              = city,
                        Province          = province,
                        Outshop           = outshop
                    };
                    string data = ChannelJsonData.EditChannelCompany(company);
                    context.Response.Write(data);
                }
                if (oper == "GetChannelByCompanyid")
                {
                    var    companyid = context.Request["companyid"];
                    string data      = ChannelJsonData.GetChannelByCompanyid(companyid);
                    context.Response.Write(data);
                }

                //修改渠道和推荐人
                if (oper == "upchannl")
                {
                    var comid      = context.Request["comid"].ConvertTo <int>(0);
                    var id         = context.Request["id"].ConvertTo <int>(0);
                    var channlcard = context.Request["channlcard"].ConvertTo <decimal>();
                    var oldcard    = context.Request["oldcard"].ConvertTo <decimal>();
                    var uptype     = context.Request["Uptype"].ConvertTo <int>();

                    string data = ChannelJsonData.Upchannl(id, comid, channlcard, oldcard, uptype);

                    context.Response.Write(data);
                }

                //修改门市店长推荐
                if (oper == "upchannelcompanproject")
                {
                    var comid          = context.Request["comid"].ConvertTo <int>(0);
                    var id             = context.Request["channelcompanyid"].ConvertTo <int>(0);
                    var companyproject = context.Request["companyproject"].ConvertTo <string>("");

                    string data = ChannelJsonData.Upchannelcompanproject(id, companyproject);

                    context.Response.Write(data);
                }

                //渠道统计
                if (oper == "Channelstatistics")
                {
                    var comid     = context.Request["comid"];
                    var pageindex = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize  = context.Request["pagesize"].ConvertTo <int>(10);
                    //var issuetype = context.Request["issuetype"].ConvertTo<string>("all") == "all" ? "all" : context.Request["issuetype"];
                    string channelcompanytype = context.Request["channelcompanytype"].ConvertTo <string>("out");

                    string data = ChannelJsonData.Channelstatistics(comid, pageindex, pagesize, channelcompanytype);

                    context.Response.Write(data);
                }
                //渠道统计
                if (oper == "Channelstatistics2")
                {
                    var comid     = context.Request["comid"];
                    var pageindex = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize  = context.Request["pagesize"].ConvertTo <int>(10);

                    string channelcompanytype = context.Request["channelcompanytype"].ConvertTo <string>("out");
                    string companystate       = context.Request["companystate"].ConvertTo <string>("1");

                    string data = ChannelJsonData.Channelstatistics2(comid, pageindex, pagesize, channelcompanytype, companystate);

                    context.Response.Write(data);
                }

                if (oper == "Channelstatistics3")
                {
                    int channelcompanyid = context.Request["channelcompanyid"].ConvertTo <int>(0);
                    var comid            = context.Request["comid"];
                    var pageindex        = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize         = context.Request["pagesize"].ConvertTo <int>(10);

                    string channelcompanytype = context.Request["channelcompanytype"].ConvertTo <string>("out");
                    string companystate       = context.Request["companystate"].ConvertTo <string>("1");

                    string data = ChannelJsonData.Channelstatistics2(comid, pageindex, pagesize, channelcompanytype, companystate, channelcompanyid);

                    context.Response.Write(data);
                }
                //渠道统计_验卡
                if (oper == "ChannelYk")
                {
                    var    comid     = context.Request["comid"];
                    var    pageindex = context.Request["pageindex"].ConvertTo <int>(0);
                    var    pagesize  = context.Request["pagesize"].ConvertTo <int>(10);
                    var    issuetype = context.Request["issuetype"].ConvertTo <string>("all") == "all" ? "all" : context.Request["issuetype"];
                    string data      = ChannelJsonData.ChannelYk(comid, pageindex, pagesize, issuetype);

                    context.Response.Write(data);
                }
                if (oper == "GetAllInnerChannels")//得到所有的内部渠道
                {
                    string data = ChannelJsonData.GetAllInnerChannels();
                    context.Response.Write(data);
                }

                if (oper == "GetAllInnerChannelCompanys")//得到所有的内部渠道门市
                {
                    string data = ChannelJsonData.GetUnitList(0);
                    context.Response.Write(data);
                }
                if (oper == "GetUnitListNew")//得到内部/外部渠道门市
                {
                    int sourceid = context.Request["sourceid"].ConvertTo <int>(0);

                    string data = ChannelJsonData.GetUnitList(sourceid);
                    context.Response.Write(data);
                }

                if (oper == "GetUnitListselected")//得到渠道及被选中效果
                {
                    int actid = context.Request["actid"].ConvertTo <int>(0);

                    string data = ChannelJsonData.GetUnitListselected(actid);
                    context.Response.Write(data);
                }
                if (oper == "SearchChannelByChannelUnit")//得到渠道公司下的渠道列表
                {
                    var comid            = context.Request["comid"];
                    var pageindex        = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize         = context.Request["pagesize"].ConvertTo <int>(10);
                    var channelcompanyid = context.Request["channelcompanyid"].ConvertTo <int>(0);


                    string data = ChannelJsonData.SearchChannelByChannelUnit(comid, pageindex, pagesize, channelcompanyid);

                    context.Response.Write(data);
                }
                if (oper == "Channelcompanypagelist")
                {
                    var comid     = context.Request["comid"];
                    var pageindex = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize  = context.Request["pagesize"].ConvertTo <int>(10);
                    var key       = context.Request["key"].ConvertTo <string>("");

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

                    string channelcompanytype = context.Request["channelcompanytype"].ConvertTo <string>("0,1,3,4");
                    var    accountid          = 0;
                    if (context.Request.Cookies["AccountId"] != null)
                    {
                        accountid = context.Request.Cookies["AccountId"].Value.ConvertTo <int>(0);
                    }
                    var openid  = "";
                    var n1      = ""; //用户的精度
                    var e1      = ""; //用户的维度
                    var b2bdate = new B2bCrmData();

                    if (accountid != 0)
                    {
                        var b2bmodel = b2bdate.Readuser(accountid, int.Parse(comid));
                        if (b2bmodel != null)
                        {
                            openid = b2bmodel.Weixin;
                        }
                        var crmlocation = b2bdate.GetB2bCrmDistanceByid(openid);
                        if (crmlocation != "")
                        {
                            var locatarr = crmlocation.Split(',');
                            if (locatarr.Count() >= 2)
                            {
                                n1 = locatarr[1];
                                e1 = locatarr[0];
                            }
                        }
                    }



                    string data = ChannelJsonData.Channelcompanypagelist(comid, pageindex, pagesize, key, channelcompanyid, channelcompanytype, openid);

                    context.Response.Write(data);
                }

                if (oper == "ChannelcompanyOrderlocation")
                {
                    var comid     = context.Request["comid"];
                    var pageindex = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize  = context.Request["pagesize"].ConvertTo <int>(10);
                    var key       = context.Request["key"].ConvertTo <string>("");

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

                    string channelcompanytype = context.Request["channelcompanytype"].ConvertTo <string>("0,1,3,4");
                    var    accountid          = 0;
                    if (context.Request.Cookies["AccountId"] != null)
                    {
                        accountid = context.Request.Cookies["AccountId"].Value.ConvertTo <int>(0);
                    }
                    var openid  = "";
                    var n1      = ""; //用户的精度
                    var e1      = ""; //用户的维度
                    var b2bdate = new B2bCrmData();

                    if (accountid != 0)
                    {
                        var b2bmodel = b2bdate.Readuser(accountid, int.Parse(comid));
                        if (b2bmodel != null)
                        {
                            openid = b2bmodel.Weixin;
                        }
                        var crmlocation = b2bdate.GetB2bCrmDistanceByid(openid);
                        if (crmlocation != "")
                        {
                            var locatarr = crmlocation.Split(',');
                            if (locatarr.Count() >= 2)
                            {
                                n1 = locatarr[1];
                                e1 = locatarr[0];
                            }
                        }
                    }

                    string data = ChannelJsonData.ChannelcompanyOrderlocation(comid, pageindex, pagesize, key, channelcompanyid, channelcompanytype, openid, n1, e1);

                    context.Response.Write(data);
                }


                if (oper == "adjustchannelcompanystatus")
                {
                    int    companyid = context.Request["companyid"].ConvertTo <int>(0);
                    int    status    = context.Request["status"].ConvertTo <int>(0);
                    string data      = ChannelJsonData.Adjustchannelcompanystatus(companyid, status);

                    context.Response.Write(data);
                }
            }
        }
コード例 #5
0
        public string errlog                 = "";   //记录错误信息
        protected void Page_Load(object sender, EventArgs e)
        {
            string u = Request.ServerVariables["HTTP_USER_AGENT"];

            #region 判断访问来源:手机访问;pc访问
            bool bo = detectmobilebrowser.HttpUserAgent(u);
            if (bo == false)//pc访问
            {
                //if (comid == 101)
                //{
                //    Response.Redirect("http://vctrip.etown.cn/");
                //}
                //Response.Redirect("http://shop" + comid + ".etown.cn");
            }
            #endregion

            #region  递过来门市id,通过门市id获得门市信息
            int menshiid = Request["menshiid"].ConvertTo <int>(0);
            if (menshiid > 0)
            {
                menshi = new MemberChannelcompanyData().GetChannelCompany(menshiid.ToString());
                if (menshi != null)
                {
                    menshiimgurl = FileSerivce.GetImgUrl(menshi.Companyimg);
                    comid        = menshi.Com_id;
                }
                else
                {
                    errlog = "获得门店信息为空";
                }
            }
            #endregion
            #region 1.传递过来微信号openid(微信未认证商户);2.根据网页授权接口获得openid(微信已认证商户)
            else
            {
                #region 已认证微信商户,访问网址规则类似shop101.etown.cn,根据网页授权接口获得openid
                string weixincode = Request["code"].ConvertTo <string>("");
                if (weixincode != "")
                {
                    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;
                        }
                        string openid = GetOpenId_2(weixincode, comid);

                        GetMenshiDetail(openid, comid);
                    }
                    else
                    {
                        errlog = "公司id获取有误";
                    }
                }
                #endregion
                #region 未认证微信商户,访问网址不限制,需要传递参数openid
                else
                {
                    string openid = Request["openid"].ConvertTo <string>("");
                    //根据openid得到会员信息
                    B2b_crm crm = new B2bCrmData().GetB2bCrmByWeiXin(openid);
                    if (crm != null)
                    {
                        GetMenshiDetail(openid, crm.Com_id);
                        comid = crm.Com_id;
                    }
                    else
                    {
                        errlog = "根据微信号得到会员信息为空";
                    }
                }
                #endregion
            }
            #endregion


            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,点击微信菜单进来的);使用户处于登录状态(不包括点击转发链接的)
                }
            }
        }
コード例 #6
0
        public Member_Channel_company menshi = null;//门店信息

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

            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;
                }
            }


            #region  递过来门市id,通过门市id获得门市信息
            menshiid = Request["menshiid"].ConvertTo <int>(0);
            if (menshiid > 0)
            {
                menshi = new MemberChannelcompanyData().GetChannelCompany(menshiid.ToString());
                if (menshi != null)
                {
                    menshiimgurl = FileSerivce.GetImgUrl(menshi.Companyimg);
                    companyname  = menshi.Companyname;
                    comid        = menshi.Com_id;
                }
            }
            #endregion



            ////默认图片
            //string defaultimg = "/Images/StoreDefault.jpg";
            //title_arr = "\\\"" + companyname + "\\\"";
            //img_arr = "\\\"" + defaultimg.Replace("/", "\\\\\\/") + "\\\"";
            //url_arr = "\\\"" + "#" + "\\\""; ;

            int totalcount = 0;
            B2bCompanyImageData imgdata = new B2bCompanyImageData();

            //Banner,调取门市总社图片
            List <B2b_company_image> channelimglist = imgdata.PageChannelGetimageList(comid, menshiid, out totalcount);
            if (channelimglist != null)
            {
                for (int i = 0; i < totalcount; i++)
                {
                    if (title_arr == "")
                    {
                        title_arr = "\\\"" + channelimglist[i].Title + "\\\"";
                        img_arr   = "\\\"" + FileSerivce.GetImgUrl(channelimglist[i].Imgurl).Replace("/", "\\\\\\/") + "\\\"";
                        url_arr   = "\\\"" + channelimglist[i].Linkurl.Replace("/", "\\\\\\/") + "\\\"";;
                    }
                    else
                    {
                        title_arr += "," + "\\\"" + channelimglist[i].Title + "\\\"";
                        img_arr   += "," + "\\\"" + FileSerivce.GetImgUrl(channelimglist[i].Imgurl).Replace("/", "\\\\\\/") + "\\\"";
                        url_arr   += "," + "\\\"" + channelimglist[i].Linkurl.Replace("/", "\\\\\\/") + "\\\"";;
                    }
                }
            }


            //Banner,调取总社图片
            List <B2b_company_image> imglist = imgdata.PageGetimageList(comid, 1, 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("/", "\\\\\\/") + "\\\"";;
                    }
                }
            }
        }
コード例 #7
0
ファイル: StoreInfo.aspx.cs プロジェクト: radtek/etowncode
        public string title          = "";//访问网址通过访问网址判断商家

        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());
            }


            #region  递过来门市id,通过门市id获得门市信息
            menshiid = Request["menshiid"].ConvertTo <int>(0);
            type     = Request["type"].ConvertTo <int>(0);

            if (menshiid > 0)
            {
                menshi = new MemberChannelcompanyData().GetChannelCompany(menshiid.ToString());
                if (menshi != null)
                {
                    menshiimgurl = FileSerivce.GetImgUrl(menshi.Companyimg);
                    comid        = menshi.Com_id;

                    if (menshi.Province != "")
                    {
                        Province = menshi.Province;
                    }
                    else
                    {
                        //如果门市没有设置地址按 商户设定地址
                        var comdata = B2bCompanyData.GetCompany(comid);
                        if (comdata != null)
                        {
                            Province = comdata.B2bcompanyinfo.Province;
                        }
                    }
                }
                else
                {
                    errlog = "获得门店信息为空";
                }
            }
            #endregion
            #region 1.传递过来微信号openid(微信未认证商户);2.根据网页授权接口获得openid(微信已认证商户)
            else
            {
                //非门市读取商户信息
                if (comid != 0)
                {
                    var cominfo = B2bCompanyData.GetCompany(comid);
                    if (cominfo != null)
                    {
                        menshi.Companystate        = 0;
                        menshi.Com_id              = comid;
                        menshi.Issuetype           = 0;
                        menshi.Companyname         = cominfo.Com_name;
                        menshi.Whethercreateqrcode = false;
                        menshi.Companystate        = 1; //默认渠道公司为开通状态
                        menshi.Whetherdepartment   = 0; //默认 非内部部门
                        menshi.Bookurl             = "";
                        menshi.Companyaddress      = cominfo.B2bcompanyinfo.Scenic_address;
                        menshi.Companyphone        = cominfo.B2bcompanyinfo.Tel;
                        menshi.CompanyCoordinate   = 0;
                        menshi.CompanyLocate       = cominfo.B2bcompanyinfo.Coordinate;
                        menshi.Companyimg          = 0;
                        menshi.Companyintro        = cominfo.B2bcompanyinfo.Scenic_intro;
                        menshi.Companyproject      = String.Empty;
                        menshi.City        = cominfo.B2bcompanyinfo.City;
                        menshi.Province    = "";
                        menshi.Selectstate = 0;
                    }
                }


                #region 已认证微信商户,访问网址规则类似shop101.etown.cn,根据网页授权接口获得openid
                string weixincode = Request["code"].ConvertTo <string>("");
                if (weixincode != "")
                {
                    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;
                        }
                        string openid = GetOpenId_2(weixincode, comid);

                        GetMenshiDetail(openid, comid);
                    }
                    else
                    {
                        errlog = "公司id获取有误";
                    }
                }
                #endregion
                #region 未认证微信商户,访问网址不限制,需要传递参数openid
                else
                {
                    string openid = Request["openid"].ConvertTo <string>("");
                    //根据openid得到会员信息
                    B2b_crm crm = new B2bCrmData().GetB2bCrmByWeiXin(openid);
                    if (crm != null)
                    {
                        GetMenshiDetail(openid, crm.Com_id);
                        comid = crm.Com_id;
                    }
                    else
                    {
                        errlog = "根据微信号得到会员信息为空";
                    }
                }
                #endregion
            }
            #endregion


            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>("");

                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,点击微信菜单进来的);使用户处于登录状态(不包括点击转发链接的)
                }
            }
        }
コード例 #8
0
 public static string EditChannelCompany(Member_Channel_company company)
 {
     try
     {
         int id = new MemberChannelcompanyData().EditChannelCompany(company);
         if (company.Id == 0)//如果是添加渠道单位操作,则默认添加一个此单位下的渠道人
         {
             Member_Channel channel = new Member_Channel()
             {
                 Id                    = 0,
                 Com_id                = company.Com_id,
                 Issuetype             = company.Issuetype,
                 Companyid             = id,
                 Name                  = "默认渠道",
                 Mobile                = "",
                 Cardcode              = 0,
                 Chaddress             = "",
                 ChObjects             = "",
                 RebateOpen            = 0,
                 RebateConsume         = 0,
                 RebateConsume2        = 0,
                 RebateLevel           = 0,
                 Opencardnum           = 0,
                 Firstdealnum          = 0,
                 Summoney              = 0,
                 Whetherdefaultchannel = 1,
                 Runstate              = 1
             };
             int idd = new MemberChannelData().EditChannel(channel);
             if (id > 0 && idd > 0)
             {
                 return(JsonConvert.SerializeObject(new { type = 100, msg = id }));
             }
             else
             {
                 return(JsonConvert.SerializeObject(new { type = 1, msg = "编辑渠道时出现错误" }));
             }
         }
         else
         {
             //判断渠道公司中是否含有默认渠道,没有的话添加进去
             int numm = new MemberChannelData().GetDefaultChannelNum(company.Id);
             if (numm == 0)
             {
                 Member_Channel channel = new Member_Channel()
                 {
                     Id                    = 0,
                     Com_id                = company.Com_id,
                     Issuetype             = company.Issuetype,
                     Companyid             = id,
                     Name                  = "默认渠道",
                     Mobile                = "",
                     Cardcode              = 0,
                     Chaddress             = "",
                     ChObjects             = "",
                     RebateOpen            = 0,
                     RebateConsume         = 0,
                     RebateConsume2        = 0,
                     RebateLevel           = 0,
                     Opencardnum           = 0,
                     Firstdealnum          = 0,
                     Summoney              = 0,
                     Whetherdefaultchannel = 1
                 };
                 int idd = new MemberChannelData().EditChannel(channel);
                 if (id > 0 && idd > 0)
                 {
                     return(JsonConvert.SerializeObject(new { type = 100, msg = id }));
                 }
                 else
                 {
                     return(JsonConvert.SerializeObject(new { type = 1, msg = "编辑渠道时出现错误" }));
                 }
             }
             else
             {
                 if (id > 0)
                 {
                     return(JsonConvert.SerializeObject(new { type = 100, msg = id }));
                 }
                 else
                 {
                     return(JsonConvert.SerializeObject(new { type = 1, msg = "编辑渠道时出现错误" }));
                 }
             }
         }
     }
     catch (Exception ex)
     {
         return(JsonConvert.SerializeObject(new
         {
             type = 1,
             msg = ex.Message
         }));
     }
 }
コード例 #9
0
ファイル: People.aspx.cs プロジェクト: radtek/etowncode
        public int isrightwxset = 1;  //微信接口设置信息是否正确
        #endregion
        protected void Page_Load(object sender, EventArgs e)
        {
            MasterId = Request["MasterId"].ConvertTo <int>(0);
            come     = Request["come"].ConvertTo <string>("");
            B2b_company_manageuser manageruser = B2bCompanyManagerUserData.GetUser(MasterId);

            if (manageruser != null)
            {
                MasterId = manageruser.Id;

                MasterName  = manageruser.Employeename;
                CompanyName = B2bCompanyData.GetCompanyByUid(manageruser.Id).Com_name;
                Tel         = manageruser.Tel;
                Viewtel     = manageruser.Viewtel;
                comid       = manageruser.Com_id;
                B2bCrmData crmdata  = new B2bCrmData();
                var        crmmodel = crmdata.GetB2bCrmByPhone(manageruser.Com_id, Tel);
                if (crmmodel != null)
                {
                    if (crmmodel.Weixin != "")
                    {
                        zaixianzhuangtai = "我在线上";
                        guwenweixin      = crmmodel.Weixin;
                    }
                    else
                    {
                        zaixianzhuangtai = "未在线";
                    }
                }

                var commodel = B2bCompanyData.GetCompany(comid);

                if (commodel != null)
                {
                    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));
                    }
                }



                ChannelCompanyId = manageruser.Channelcompanyid;
                ChannelCompany   = new MemberChannelcompanyData().GetCompanyById(manageruser.Channelcompanyid.ToString().ConvertTo <int>(0));

                if (ChannelCompany != null)
                {
                    ChannelCompanyName = ChannelCompany.Companyname;
                }

                //获取渠道ID
                MemberChannelData channeldata = new MemberChannelData();
                var channelmodel = channeldata.GetPhoneComIdChannelDetail(Tel, comid);
                if (channelmodel != null)
                {
                    channelid = channelmodel.Id;
                }



                Channelsource = manageruser.Channelsource;
                CreateUserId  = manageruser.Createuserid;
                EmployeState  = manageruser.Employeestate;
                Job           = manageruser.Job;
                Selfbrief     = manageruser.Selfbrief;
                if (Selfbrief != "" && Selfbrief != null)
                {
                    if (Selfbrief.Length > 21)
                    {
                        Selfbrief = Selfbrief.Substring(0, 21) + "...";
                    }
                }


                //Headimg=manageruser.Headimg;
                Headimgurl   = FileSerivce.GetImgUrl(manageruser.Headimg);
                Workingyears = manageruser.Workingyears;
                Workdays     = manageruser.Workdays;

                WorkdaysView = crmdata.WorkDay(Workdays);//判断是否在工作日内,1为在,0为不在



                Workdaystime           = manageruser.Workdaystime;
                Workendtime            = manageruser.Workendtime;
                Fixphone               = manageruser.Fixphone;
                Email                  = manageruser.Email;
                Homepage               = manageruser.Homepage;
                Weibopage              = manageruser.Weibopage;
                QQ                     = manageruser.QQ;
                Weixin                 = manageruser.Weixin;
                Selfhomepage_qrcordurl = manageruser.Selfhomepage_qrcordurl;

                //获取公司信息(微信连接地址)
                cominfo = B2bCompanyData.GetAllComMsg(comid);
                if (cominfo != null)
                {
                    linkguanzhu = cominfo.B2bcompanyinfo.Wxfocus_url;
                    author      = cominfo.B2bcompanyinfo.Wxfocus_author;
                }

                //导航
                var imagedata  = new B2bCompanyMenuData();
                int totalcount = 0;

                List <B2b_company_menu> list = imagedata.GetconsultantList(manageruser.Com_id, 1, 10, out totalcount);
                if (list != null)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        var imageurl = FileSerivce.GetImgUrl(list[i].Imgurl);



                        if (firstmenuid == 0)
                        {
                            firstdaohang = list[i].Linktype;
                            firstmenuid  = list[i].Id;
                            isoutpro     = list[i].Outdata;
                        }
                        if (daohang_html == "")
                        {
                            daohang_html += "<li class=\"curr\" menu-id=\"" + list[i].Id + "\"  data-id=\"" + list[i].Linktype + "\"  data-isoutpro=\"" + list[i].Outdata + "\"><!--<img src=\"" + imageurl + "\" height=\"60px\">--><span>" + list[i].Name + "</span></li>";
                        }
                        else
                        {
                            daohang_html += "<li class=\"\" menu-id=\"" + list[i].Id + "\"  data-id=\"" + list[i].Linktype + "\"   data-isoutpro=\"" + list[i].Outdata + "\"><!--<img src=\"" + imageurl + "\" height=\"60px\">--><span>" + list[i].Name + "</span></li>";
                        }
                        //daohang_Imgurl_address = FileSerivce.GetImgUrl(list.Imgurl);
                        //daohang_Imgurl = list.Imgurl;
                        ///daohang_Linkurl = list.Linkurl;
                        //daohang_Name = list.Name;
                        //daohang_Fonticon = list.Fonticon;
                    }
                }
            }
            ;


            //获取微信平台端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,点击微信菜单进来的);使用户处于登录状态(不包括点击转发链接的)
            }



            //创建新的微信一次性密码
            new_weixinpass = new B2bCrmData().WeixinGetPass(weixinopenid, comid);


            #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
        }