当前位置: 首页>>代码示例>>C#>>正文


C# Data.GetAdSet方法代码示例

本文整理汇总了C#中Data.GetAdSet方法的典型用法代码示例。如果您正苦于以下问题:C# Data.GetAdSet方法的具体用法?C# Data.GetAdSet怎么用?C# Data.GetAdSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Data的用法示例。


在下文中一共展示了Data.GetAdSet方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Timer1_Tick

    protected void Timer1_Tick(object sender, EventArgs e)
    {
        try
        {
            HttpCookie cookie = Request.Cookies["BrowserDate"];
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

            if (Session["AD4Count"] == null || Session["AD4DV"] == null)
                dat.GetAdSet(4, false);

            DataView dvAds = (DataView)Session["AD4DV"];
            int currentAdIndex = int.Parse(Session["AD4Count"].ToString());

            if (currentAdIndex < dvAds.Count - 1)
            {
                currentAdIndex++;
            }
            else
            {
                currentAdIndex = 0;
            }

            //Draw the next ad
            DrawAd(currentAdIndex, dvAds);
            Session["AD4Count"] = currentAdIndex;
            //Only count the ad when user is logged in.
            //If user not logged in, can't charge for the ads.

            //WE DONT NEED TO COUNT THE AD HERE, AD1 COUNTS ALL THE ADS FOR US

            //if (Session["User"] != null)
            //{
            //    dat.CountAd(false);
            //}
        }
        catch (Exception ex)
        {
            BodyLabel.Text = ex.ToString();
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:40,代码来源:Ad4.ascx.cs

示例2: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        //Response.Cache.SetCacheability(HttpCacheability.NoCache);
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

        try
        {
            if (!IsPostBack)
            {
                if (Session["User"] != null)
                {
                    if (Session["AD4Count"] == null || Session["AD4DV"] == null)
                        dat.GetAdSet(4, false);
                    else
                    {
                        if (Application[Session["User"].ToString() + "_Normal"] != null)
                        {
                            if (Application[Session["User"].ToString() + "_Normal"].ToString() == "set")
                            {
                                dat.GetAdSet(4, false);
                                Application[Session["User"].ToString() + "_Normal"] = null;
                            }
                        }
                    }
                }
                else
                {
                    if (Session["AD4Count"] == null || Session["AD4DV"] == null)
                        dat.GetAdSet(4, false);
                }

                DataBind2((DataView)Session["AD4DV"]);
            }
        }
        catch (Exception ex)
        {
            BodyLabel.Text = ex.ToString();
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:40,代码来源:Ad4.ascx.cs

示例3: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        //Response.Cache.SetCacheability(HttpCacheability.NoCache);

        try
        {
            if (!IsPostBack)
            {
                HttpCookie cookie = Request.Cookies["BrowserDate"];
                Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
                DateTime timeNow = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"));

                DataView dvUserAds;
                int lastSeen = 0;
                if (Request.Url.AbsolutePath.ToLower() == "/group.aspx")
                {
                    //If we are in the group, all we need to do is get
                    //ads that are in this location and in the groups categories
                    //plus ads that are only in the location and have displayToAll = 'True'
                    string commandStr = "";

                    dvUserAds = dat.GetGroupAds(Request.QueryString["ID"].ToString(), ref commandStr, ref lastSeen);
                }
                else
                {
                    dvUserAds = dat.GetAdSet(1, true);
                }

                DataBind2(dvUserAds, lastSeen);
            }
        }
        catch (Exception ex)
        {
            Errorlabel.Text = ex.ToString() + "<br/><br/>" + Request.Url.AbsolutePath.ToLower();
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:36,代码来源:BigAd.ascx.cs

示例4: Timer1_Tick

    protected void Timer1_Tick(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        try
        {
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

            int currentAdIndex = 0;
            DataView dvAds = new DataView();
            if (Request.Url.AbsolutePath.ToLower() == "/group.aspx")
            {
                string commandStr = "";
                int lastSeen = 0;
                dvAds = dat.GetGroupAds(Request.QueryString["ID"].ToString(), ref commandStr, ref lastSeen);

                DataView dv = dat.GetDataDV("SELECT * FROM BigAdStatistics_Anonymous WHERE isGroup='True' AND SessionNum = '" +
                    Session["BigAnonymousGroupSession"].ToString() + "'");
                if (int.Parse(dv[0]["LastSeenIndex"].ToString()) == dat.NUMB_TOTAL_BIG_ADS - 1)
                    currentAdIndex = 0;
                else
                    currentAdIndex = int.Parse(dv[0]["LastSeenIndex"].ToString()) + 1;
            }
            else
            {
                if (Session["ADBigDV"] == null || Session["ADBigCount"] == null)
                    dat.GetAdSet(1, true);

                dvAds = (DataView)Session["ADBigDV"];
                currentAdIndex = int.Parse(Session["ADBigCount"].ToString());

                if (currentAdIndex < dvAds.Count - 1)
                {
                    currentAdIndex++;
                }
                else
                {
                    currentAdIndex = 0;
                }
            }

            //Draw the next ad
            DrawAd(currentAdIndex, dvAds);
            Session["ADBigCount"] = currentAdIndex;
        }
        catch (Exception ex)
        {
            Errorlabel.Text = ex.ToString();
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:49,代码来源:BigAd.ascx.cs

示例5: Timer1_Tick

    protected void Timer1_Tick(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        try
        {
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

            if (Session["AD1Count"] == null || Session["AD1DV"] == null)
                dat.GetAdSet(1, false);

            DataView dvAds = (DataView)Session["AD1DV"];

            int currentAdIndex = int.Parse(Session["AD1Count"].ToString());

            if (currentAdIndex < dvAds.Count - 1)
            {
                currentAdIndex++;
            }
            else
            {
                currentAdIndex = 0;
            }

            //Draw the next ad
            DrawAd(currentAdIndex, dvAds);
            Session["AD1Count"] = currentAdIndex;
            //Only count the ad when user is logged in.
            //If user not logged in, can't charge for the ads.

            if (Session["User"] != null)
            {
                dat.CountAd(false, dvAds);
            }
            else
            {
                dat.CountAdAnonymous(false, dvAds);
            }
        }
        catch (Exception ex)
        {

            BodyLabel.Text = ex.ToString();
            if (Session["testmessage"] != null)
            {
                BodyLabel.Text += Session["testmessage"].ToString();
            }
        }
    }
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:48,代码来源:Ad1.ascx.cs


注:本文中的Data.GetAdSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。