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"); } }
// return bookings made by customer public List <Booking> GetBookings() { return(TravelExpertsDB.GetBookings(CustomerId)); }