protected void Page_Load(object sender, EventArgs e)
        {
            //Console.WriteLine("Loaded");
            //this.Form.Target = "_blank";//Open new page
            if (!IsPostBack)
            {
                List <Classes.User> customers = CreateCar.getAllUsers();
                List <string>       st        = new List <string>();
                foreach (Classes.User C in customers)
                {
                    st.Add(C.accountID.ToString());
                }
                DropDownCustomer.DataSource = st;
                DropDownCustomer.DataBind();

                //List<Customer> customers = Classes.User.getAllInfo();
            }
        }
        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;
        }
示例#3
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;
            }
        }