Пример #1
0
 private void ButtonCancel_Click(object sender, EventArgs e)
 {
     TextBoxEmail.Text    = "";
     TextBoxPassword.Text = "";
     ErrorProviderNotifier.Clear();
     _cancelled = true;
 }
Пример #2
0
        private void ButtonLogin_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TextBoxEmail.Text) || string.IsNullOrEmpty(TextBoxPassword.Text))
            {
                if (string.IsNullOrEmpty(TextBoxEmail.Text))
                {
                    ErrorProviderNotifier.SetError(TextBoxEmail, "Please fill the email field");
                }
                else
                {
                    ErrorProviderNotifier.SetError(TextBoxEmail, "");
                }

                if (string.IsNullOrEmpty(TextBoxPassword.Text))
                {
                    ErrorProviderNotifier.SetError(TextBoxPassword, "Please fill the password field");
                }
                else
                {
                    ErrorProviderNotifier.SetError(TextBoxPassword, "");
                }
            }
            else
            {
                MessageBox.Show("Access Granted", "Welcome");
                ErrorProviderNotifier.Clear();
            }
        }