Beispiel #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string weixin = context.Request.Params["weixin"] ?? "";
            string css    = context.Request.Params["css"] ?? "";
            string url    = context.Request.Params["_url"] ?? "";

            //还没有做完

            try
            {
                DN.Framework.Utility.LogHelper.Write(string.Format("weixin={0},css={1}", weixin, css));

                LogQcodeInfoVO log = new LogQcodeInfoVO();

                log.CopyText      = weixin;
                log.Url           = url;
                log.BrowseType    = DN.Framework.Utility.ClientHelper.GetUserAgent();
                log.ClientIp      = DN.Framework.Utility.ClientHelper.ClientIP();
                log.CreateDate    = DateTime.Now;
                log.IsMoney       = 0;
                log.Time          = int.Parse(DateTime.Now.ToString("yyyyMMdd"));
                log.ClientId      = GetClentId(context.Request, context.Response);
                log.IsMobile      = DN.Framework.Utility.ClientHelper.GetIsMobileDevice() ? 1 : 0;
                log.ReferrerUrl   = context.Request.UrlReferrer == null ? "" : context.Request.UrlReferrer.AbsoluteUri;
                log.OsName        = DN.Framework.Utility.ClientHelper.GetOsName();
                log.BrowseName    = DN.Framework.Utility.ClientHelper.GetBrowseName();
                log.BrowseVersion = DN.Framework.Utility.ClientHelper.GetBrowseVersion();

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

                LogQcodeInfoBLL.Instance.Add(log);
            }
            catch (Exception)
            {
            }

            context.Response.ClearContent();
            context.Response.End();
        }
        public override bool Edit(LogQcodeInfoVO m)
        {
            CodeCommand command = new CodeCommand();

            command.CommandText = EDIT;

            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@CopyText", Value = ParameterHelper.ConvertValue(m.CopyText)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Url", Value = ParameterHelper.ConvertValue(m.Url)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@ClientIp", Value = ParameterHelper.ConvertValue(m.ClientIp)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@BrowseType", Value = ParameterHelper.ConvertValue(m.BrowseType)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@CreateDate", Value = ParameterHelper.ConvertValue(m.CreateDate)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Money", Value = ParameterHelper.ConvertValue(m.Money)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@IsMoney", Value = ParameterHelper.ConvertValue(m.IsMoney)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Time", Value = ParameterHelper.ConvertValue(m.Time)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@ClientId", Value = ParameterHelper.ConvertValue(m.ClientId)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@IsMobile", Value = ParameterHelper.ConvertValue(m.IsMobile)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@ReferrerUrl", Value = ParameterHelper.ConvertValue(m.ReferrerUrl)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@BrowseName", Value = ParameterHelper.ConvertValue(m.BrowseName)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@BrowseVersion", Value = ParameterHelper.ConvertValue(m.BrowseVersion)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@OsName", Value = ParameterHelper.ConvertValue(m.OsName)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Country", Value = ParameterHelper.ConvertValue(m.Country)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Area", Value = ParameterHelper.ConvertValue(m.Area)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Region", Value = ParameterHelper.ConvertValue(m.Region)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@City", Value = ParameterHelper.ConvertValue(m.City)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@County", Value = ParameterHelper.ConvertValue(m.County)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Isp", Value = ParameterHelper.ConvertValue(m.Isp)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@IpSource", Value = ParameterHelper.ConvertValue(m.IpSource)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Id", Value = ParameterHelper.ConvertValue(m.Id)
            });


            int result = DbProxyFactory.Instance.Proxy.ExecuteNonQuery(command);

            if (result >= 1)
            {
                return(true);
            }

            return(false);
        }
 public override string GetOtherConditionByModel(LogQcodeInfoVO m)
 {
     return("");
 }
        public override int InsertIdentityId(LogQcodeInfoVO m)
        {
            CodeCommand command = new CodeCommand();

            command.CommandText = INSERT + "; select @@Identity";

            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@CopyText", Value = ParameterHelper.ConvertValue(m.CopyText)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Url", Value = ParameterHelper.ConvertValue(m.Url)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@ClientIp", Value = ParameterHelper.ConvertValue(m.ClientIp)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@BrowseType", Value = ParameterHelper.ConvertValue(m.BrowseType)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@CreateDate", Value = ParameterHelper.ConvertValue(m.CreateDate)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Money", Value = ParameterHelper.ConvertValue(m.Money)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@IsMoney", Value = ParameterHelper.ConvertValue(m.IsMoney)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Time", Value = ParameterHelper.ConvertValue(m.Time)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@ClientId", Value = ParameterHelper.ConvertValue(m.ClientId)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@IsMobile", Value = ParameterHelper.ConvertValue(m.IsMobile)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@ReferrerUrl", Value = ParameterHelper.ConvertValue(m.ReferrerUrl)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@BrowseName", Value = ParameterHelper.ConvertValue(m.BrowseName)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@BrowseVersion", Value = ParameterHelper.ConvertValue(m.BrowseVersion)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@OsName", Value = ParameterHelper.ConvertValue(m.OsName)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Country", Value = ParameterHelper.ConvertValue(m.Country)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Area", Value = ParameterHelper.ConvertValue(m.Area)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Region", Value = ParameterHelper.ConvertValue(m.Region)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@City", Value = ParameterHelper.ConvertValue(m.City)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@County", Value = ParameterHelper.ConvertValue(m.County)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Isp", Value = ParameterHelper.ConvertValue(m.Isp)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@IpSource", Value = ParameterHelper.ConvertValue(m.IpSource)
            });


            var result = DbProxyFactory.Instance.Proxy.ExecuteScalar(command);

            return(int.Parse(result.ToString()));
        }
 public override string GetOrderByModel(LogQcodeInfoVO m)
 {
     return("");
 }