Пример #1
0
        private void addButton_Click(object sender, EventArgs e)
        {
            allUsers = Program.getUsersFromXMLFile();
            foreach (User user in allUsers)
            {
                if (user.username == currentUser.username)
                {
                    currentUser = user;
                }
            }


            if (currentUser.license == "null" || currentUser.email == "null" || currentUser.creditcard == "null" || currentUser.address1 == "null" ||
                currentUser.address2 == "null" || currentUser.phone == "null")
            {
                MessageBox.Show("Please ensure all fields are complete before renting a vehicle.");
                CarRentalProfile form = new CarRentalProfile(currentUser);
                form.ShowDialog();
                return;
            }

            CarRentalConfirm frm = new CarRentalConfirm((Car)carBindingSource[carGridView.CurrentCell.RowIndex], currentUser);

            frm.ShowDialog();
        }
Пример #2
0
 private void profileButton_Click(object sender, EventArgs e)
 {
     allUsers = Program.getUsersFromXMLFile();
     foreach (User user in allUsers)
     {
         if (user.username == currentUser.username)
         {
             currentUser = user;
             CarRentalProfile frm = new CarRentalProfile(currentUser);
             frm.ShowDialog();
         }
     }
 }