Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }

            if (Request.QueryString["campaignID"] == null)
            {
                var page = ServiceContext.GetPageBySiteMarkerName(Website, "Event Listings");

                Response.Redirect(ServiceContext.GetUrl(page));
            }

            Details.DataSource = new[] { Campaign };
            Details.DataBind();

            var registrationButton = (Button)Details.FindControl("RegisterButton");
            var message            = (Label)Details.FindControl("Message");

            if (Campaign.MSA_StartDateTime > DateTime.Now)
            {
                switch (Campaign.StatusCode.Value)
                {
                case 200001:
                    registrationButton.Text = "Register for this Event";
                    message.Text            = "*Event is waitlisted";
                    break;

                case 200002:
                    registrationButton.Visible = false;
                    message.Text = "This event is Sold Out.";
                    break;

                default:
                    registrationButton.Text = "Register for this Event";
                    break;
                }
            }
            else
            {
                registrationButton.Visible = false;
                message.Text = "*Event occurs in the past";
            }
        }