private void saveChanges() { Booking book = getCurrentBooking(); foreach (Booking b in CreateBooking.getAllBooking()) { if (b.myBookingID == book.myBookingID) { b.myStatus = txtStatus.Text; saveToJson(b); } } }
private Booking getCurrentBooking() { List <Booking> bookings = CreateBooking.getAllBooking(); Booking book = new Booking("0", "0", "0", "0"); foreach (Booking b in bookings) { if (b.myBookingID == dropDownBooking.SelectedItem.Text) { book = b; } } return(book); }
protected void Page_Load(object sender, EventArgs e) { List <string> s = new List <string>(); if (!IsPostBack) { List <Booking> bookings = CreateBooking.getAllBooking(); foreach (Booking b in bookings) { s.Add(b.myBookingID); } dropDownBooking.DataSource = s; dropDownBooking.DataBind(); } }
protected void dropDownBooking_SelectedIndexChanged(object sender, EventArgs e) { if (IsPostBack) { List <Classes.User> customers = CreateCar.getAllUsers(); List <Car> cars = CreateCar.getAllCars(); List <Booking> bookings = CreateBooking.getAllBooking(); Booking book = getCurrentBooking(); foreach (Classes.User c in customers) { if (c.accountID.ToString() == book.myCustomerID) { lblUser.Text = c.getAllInfo(); } } foreach (Car c in cars) { //add car stuff here } txtStatus.Text = book.myStatus; } }