本文整理汇总了C#中Data.CountAdAnonymous方法的典型用法代码示例。如果您正苦于以下问题:C# Data.CountAdAnonymous方法的具体用法?C# Data.CountAdAnonymous怎么用?C# Data.CountAdAnonymous使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Data
的用法示例。
在下文中一共展示了Data.CountAdAnonymous方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawAd
//.........这里部分代码省略.........
DataView dvAd = dat.GetDataDV("SELECT * FROM Ads WHERE Ad_ID = " + dvAds[nextAdIndex]["Ad_ID"].ToString());
DataView dvUser = dat.GetDataDV("SELECT * FROM Users WHERE User_ID=" + dvAd[0]["User_ID"].ToString());
string templateID = dvAd[0]["Template"].ToString();
string w = "0";
string h = "0";
if (templateID == "1")
{
Template1Panel.Visible = true;
Template2Panel.Visible = false;
CustomerImage.AlternateText = dvAds[nextAdIndex]["Header"].ToString();
if (dvAds[nextAdIndex]["FeaturedPicture"].ToString() == "" || dvAds[nextAdIndex]["FeaturedPicture"] == null)
{
CustomerImage.Visible = false;
TitleLabel.Text = dat.BreakUpString(dvAds[nextAdIndex]["Header"].ToString(), 21);
}
else
{
CustomerImage.Visible = true;
GetAdSize(out w, out h, dvUser[0]["UserName"].ToString() + "\\" +
dvAds[nextAdIndex]["FeaturedPicture"].ToString(), templateID);
CustomerImage.ImageUrl = "../UserFiles/" + dvUser[0]["UserName"].ToString() +
"/" + dvAds[nextAdIndex]["FeaturedPicture"].ToString();
CustomerImage.Width = int.Parse(w);
CustomerImage.Height = int.Parse(h);
TitleLabel.Text = dat.BreakUpString(dvAds[nextAdIndex]["Header"].ToString(), 10);
}
TitleLabel.Text = dvAds[nextAdIndex]["Header"].ToString();
if (windowT)
{
TitleLabel.Attributes.Add("onclick", "CloseWindow('" + "../" + dat.MakeNiceName(dvAds[nextAdIndex]["Header"].ToString()) +
"_" + dvAds[nextAdIndex]["Ad_ID"].ToString() + "_Ad" + "');");
ReadMoreLink.Attributes.Add("onclick", "CloseWindow('" + "../" + dat.MakeNiceName(dvAds[nextAdIndex]["Header"].ToString()) +
"_" + dvAds[nextAdIndex]["Ad_ID"].ToString() + "_Ad" + "');");
A1.HRef = "javascript:CloseWindow('../" + dat.MakeNiceName(dvAds[nextAdIndex]["Header"].ToString()) +
"_" + dvAds[nextAdIndex]["Ad_ID"].ToString() + "_Ad');";
}
else
{
TitleLabel.NavigateUrl = "../" + dat.MakeNiceName(dvAds[nextAdIndex]["Header"].ToString()) +
"_" + dvAds[nextAdIndex]["Ad_ID"].ToString() + "_Ad";
ReadMoreLink.NavigateUrl = "../" + dat.MakeNiceName(dvAds[nextAdIndex]["Header"].ToString()) +
"_" + dvAds[nextAdIndex]["Ad_ID"].ToString() + "_Ad";
A1.HRef = "../" + dat.MakeNiceName(dvAds[nextAdIndex]["Header"].ToString()) +
"_" + dvAds[nextAdIndex]["Ad_ID"].ToString() + "_Ad";
}
BodyLabel.Text = dat.BreakUpString(dvAds[nextAdIndex]["FeaturedSummary"].ToString(), 21);
}
else
{
Template1Panel.Visible = false;
Template2Panel.Visible = true;
Image1.AlternateText = dvAds[nextAdIndex]["Header"].ToString();
if (dvAds[nextAdIndex]["FeaturedPicture"].ToString() == "" || dvAds[nextAdIndex]["FeaturedPicture"] == null)
{
Image1.Visible = false;
}
else
{
GetAdSize(out w, out h, dvUser[0]["UserName"].ToString() + "\\" +
dvAds[nextAdIndex]["FeaturedPicture"].ToString(), templateID);
Image1.ImageUrl = "../UserFiles/" + dvUser[0]["UserName"].ToString() +
"/" + dvAds[nextAdIndex]["FeaturedPicture"].ToString();
Image1.Width = int.Parse(w);
Image1.Height = int.Parse(h);
}
if (windowT)
{
Image1.Attributes.Add("onclick", "CloseWindow('" + "../" + dat.MakeNiceName(dvAds[nextAdIndex]["Header"].ToString()) +
"_" + dvAds[nextAdIndex]["Ad_ID"].ToString() + "_Ad" + "');");
}
else
{
Image1.Attributes.Add("onclick", "window.location = '" + "../" + dat.MakeNiceName(dvAds[nextAdIndex]["Header"].ToString()) +
"_" + dvAds[nextAdIndex]["Ad_ID"].ToString() + "_Ad" + "'");
}
}
if (Request.Url.AbsolutePath.ToLower() == "/group.aspx")
{
dat.CountGroupAds(int.Parse(dvAds[nextAdIndex]["Ad_ID"].ToString()));
}
else
{
if (Session["User"] != null)
{
dat.CountAd(true, dvAds);
}
else
{
dat.CountAdAnonymous(true, dvAds);
}
}
}
示例2: 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();
}
}
}