protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Customer"] != null)
            {
                var customer = (Customer)Session["Customer"];
                Session["CustomerId"] = customer.CustomerId;

                //lblWelcome.Text = "Welcome Back " + customer.CustFirstName + " " + customer.CustLastName;
                bookings            = TravelExpertsDB.GetBookings(customer.CustomerId);
                Session["Bookings"] = bookings;

                decimal totalCost = 0;
                foreach (var book in bookings)
                {
                    totalCost += book.GetTotal();
                }

                CreateBookings();
                lblTotalCost.Text = totalCost.ToString("c");
            }
            else
            {
                Response.Redirect("Default.aspx");
            }
        }
Beispiel #2
0
 // return bookings made by customer
 public List <Booking> GetBookings()
 {
     return(TravelExpertsDB.GetBookings(CustomerId));
 }