Пример #1
0
        protected void DropDownCustomer_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <Car>          cars      = CreateCar.getAllCars();//Change to only the customers car
            List <Classes.User> customers = CreateCar.getAllUsers();

            Classes.User currentCustomer = customers[0];
            foreach (Classes.User c in customers)
            {
                if (c.accountID == DropDownCustomer.SelectedValue.ToString())
                {
                    currentCustomer = c;
                }
            }
            List <string> s = new List <string>();

            foreach (Car c in currentCustomer.listOfCars)
            {
                s.Add(c.CarId);
            }
            DropDownCar.DataSource = s;
            DropDownCar.DataBind();
            carss = cars;
        }
Пример #2
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;
            }
        }