Beispiel #1
0
        private void SignInButton_Click(object sender, EventArgs e)
        {
            string username = UserNameInput.Text;
            string password = PasswordInput.Text;

            if (UserManagement.loginUser(username, password))
            {
                //we are good to proceed to main screen window
                this.Hide();


                ViewVehiclesScreen NewScreen = new ViewVehiclesScreen();
                NewScreen.VehicleManagement = VehicleManagement;
                NewScreen.UserManagement    = UserManagement;


                NewScreen.Tag = this;
                MainScreen MainScreen = new MainScreen(NewScreen);
                NewScreen.SetParentForm(MainScreen);

                //pass the order and customer objects to the new window
                MainScreen.UserManagement    = UserManagement;
                MainScreen.VehicleManagement = VehicleManagement;
                MainScreen.Show(this);
            }
            else
            {
                MessageBox.Show("Sorry, either the username or password are not correct.");
            }
        }
Beispiel #2
0
        private void ViewVehicleBtn_Click(object sender, EventArgs e)
        {
            childForm.Dispose();
            ContentPanel.Controls.Remove(childForm);

            ViewVehiclesScreen ViewVehicleChild = new ViewVehiclesScreen();

            ViewVehicleChild.SetParentForm(this);
            ViewVehicleChild.VehicleManagement = VehicleManagement;
            ViewVehicleChild.UserManagement    = UserManagement;
            childForm          = ViewVehicleChild;
            childForm.TopLevel = false;
            ContentPanel.Controls.Add(childForm);
            childForm.Show();
            childForm.BringToFront();
        }