本文整理汇总了C#中Data.HasEventPassed方法的典型用法代码示例。如果您正苦于以下问题:C# Data.HasEventPassed方法的具体用法?C# Data.HasEventPassed怎么用?C# Data.HasEventPassed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Data
的用法示例。
在下文中一共展示了Data.HasEventPassed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
HttpCookie cookie = Request.Cookies["BrowserDate"];
if (cookie == null)
{
cookie = new HttpCookie("BrowserDate");
cookie.Value = DateTime.Now.ToString();
cookie.Expires = DateTime.Now.AddDays(22);
Response.Cookies.Add(cookie);
}
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
if (Session["User"] == null)
{
Response.Redirect("~/Home.aspx");
}
if (Request.QueryString["ID"] == null)
Response.Redirect("Home.aspx");
if (dat.HasEventPassed(Request.QueryString["ID"].ToString()))
{
DataView dvName = dat.GetDataDV("SELECT * FROM Events WHERE ID="+
Request.QueryString["ID"].ToString());
Response.Redirect(dat.MakeNiceName(dvName[0]["Header"].ToString()) + "_" +
Request.QueryString["ID"].ToString() + "_Event");
}
}
示例2: Page_Load
//.........这里部分代码省略.........
DataSet ds = dat.GetData("SELECT * FROM Events WHERE ID=" + ID);
DataView dv = new DataView(ds.Tables[0], "", "", DataViewRowState.CurrentRows);
if (Session["User"] != null)
{
if (dv[0]["Owner"].ToString() == Session["User"].ToString())
{
EditLink.Visible = true;
ContactOwnerLink.Visible = false;
}
else
{
if (dv[0]["Owner"] != null && dv[0]["Owner"].ToString() != "")
{
DataView dvU = dat.GetDataDV("SELECT * FROM Users WHERE User_ID=" + dv[0]["Owner"].ToString());
EditLink.Visible = false;
ContactOwnerLink.Visible = true;
ContactOwnerLink.HRef = dvU[0]["UserName"].ToString() + "_friend";
}
else
{
ContactOwnerLink.Visible = false;
EditLink.Visible = true;
}
}
}
else
{
EditLink.Visible = false;
ContactOwnerLink.Visible = false;
}
//Overwrite everything if the event has passed
if (dat.HasEventPassed(eventID))
{
OwnerPanel.Visible = false;
EditLink.Visible = false;
PassedLink.Visible = true;
}
Session["FlagID"] = ID;
Session["FlagType"] = "E";
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
if (bool.Parse(ds.Tables[0].Rows[0]["Live"].ToString()))
{
PricePanel.Visible = false;
if (ds.Tables[0].Rows[0]["MaxPrice"] != null)
{
if (ds.Tables[0].Rows[0]["MaxPrice"].ToString() != "")
{
MinPrice.Text = ds.Tables[0].Rows[0]["MinPrice"].ToString().Replace(".00", "");
MaxPrice.Text = ds.Tables[0].Rows[0]["MaxPrice"].ToString().Replace(".00", "");
PricePanel.Visible = true;
}
}
EventName.Text = "<a id=\"" + dat.MakeNiceNameFull(ds.Tables[0].Rows[0]["Header"].ToString()) + "\" class=\"aboutLink\" href=\"http://" + Request.Url.Authority + "/" +
dat.MakeNiceName(ds.Tables[0].Rows[0]["Header"].ToString()) +
"_" + ID.ToString() + "_Event\"><h1>" +
dat.BreakUpString(ds.Tables[0].Rows[0]["Header"].ToString(), 50) + "</h1></a>";
Session["Subject"] = "Re: " + ds.Tables[0].Rows[0]["Header"].ToString();
Session["CommentSubject"] = "Re: " + ds.Tables[0].Rows[0]["Header"].ToString();
示例3: Page_Load
//.........这里部分代码省略.........
BillingCountry.DataSource = dsCountries;
BillingCountry.DataTextField = "country_name";
BillingCountry.DataValueField = "country_id";
BillingCountry.DataBind();
BillingCountry.SelectedValue = "223";
BillingStateTextBox.Text = "AL";
CardTypeDropDown.Items.Add(new ListItem("Visa", "Visa"));
CardTypeDropDown.Items.Add(new ListItem("MasterCard", "MasterCard"));
CardTypeDropDown.Items.Add(new ListItem("Discover", "Discover"));
CardTypeDropDown.Items.Add(new ListItem("American Express", "Amex"));
ChangeStateAction(BillingCountry, new EventArgs());
ShowVideoPictureLiteral.Text = "";
Session.Remove("Featured");
Session["Featured"] = null;
Session["NewVenue"] = null;
Session.Remove("NewVenue");
Session["EventCategoriesSet"] = null;
Session.Remove("EventCategoriesSet");
PostItButton.SERVER_CLICK += PostIt;
PostItButton.SERVER_CLICK -= ModifyIt;
DataSet ds = new DataSet();
try
{
if (Session["User"] != null)
{
Session["EffectiveUserName"] = Session["UserName"].ToString();
if (Request.QueryString["edit"] != null)
{
if (bool.Parse(Request.QueryString["edit"].ToString()))
{
string IDi = Request.QueryString["ID"].ToString();
isEdit.Text = "True";
eventID.Text = IDi;
if (dat.HasEventPassed(IDi))
{
DataView dvName = dat.GetDataDV("SELECT * FROM Events WHERE ID=" + IDi);
Response.Redirect(dat.MakeNiceName(dvName[0]["Header"].ToString()) + "_" + IDi + "_Event");
}
fillEvent(IDi, true);
//PostItButton.Click -= new ImageClickEventHandler(PostIt);
//PostItButton.Click += new ImageClickEventHandler(ModifyIt);
}
}
else if (Request.QueryString["copy"] != null)
{
if (bool.Parse(Request.QueryString["copy"].ToString()))
{
string IDi = Request.QueryString["ID"].ToString();
fillEvent(IDi, false);
DateSelectionsListBox.Items.Clear();
}
}
UserName = Session["UserName"].ToString();
UserNameLabel.Text = UserName;
}
else
{
Response.Redirect("~/login");
}
}
catch (Exception ex)
{
MessagePanel.Visible = true;
YourMessagesLabel.Text = ex.ToString();
//Session.Abandon();
//FormsAuthentication.SignOut();
//Response.Redirect("~/enter-event");
}
//YourMessagesLabel.Text = "";
//MessagePanel.Visible = false;
}
else
{
if (Session["LocationVenues"] != null)
fillVenues((DataSet)Session["LocationVenues"]);
if (Session["NewVenue"] != null)
{
TimeFrameDiv.InnerHtml = dat.GetDataDV("SELECT * FROM Venues WHERE ID=" + Session["NewVenue"].ToString())[0]["Name"].ToString();
}
}
if (Session["User"] == null)
{
Response.Redirect("home");
}
}