Пример #1
0
        protected void imgBookTickets_Click(object sender, ImageClickEventArgs e)
        {
            if (HttpContext.Current.Session["userInfo"] != null)
            {
                var imgBookTickets = sender as ImageButton;
                var row            = imgBookTickets.NamingContainer;
                var homeTeamID     = (row.FindControl("lblHomeTeamID") as Label).Text;
                var awayTeamID     = (row.FindControl("lblAwayTeamID") as Label).Text;
                var homeTeamName   = (row.FindControl("lblHomeTeam") as Label).Text;
                var awayTeamName   = (row.FindControl("lblAwayTeam") as Label).Text;
                var homeTeamURL    = (row.FindControl("lblHTUrl") as Label).Text;
                var awayTeamURL    = (row.FindControl("lblATUrl") as Label).Text;
                var venue          = (row.FindControl("lblVenue") as Label).Text;

                var bookingFixture = new EverythingFootballDemo.DAL.BookingFixture();
                bookingFixture.HomeTeamName    = homeTeamName;
                bookingFixture.HomeTeamUrl     = homeTeamURL;
                bookingFixture.AwayTeamName    = awayTeamName;
                bookingFixture.AwayTeamUrl     = awayTeamURL;
                bookingFixture.venue           = venue;
                bookingFixture.CompetitionName = ddlCompetitions.SelectedItem.Text;
                bookingFixture.HomeTeamID      = Convert.ToInt16(homeTeamID);
                bookingFixture.AwayTeamID      = Convert.ToInt16(awayTeamID);

                Session["bookingFixture"] = bookingFixture;
                Response.Redirect("BookTickets.aspx");
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "confirn", "LoginReqd()", true);
            }
        }
Пример #2
0
        private void populateFixtureInfo()
        {
            if (Session["bookingFixture"] != null)
            {
                var bookingFixtureInfo = new EverythingFootballDemo.DAL.BookingFixture();
                bookingFixtureInfo = (EverythingFootballDemo.DAL.BookingFixture)Session["bookingFixture"];

                lblHomeTeam.Text        = bookingFixtureInfo.HomeTeamName;
                imgHomeTeam.ImageUrl    = bookingFixtureInfo.HomeTeamUrl;
                lblAwayTeam.Text        = bookingFixtureInfo.AwayTeamName;
                imgAwayTeam.ImageUrl    = bookingFixtureInfo.AwayTeamUrl;
                lblCompetitionName.Text = bookingFixtureInfo.CompetitionName;
                lblTeamID.Text          = bookingFixtureInfo.HomeTeamID.ToString();
                GetHomeTeamInfo(bookingFixtureInfo.HomeTeamID.ToString());
            }
        }