Exemplo n.º 1
0
        private void Btn_Login_Click(object sender, EventArgs e)
        {
            int privlg = controllerObj.CheckPassword_Basic(TxtBx_username.Text, TxtBx_pass.Text);

            if (privlg > 0)
            {
                if (privlg == 1 || privlg == 8 || privlg == 9) // Successful Login
                {
                    _loggedin = true;
                    Manager func = new Manager((Privileges)privlg);
                    func.Show(this);
                }
                else if (privlg == 3)
                {
                    OtherEmployees func = new OtherEmployees();
                    func.Show(this);
                }
                else if (privlg == 4)
                {
                    Driver func = new Driver();
                    func.Show(this);
                }
                else if (privlg == 5)
                {
                    Sales func = new Sales();
                    func.Show(this);
                }
                else if (privlg == 6)
                {
                    TracksDesigner T = new TracksDesigner();
                    T.Show();
                }
                else if (privlg == 7)
                {
                    Marketing func = new Marketing();
                    func.Show(this);
                }
                else if (privlg == 100)
                {
                    Admin func = new Admin();
                    func.Show();
                }
                TxtBx_pass.Clear();
                TxtBx_username.Clear();
                // Hide the Login Form
                // Don't close it because it's the startup form and the application will exit
                this.Hide();
            }

            else
            {
                MessageBox.Show("Wrong username or password");
            }
        }
        private void Track_Designer_Click(object sender, EventArgs e)
        {
            TracksDesigner func = new TracksDesigner();

            func.Show(this);
        }