本文整理汇总了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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
}