Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            comid = Request["comid"].ConvertTo <int>(0);



            //Banner
            int totalcount = 0;
            var Linkurl    = "/ui/shangjiaui/H5Setlist.aspx";
            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   = "\\\"" + Linkurl.Replace("/", "\\\\\\/") + "\\\"";;
                    }
                    else
                    {
                        title_arr += "," + "\\\"" + imglist[i].Title + "\\\"";
                        img_arr   += "," + "\\\"" + FileSerivce.GetImgUrl(imglist[i].Imgurl).Replace("/", "\\\\\\/") + "\\\"";
                        url_arr   += "," + "\\\"" + Linkurl.Replace("/", "\\\\\\/") + "\\\"";;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public static string PageGetimagelist(int comid, int typeid)
        {
            //typeid 0 =微网站Banner, 1=门市Banner
            int totalcount = 0;

            try
            {
                var imagedata = new B2bCompanyImageData();

                List <B2b_company_image> list = imagedata.PageGetimageList(comid, typeid, out totalcount);
                IEnumerable result            = "";
                if (list != null)
                {
                    result = from pro in list
                             select new
                    {
                        Id             = pro.Id,
                        Com_id         = pro.Com_id,
                        Imgurl_address = FileSerivce.GetImgUrl(pro.Imgurl),
                        Imgurl         = pro.Imgurl,
                        Linkurl        = pro.Linkurl,
                        Title          = pro.Title,
                        Typeid         = pro.Typeid,
                        State          = pro.State == 1 ?"上线":"下线"
                    };
                }

                return(JsonConvert.SerializeObject(new { type = 100, msg = result, totalCount = totalcount }));
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));
            }
        }
Exemplo n.º 3
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>";
            }
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //string u = Request.ServerVariables["HTTP_USER_AGENT"];
            //bool bo = detectmobilebrowser.HttpUserAgent(u);
            bool bo = true;

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

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


            if (comid != 0)
            {
                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("/", "\\\\\\/") + "\\\"";;
                    }
                }
            }
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            comid = Request["comid"].ConvertTo <int>(0);

            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>";
            }
        }
Exemplo n.º 6
0
        public string userid  = "0";//用户临时 Uid 或 实际Uid



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

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

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

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

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

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

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



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



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


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


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

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

                    title = commodel.Com_name;
                }


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

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

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



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

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

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


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



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

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