Example #1
0
        private void saveChanges()
        {
            Booking book = getCurrentBooking();

            foreach (Booking b in CreateBooking.getAllBooking())
            {
                if (b.myBookingID == book.myBookingID)
                {
                    b.myStatus = txtStatus.Text;
                    saveToJson(b);
                }
            }
        }
Example #2
0
        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);
        }
Example #3
0
        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();
            }
        }
Example #4
0
        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;
            }
        }