Esempio n. 1
0
        protected void btnReservation_Click(object sender, EventArgs e)
        {
            Traveller    traveller    = (Traveller)Session["traveller"];
            TravellerDAO travellerDAO = new TravellerDAO(traveller.Id, traveller.Password);
            Traveller    t            = travellerDAO.FindById();

            List <Reservation> reservations = travellerDAO.GetReservations();

            if (0 == reservations.Count)
            {
                Response.Redirect("~/ReserveCruise.aspx");
            }
            else
            {
                Response.Redirect("~/Reservations.aspx");
            }
        }
Esempio n. 2
0
        private void FillPage()
        {
            Traveller          traveller    = (Traveller)Session["traveller"];
            TravellerDAO       travellerDAO = new TravellerDAO(traveller.Id, traveller.Password);
            List <Reservation> reservations = travellerDAO.GetReservations();

            gvReservations.DataSource         = reservations;
            gvReservations.Columns[0].Visible = true;
            gvReservations.DataBind();
            gvReservations.Columns[0].Visible = false;
            if (0 == reservations.Count)
            {
                lblNoReservations.Visible = true;
            }
            else
            {
                lblNoReservations.Visible = false;
            }
            Traveller t = travellerDAO.FindById();

            lblFullName.Text   = t.ToString();
            hyperLinkHome.Text = traveller.IsAdmin ? "Home" : "Log Out";
        }