Exemplo n.º 1
0
        public object Clone()
        {
            LogBrowseVO obj = new LogBrowseVO();

            obj.Id = this.Id;

            obj.Url = this.Url;

            obj.ClientIp = this.ClientIp;

            obj.BrowseType = this.BrowseType;

            obj.CreateDate = this.CreateDate;

            obj.AdId = this.AdId;

            obj.AdUserId = this.AdUserId;

            obj.FlowUserId = this.FlowUserId;

            obj.AdUrl = this.AdUrl;

            obj.Money = this.Money;

            obj.IsMoney = this.IsMoney;

            obj.Time = this.Time;

            obj.ClientId = this.ClientId;

            obj.IsMobile = this.IsMobile;

            obj.ReferrerUrl = this.ReferrerUrl;

            obj.BrowseName = this.BrowseName;

            obj.BrowseVersion = this.BrowseVersion;

            obj.OsName = this.OsName;

            obj.Country = this.Country;

            obj.Area = this.Area;

            obj.Region = this.Region;

            obj.City = this.City;

            obj.County = this.County;

            obj.Isp = this.Isp;

            obj.IpSource = this.IpSource;



            return(obj);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 公共方法
        /// </summary>
        /// <param name="adid"></param>
        /// <param name="newid"></param>
        /// <param name="qcode">二维码</param>
        public void CommonViewQcode(string adid, string newid, string qcode)
        {
            /*
             * 加入来源判断,如果为NULL则跳转到其它页面,debug=1则不跳转调试使用 skey edit 2017-09-07
             */

            int aid      = int.Parse(adid);
            int aduserid = 0;
            var info     = DN.WeiAd.Business.AdPageInfoBLL.Instance.GetSingle(new DN.WeiAd.Models.AdPageInfoPara()
            {
                Id = aid
            });

            DN.WeiAd.Models.LogBrowseVO log = new DN.WeiAd.Models.LogBrowseVO();

            if (info != null)
            {
                ViewBag.Title         = info.Title;
                ViewBag.Content       = info.Content;
                ViewBag.StaticContent = "<span></span>";
                if (!string.IsNullOrEmpty(info.StaticContent))
                {
                    ViewBag.StaticContent = info.StaticContent;
                }
                ViewBag.UserCode = "<span></span>";
                if (!string.IsNullOrEmpty(info.UserCode))
                {
                    ViewBag.UserCode = info.UserCode;
                }
                aduserid          = info.UserId;
                log.Money         = info.Money;
                ViewBag.QcodeImg  = info.QcodeImg;
                ViewBag.QcodeImg2 = info.QcodeImg2;
            }

            log.BrowseType    = DN.Framework.Utility.ClientHelper.GetUserAgent();
            log.ClientIp      = DN.Framework.Utility.ClientHelper.ClientIP();
            log.CreateDate    = DateTime.Now;
            log.AdUrl         = Request.Url.ToString();
            log.IsMoney       = 0;
            log.AdId          = aid;
            log.AdUserId      = aduserid;
            log.Time          = int.Parse(DateTime.Now.ToString("yyyyMMdd"));
            log.ClientId      = GetClentId(Request, Response);
            log.IsMobile      = DN.Framework.Utility.ClientHelper.GetIsMobileDevice() ? 1 : 0;
            log.ReferrerUrl   = Request.UrlReferrer == null ? "" : Request.UrlReferrer.AbsoluteUri;
            log.OsName        = DN.Framework.Utility.ClientHelper.GetOsName();
            log.BrowseName    = DN.Framework.Utility.ClientHelper.GetBrowseName();
            log.BrowseVersion = DN.Framework.Utility.ClientHelper.GetBrowseVersion();
            log.Url           = Request.Url.ToString();
            var ipinfo = DN.WeiAd.Business.Services.IpTaoBaoHelper.GetIpResult(log.ClientIp);

            if (ipinfo != null && ipinfo.code == 0 && ipinfo.data != null)
            {
                log.Country = ipinfo.data.country;
                log.Area    = ipinfo.data.area;
                log.City    = ipinfo.data.city;
                log.Region  = ipinfo.data.region;
                log.County  = ipinfo.data.county;
                log.Isp     = ipinfo.data.isp;

                if (!string.IsNullOrEmpty(log.Isp))
                {
                    if (log.Isp.IndexOf("腾讯") != -1)
                    {
                        ViewBag.Content = "";
                        ViewBag.Title   = "";
                    }
                }
            }

            if (!string.IsNullOrEmpty(newid))
            {
                var ainfo = ArticleInfoBLL.Instance.GetSingle(new ArticleInfoPara()
                {
                    Id = int.Parse(newid)
                });
                if (ainfo != null)
                {
                    ViewBag.ArticleTitle   = ainfo.Title;
                    ViewBag.ArticleContent = ainfo.Content;

                    if (string.IsNullOrEmpty(ViewBag.Title))
                    {
                        ViewBag.Title = ainfo.Title;
                    }
                }
            }

            if (!string.IsNullOrEmpty(qcode))
            {
                var adqcode = AdQcodeInfoBLL.Instance.GetSingle(new AdQcodeInfoPara()
                {
                    Id = int.Parse(qcode)
                });
                if (adqcode != null)
                {
                }
            }

            DN.WeiAd.Business.LogBrowseBLL.Instance.Add(log);

            //if(string.IsNullOrEmpty(log.ReferrerUrl))
            //{
            //    string debug = Request.Params["debug"] ?? "";

            //    if (debug != "1")
            //    {
            //        Response.Redirect("http://www.qq.com");
            //    }
            //}
        }
Exemplo n.º 3
0
        /// <summary>
        /// 带产品ID的页面
        /// </summary>
        /// <param name="producteid"></param>
        /// <param name="newid"></param>
        public void CommonViewProducte(string producteid, string td)
        {
            try
            {
                int pid = 1;
                if (!string.IsNullOrEmpty(producteid))
                {
                    int.TryParse(producteid, out pid);
                }
                //var pinfo = ProductBLL.GetProducts().SingleOrDefault(tp => tp.Id == pid);
                var pinfo = ProductInfoBLL.Instance.GetProductById(pid);

                ViewBag.ProductPrice = pinfo.Price;
                ViewBag.ProductId    = pinfo.Id;
                ViewBag.AttrJson     = DN.Framework.Utility.Serializer.SerializeObject(pinfo.Attr);
                ViewBag.ProductName  = pinfo.Name;

                int aid      = pinfo.AdId;
                int aduserid = 0;
                var info     = DN.WeiAd.Business.AdPageInfoBLL.Instance.GetSingle(new DN.WeiAd.Models.AdPageInfoPara()
                {
                    Id = aid
                });

                DN.WeiAd.Models.LogBrowseVO log = new DN.WeiAd.Models.LogBrowseVO();

                if (info != null)
                {
                    ViewBag.Title         = info.Title;
                    ViewBag.Content       = info.Content;
                    ViewBag.StaticContent = "<span></span>";
                    if (!string.IsNullOrEmpty(info.StaticContent))
                    {
                        ViewBag.StaticContent = info.StaticContent;
                    }
                    ViewBag.UserCode = "<span></span>";
                    if (!string.IsNullOrEmpty(info.UserCode))
                    {
                        ViewBag.UserCode = info.UserCode;
                    }
                    aduserid  = info.UserId;
                    log.Money = info.Money;

                    ViewBag.QcodeImg  = info.QcodeImg;
                    ViewBag.QcodeImg2 = info.QcodeImg2;
                }

                log.BrowseType    = DN.Framework.Utility.ClientHelper.GetUserAgent();
                log.ClientIp      = DN.Framework.Utility.ClientHelper.ClientIP();
                log.CreateDate    = DateTime.Now;
                log.AdUrl         = Request.Url.ToString();
                log.IsMoney       = 0;
                log.AdId          = aid;
                log.AdUserId      = aduserid;
                log.Time          = int.Parse(DateTime.Now.ToString("yyyyMMdd"));
                log.ClientId      = GetClentId(Request, Response);
                log.IsMobile      = DN.Framework.Utility.ClientHelper.GetIsMobileDevice() ? 1 : 0;
                log.ReferrerUrl   = Request.UrlReferrer == null ? "" : Request.UrlReferrer.AbsoluteUri;
                log.OsName        = DN.Framework.Utility.ClientHelper.GetOsName();
                log.BrowseName    = DN.Framework.Utility.ClientHelper.GetBrowseName();
                log.BrowseVersion = DN.Framework.Utility.ClientHelper.GetBrowseVersion();
                log.Url           = Request.Url.ToString();
                var ipinfo = DN.WeiAd.Business.Services.IpTaoBaoHelper.GetIpResult(log.ClientIp);
                if (ipinfo != null && ipinfo.code == 0 && ipinfo.data != null)
                {
                    log.Country = ipinfo.data.country;
                    log.Area    = ipinfo.data.area;
                    log.City    = ipinfo.data.city;
                    log.Region  = ipinfo.data.region;
                    log.County  = ipinfo.data.county;
                    log.Isp     = ipinfo.data.isp;

                    if (!string.IsNullOrEmpty(log.Isp))
                    {
                        if (log.Isp.IndexOf("腾讯") != -1)
                        {
                            ViewBag.Content = "";
                            ViewBag.Title   = "";
                        }
                    }
                }



                if (!string.IsNullOrEmpty(td))
                {
                    var ainfo = ArticleInfoBLL.Instance.GetSingle(new ArticleInfoPara()
                    {
                        Id = int.Parse(td)
                    });
                    if (ainfo != null)
                    {
                        ViewBag.ArticleTitle   = ainfo.Title;
                        ViewBag.ArticleContent = ainfo.Content;

                        if (string.IsNullOrEmpty(ViewBag.Title))
                        {
                            ViewBag.Title = ainfo.Title;
                        }
                    }
                }

                ViewBag.AdId     = aid;
                ViewBag.AdUserId = aduserid;


                DN.WeiAd.Business.LogBrowseBLL.Instance.Add(log);
            }
            catch (Exception ex)
            {
                DN.Framework.Utility.LogHelper.Error(ex.Message, "baseview");
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 屏蔽多个区域,并且使用模版
        /// </summary>
        /// <param name="adid"></param>
        /// <param name="newid"></param>
        /// <param name="templatename">模版文件名称加后缀</param>
        public void CommonViewAreasByTemplateName(string adid, string newid, string templatename, bool isencode = false)
        {
            int aid      = int.Parse(adid);
            int aduserid = 0;
            var info     = DN.WeiAd.Business.AdPageInfoBLL.Instance.GetSingle(new DN.WeiAd.Models.AdPageInfoPara()
            {
                Id = aid
            });

            DN.WeiAd.Models.LogBrowseVO log = new DN.WeiAd.Models.LogBrowseVO();

            if (info != null)
            {
                ViewBag.Title         = info.Title;
                ViewBag.Content       = info.Content;
                ViewBag.StaticContent = "<span></span>";
                if (!string.IsNullOrEmpty(info.StaticContent))
                {
                    ViewBag.StaticContent = info.StaticContent;
                }
                ViewBag.UserCode = "<span></span>";
                if (!string.IsNullOrEmpty(info.UserCode))
                {
                    ViewBag.UserCode = info.UserCode;
                }
                aduserid          = info.UserId;
                log.Money         = info.Money;
                ViewBag.QcodeImg  = info.QcodeImg;
                ViewBag.QcodeImg2 = info.QcodeImg2;
            }

            log.BrowseType    = DN.Framework.Utility.ClientHelper.GetUserAgent();
            log.ClientIp      = DN.Framework.Utility.ClientHelper.ClientIP();
            log.CreateDate    = DateTime.Now;
            log.AdUrl         = Request.Url.ToString();
            log.IsMoney       = 0;
            log.AdId          = aid;
            log.AdUserId      = aduserid;
            log.Time          = int.Parse(DateTime.Now.ToString("yyyyMMdd"));
            log.ClientId      = GetClentId(Request, Response);
            log.IsMobile      = DN.Framework.Utility.ClientHelper.GetIsMobileDevice() ? 1 : 0;
            log.ReferrerUrl   = Request.UrlReferrer == null ? "" : Request.UrlReferrer.AbsoluteUri;
            log.OsName        = DN.Framework.Utility.ClientHelper.GetOsName();
            log.BrowseName    = DN.Framework.Utility.ClientHelper.GetBrowseName();
            log.BrowseVersion = DN.Framework.Utility.ClientHelper.GetBrowseVersion();
            log.Url           = Request.Url.ToString();
            var ipinfo = DN.WeiAd.Business.Services.IpTaoBaoHelper.GetIpResult(log.ClientIp);

            string html = "";

            if (isencode)
            {
                html = GetTemplateByNameEncode(templatename);
            }
            else
            {
                html = GetTemplateByName(templatename);
            }


            ViewBag.TemplateContent = html;

            if (ipinfo != null && ipinfo.code == 0 && ipinfo.data != null)
            {
                log.Country = ipinfo.data.country;
                log.Area    = ipinfo.data.area;
                log.City    = ipinfo.data.city;
                log.Region  = ipinfo.data.region;
                log.County  = ipinfo.data.county;
                log.Isp     = ipinfo.data.isp;

                if (!string.IsNullOrEmpty(log.Isp))
                {
                    if (log.Isp.IndexOf("腾讯") != -1)
                    {
                        ViewBag.Content         = "";
                        ViewBag.Title           = "";
                        ViewBag.TemplateContent = "";
                    }
                }

                if (!string.IsNullOrEmpty(log.City))
                {
                    //if (log.City.IndexOf("上海") != -1)
                    //{
                    //    ViewBag.Content = "";
                    //    ViewBag.Title = "";
                    //    ViewBag.TemplateContent = "";
                    //}
                    //if (log.City.IndexOf("天津") != -1)
                    //{
                    //    ViewBag.Content = "";
                    //    ViewBag.Title = "";
                    //    ViewBag.TemplateContent = "";
                    //}
                    //if (log.City.IndexOf("深圳") != -1)
                    //{
                    //    ViewBag.Content = "";
                    //    ViewBag.Title = "";
                    //    ViewBag.TemplateContent = "";
                    //}
                    //if (log.City.IndexOf("广州") != -1)
                    //{
                    //    ViewBag.Content = "";
                    //    ViewBag.Title = "";
                    //    ViewBag.TemplateContent = "";
                    //}
                    //if (log.City.IndexOf("北京") != -1)
                    //{
                    //    ViewBag.Content = "";
                    //    ViewBag.Title = "";
                    //    ViewBag.TemplateContent = "";
                    //}
                }
            }

            if (!string.IsNullOrEmpty(newid))
            {
                var ainfo = ArticleInfoBLL.Instance.GetSingle(new ArticleInfoPara()
                {
                    Id = int.Parse(newid)
                });
                if (ainfo != null)
                {
                    ViewBag.ArticleTitle   = ainfo.Title;
                    ViewBag.ArticleContent = ainfo.Content;

                    if (string.IsNullOrEmpty(ViewBag.Title))
                    {
                        ViewBag.Title = ainfo.Title;
                    }
                }
            }

            DN.WeiAd.Business.LogBrowseBLL.Instance.Add(log);
        }