コード例 #1
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            login    = textBoxLogin.Text;
            password = textBoxPassword.Text;
            db       = new Database(login, password);
            if (!db.OpenConnection())
            {
                MessageBox.Show("Niepoprawne dane logowania");
            }
            else
            {
                if (login == "admin")
                {
                    pos = Position.admin;
                }
                else if (login == "menadżer")
                {
                    pos = Position.manager;
                }
                else
                {
                    pos = Position.worker;
                }
                Login2 f = new Login2(pos, this);
                f.Show();
                this.Hide();

                ///TODO: sprawdzenie logowania, nowa forma pobiera enum
            }
        }
コード例 #2
0
 public FormMainPanelAdmin(Login2 fl)
 {
     fx = fl;
     InitializeComponent();
 }
コード例 #3
0
 public FormMainPanelManager(Login2 fl)
 {
     fx = fl;
     InitializeComponent();
 }
コード例 #4
0
 public FormMainPanelWorker(Login2 fr)
 {
     fx = fr;
     InitializeComponent();
 }