public FrmLogin() { InitializeComponent(); staffBUS = new StaffBUS(); firstPress1 = true; firstPress2 = true; }
private void btnLogin_Click(object sender, EventArgs e) { //Check empty username if (String.IsNullOrEmpty(txtUsername.Text)) { MessageBox.Show("Please enter username", "Message", MessageBoxButtons.OK); txtUsername.Focus(); return; } //Authorize account if (UserBUS.valid(txtUsername.Text, txtPassword.Text)) { int id = UserBUS.getStaffID(txtUsername.Text); Staff staff = StaffBUS.getByID(id); frmMain _frmMain = new frmMain(staff); this.Hide(); _frmMain.ShowDialog(); this.Close(); } else { MessageBox.Show("Incorrect account/password. Please enter again", "Message", MessageBoxButtons.OK); } }
private void btnLogOut_Click(object sender, RoutedEventArgs e) { HideLoginMenu(); StaffBUS.Logout(); UserControl userControl = new LoginControl(); ReplaceMainControl(userControl); }
public FrmPersonalInformation(Staff staff) { InitializeComponent(); this.staff = staff; staffBUS = new StaffBUS(); subjectBUS = new SubjectBUS(); facultyBUS = new FacultyBUS(); faculties = facultyBUS.GetList(); }
public FrmChangePassword(Staff staff) { InitializeComponent(); this.staff = staff; staffBUS = new StaffBUS(); }
public FrmChangePassword() { InitializeComponent(); staff = new Staff(); staffBUS = new StaffBUS(); }