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 } }
public FormMainPanelAdmin(Login2 fl) { fx = fl; InitializeComponent(); }
public FormMainPanelManager(Login2 fl) { fx = fl; InitializeComponent(); }
public FormMainPanelWorker(Login2 fr) { fx = fr; InitializeComponent(); }