private void gobutton_Click(object sender, EventArgs e) { workserver.createConnection(); if (PassswordWithLogin(logintext.Text, passwordtext.Text) && workserver.logIn(logintext.Text, passwordtext.Text)) { managerOfUsers = new ManageUsers(logintext.Text, passwordtext.Text, workserver.getEmailForManageUser(logintext.Text, passwordtext.Text)); mainInterface = new MainInterface(logintext.Text, this); workserver.loseConnection(); cleanTextBoxes(); this.Hide(); mainInterface.Show(); } else if (PassswordWithLogin(logintext.Text, passwordtext.Text) && /*logintext.Text == admin && passwordtext.Text == adminPassword*/ workserver.adminIn(logintext.Text, passwordtext.Text)) { workserver.loseConnection(); cleanTextBoxes(); this.Hide(); adminForm = new AdminForm(this); adminForm.Show(); } else if (PassswordWithLogin(passwordtext.Text, logintext.Text) && /*logintext.Text == storekeeper && passwordtext.Text == storekeeperPassword*/ workserver.storeKeeperIn(logintext.Text, passwordtext.Text)) { workserver.loseConnection(); cleanTextBoxes(); this.Hide(); storekeeperForm = new Storekeeper(this); storekeeperForm.Show(); } else { setWarningLabel(true); passwordReset(); } workserver.loseConnection(); }