private void contin_Click(object sender, EventArgs e) { infoRecovery.Text = ""; workServerRecovery.createConnection(); if (workServerRecovery.CheckEmail(emailtext.Text)) { if (CheckPassword(newpasswordtext.Text, repeatpasswordtext.Text) && isValid(emailtext.Text)) { workServerRecovery.updatePassword(emailtext.Text, newpasswordtext.Text); SendEmail(); emailtext.Text = ""; newpasswordtext.Text = ""; repeatpasswordtext.Text = ""; } else { infoRecovery.Text = "Пароли не совпадают"; repeatpasswordtext.Clear(); newpasswordtext.Clear(); } } else { infoRecovery.Text = "Проверьте правильность написания почты"; emailtext.Text = ""; } }
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(); }