private void btnLogin_Click(object sender, EventArgs e) { if (ValidationCheck()) { APIKey = new Puush().Login(txtEmail.Text, txtPassword.Text); if (!string.IsNullOrEmpty(APIKey)) { DialogResult = DialogResult.OK; Close(); } else { MessageBox.Show("Login failed.", "Authentication failure", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void btnPuushLogin_Click(object sender, EventArgs e) { if (PuushValidationCheck()) { txtPuushAPIKey.Text = ""; string apiKey = new Puush().Login(txtPuushEmail.Text, txtPuushPassword.Text); if (!string.IsNullOrEmpty(apiKey)) { txtPuushAPIKey.Text = apiKey; } else { MessageBox.Show("Login failed.", "Authentication failure", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void btnPuushLogin_Click(object sender, EventArgs e) { bool result = true; if (string.IsNullOrEmpty(txtPuushEmail.Text)) { txtPuushEmail.BackColor = Color.FromArgb(255, 200, 200); result = false; } if (string.IsNullOrEmpty(txtPuushPassword.Text)) { txtPuushPassword.BackColor = Color.FromArgb(255, 200, 200); result = false; } if (result) { txtPuushAPIKey.Text = ""; string apiKey = new Puush().Login(txtPuushEmail.Text, txtPuushPassword.Text); if (!string.IsNullOrEmpty(apiKey)) { txtPuushAPIKey.Text = apiKey; } else { MessageBox.Show("Login failed.", "Authentication failure", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }