private void pictureBoxBack_Click(object sender, EventArgs e) { FunctionalWindow child = new FunctionalWindow(); ActiveForm.Hide(); child.Show(); }
private void pictureBoxLoginButton_Click(object sender, EventArgs e) { try { string user = comboBoxUser.SelectedItem.ToString(); string arrayUser; for (int i = 0; i < array.Count; i++) { if ((arrayUser = array[i].getUserName()).Equals(user)) { if (textBoxPass.Text == array[i].getPassword()) { FunctionalWindow.PopDISP(i, array[i].getName(), array[i].getLastName(), array[i].getUserName(), array[i].getTypeUser()); FunctionalWindow child1 = new FunctionalWindow(); ActiveForm.Hide(); child1.Show(); } else { if (MessageBox.Show("Invalid Password, would you like to retrieve your password?", "Error", MessageBoxButtons.YesNo, MessageBoxIcon.Error) == DialogResult.Yes) { ForgotPass child = new ForgotPass(); ActiveForm.Hide(); child.Show(); } else { textBoxPass.Text = ""; } } } } } catch (Exception) { MessageBox.Show("Please select a user to proceed"); } }