コード例 #1
0
 public FrmLogin()
 {
     InitializeComponent();
     staffBUS    = new StaffBUS();
     firstPress1 = true;
     firstPress2 = true;
 }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        private void btnLogOut_Click(object sender, RoutedEventArgs e)
        {
            HideLoginMenu();
            StaffBUS.Logout();
            UserControl userControl = new LoginControl();

            ReplaceMainControl(userControl);
        }
コード例 #4
0
        public FrmPersonalInformation(Staff staff)
        {
            InitializeComponent();
            this.staff = staff;
            staffBUS   = new StaffBUS();
            subjectBUS = new SubjectBUS();
            facultyBUS = new FacultyBUS();

            faculties = facultyBUS.GetList();
        }
コード例 #5
0
 public FrmChangePassword(Staff staff)
 {
     InitializeComponent();
     this.staff = staff;
     staffBUS   = new StaffBUS();
 }
コード例 #6
0
 public FrmChangePassword()
 {
     InitializeComponent();
     staff    = new Staff();
     staffBUS = new StaffBUS();
 }