Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //统计露出数

        //得到用户id,用户网站id,广告id,广告主id,广告类型
        int shopid, adid, siteid, userid, paytype, adtype;
        if (int.TryParse(Request["shopid"], out shopid) && int.TryParse(Request["adid"], out adid) && int.TryParse(Request["userid"], out userid) && int.TryParse(Request["siteid"], out siteid) && int.TryParse(Request["paytype"], out paytype) && int.TryParse(Request["adtype"], out adtype))
        {
            //写入数据库
            wgiAdUnionSystem.Model.wgi_adv_statis model = new wgiAdUnionSystem.Model.wgi_adv_statis();
            model.advid = adid;
            model.advtype = paytype;//广告类型即为付费类型,而不是文字、图片之类的类型
            model.companyid = shopid;
            model.ip = CommonData.GetIp(this.Page);
            model.recordtime = DateTime.Now;
            model.siteid = siteid;
            model.statistype = 1;//1表示露出数
            model.userid = userid;

            try
            {
                new wgiAdUnionSystem.BLL.wgi_adv_statis().Add(model);
            }
            catch (Exception)
            {
                //throw:
            }
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //预览链接不操作
        if (Request["preview"] == "1")
        {
            Response.Write("测试成功!请拷贝广告代码至自己的网站合适的位置。");
            return;
        }

        //step1:得到用户id,用户网站id,广告id,广告主id,广告类型,付费类型
        int shopid, adid, siteid, userid, paytype, adtype;
        if (int.TryParse(Request["shopid"], out shopid) && int.TryParse(Request["adid"], out adid) && int.TryParse(Request["userid"], out userid) && int.TryParse(Request["siteid"], out siteid) && int.TryParse(Request["paytype"], out paytype) && int.TryParse(Request["adtype"], out adtype))
        {
            //写入数据库
            wgiAdUnionSystem.Model.wgi_adv_statis model = new wgiAdUnionSystem.Model.wgi_adv_statis();
            model.advid = adid;
            model.advtype = paytype;//广告类型即为付费类型,而不是文字、图片之类的类型
            model.companyid = shopid;
            model.ip = CommonData.GetIp(this.Page);
            model.recordtime = DateTime.Now;
            model.siteid = siteid;
            model.statistype = 2;//1表示点击数
            model.userid = userid;

            try
            {
                new wgiAdUnionSystem.BLL.wgi_adv_statis().Add(model);
            }
            catch (Exception)
            {
                //throw:
            }

            finally
            {
                //本次点击重定向到广告主自设的cookie记录页,并传过去从广告ID得到的广告地址
                string adurl = new wgiAdUnionSystem.BLL.wgi_adv().GetModel(adid).advlink;
                string destination = new wgiAdUnionSystem.BLL.wgi_adhost().GetModel(shopid).cookiepage;

                destination += "?union=wgiadunion&siteid=" + siteid + "&userid=" + userid + "&shopid=" + shopid + "&url=" + adurl;
                Response.Clear();
                Response.Redirect(destination);
                Response.End();
            }
        }
        else
        {
            Response.Redirect("/member/default.aspx");
        }
    }
Ejemplo n.º 3
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<wgiAdUnionSystem.Model.wgi_adv_statis> DataTableToList(DataTable dt)
 {
     List<wgiAdUnionSystem.Model.wgi_adv_statis> modelList = new List<wgiAdUnionSystem.Model.wgi_adv_statis>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         wgiAdUnionSystem.Model.wgi_adv_statis model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new wgiAdUnionSystem.Model.wgi_adv_statis();
             if(dt.Rows[n]["companyid"].ToString()!="")
             {
                 model.companyid=int.Parse(dt.Rows[n]["companyid"].ToString());
             }
             if(dt.Rows[n]["userid"].ToString()!="")
             {
                 model.userid=int.Parse(dt.Rows[n]["userid"].ToString());
             }
             if(dt.Rows[n]["siteid"].ToString()!="")
             {
                 model.siteid=int.Parse(dt.Rows[n]["siteid"].ToString());
             }
             if(dt.Rows[n]["advid"].ToString()!="")
             {
                 model.advid=int.Parse(dt.Rows[n]["advid"].ToString());
             }
             if(dt.Rows[n]["advtype"].ToString()!="")
             {
                 model.advtype=int.Parse(dt.Rows[n]["advtype"].ToString());
             }
             if(dt.Rows[n]["statistype"].ToString()!="")
             {
                 model.statistype=int.Parse(dt.Rows[n]["statistype"].ToString());
             }
             if(dt.Rows[n]["recordtime"].ToString()!="")
             {
                 model.recordtime=DateTime.Parse(dt.Rows[n]["recordtime"].ToString());
             }
             model.ip=dt.Rows[n]["ip"].ToString();
             modelList.Add(model);
         }
     }
     return modelList;
 }