/// <summary> /// Метод проверки ввода почтового ящика /// </summary> /// <param name="sender"></param> /// <param name="ex"></param> private void EmailTextbox_TextChanged(object sender, EventArgs ex) { UpperFirstSimbol(sender); try { _contact.Email = EmailTextbox.Text; EmailTextbox.BackColor = Color.White; errorProvider.SetError(EmailTextbox, String.Empty); _checkEmailResult = true; } catch (ArgumentNullException e) { errorProvider.SetError(EmailTextbox, e.Message); EmailTextbox.Focus(); EmailTextbox.BackColor = Color.LightSalmon; _checkEmailResult = false; } catch (ArgumentException e) { errorProvider.SetError(EmailTextbox, e.Message); EmailTextbox.Focus(); EmailTextbox.BackColor = Color.LightSalmon; _checkEmailResult = false; } }
private void FinishEmpBtn_Click(object sender, EventArgs e) { emp.name = FnameTextbox.Text + " " + LnameTextbox.Text; emp.password = PassTextbox.Text; emp.phone = PhoneNumTextbox.Text; emp.rank = RankTextBox.Text; emp.salary = Convert.ToInt16(SalaryTextbox.Text); emp.gender = gender; emp.address = AddressTextbox.Text; emp.admin_id = 1; emp.join_date = Convert.ToDateTime(JoinDatePicker.Text); // MessageBox.Show(emp.join_date.ToString()); emp.mail = EmailTextbox.Text; AdminClass newmanger = new AdminClass(); newmanger.addmanager(emp); FnameTextbox.Clear(); LnameTextbox.Clear(); PassTextbox.Clear(); PhoneNumTextbox.Clear(); SalaryTextbox.Clear(); MaleCheck.Checked = false; FemaleCheck.Checked = false; AddressTextbox.Clear(); EmailTextbox.Clear(); RankTextBox.Text = ""; MessageBox.Show("Employee Added Successfully"); }
void ClearFields() { FirstNameTextbox.Clear(); LastNameTextbox.Clear(); AccountNumberTextbox.Clear(); BalanceTextbox.Clear(); EmailTextbox.Clear(); PhoneNumberTextbox.Clear(); BalanceDateTextbox.Clear(); }
private void SubmitButton_Click(object sender, EventArgs e) { if (!String.Equals(PasswordTextbox.Text, ConfirmTextbox.Text)) { label13.Text = "Passwords Must Match"; label13.Visible = true; } else { string str = Properties.Settings.Default.DefaultConnection; SqlConnection con = new SqlConnection { ConnectionString = str }; con.Open(); SqlCommand cmd = new SqlCommand("Insert into Employee(SSN, FirstName, LastName, City, State, " + "ZipCode, Email, Password, Telephone, StartDate, HourlyRate, Type) " + "Values(@SSN, @FirstName, @LastName, @City, @State, @ZipCode, @Email, @Password, @Telephone, @AccountCreationDate, " + "@HourlyRate, @AccountType)", con); cmd.Parameters.AddWithValue("@SSN", SSNTextbox.Text); cmd.Parameters.AddWithValue("@FirstName", FirstNameTextbox.Text); cmd.Parameters.AddWithValue("@LastName", LastNameTextbox.Text); cmd.Parameters.AddWithValue("@City", CityTextbox.Text); cmd.Parameters.AddWithValue("@State", StateTextbox.Text); cmd.Parameters.AddWithValue("@ZipCode", ZipTextbox.Text); cmd.Parameters.AddWithValue("@Email", EmailTextbox.Text); cmd.Parameters.AddWithValue("@Password", PasswordTextbox.Text); cmd.Parameters.AddWithValue("@Telephone", TelephoneTextbox.Text); cmd.Parameters.AddWithValue("@AccountCreationDate", DateTime.Now.Date); cmd.Parameters.AddWithValue("@HourlyRate", HourlyWageTextBox.Text); cmd.Parameters.AddWithValue("@AccountType", comboBox1.Text); cmd.ExecuteNonQuery(); label13.Text = "Successfully Added " + FirstNameTextbox.Text + " " + LastNameTextbox.Text; label13.Visible = true; //Clear the textboxes SSNTextbox.Clear(); FirstNameTextbox.Clear(); FirstNameTextbox.Clear(); LastNameTextbox.Clear(); CityTextbox.Clear(); StateTextbox.Clear(); ZipTextbox.Clear(); EmailTextbox.Clear(); PasswordTextbox.Clear(); ConfirmTextbox.Clear(); TelephoneTextbox.Clear(); HourlyWageTextBox.Clear(); comboBox1.SelectedIndex = -1; } }
private void SetUserEmail(string UserName) { try { Console.WriteLine("Is Email textbox displayed? {0}", EmailTextbox.Displayed); EmailTextbox.Clear(); EmailTextbox.SendKeys(UserName); } catch (Exception e) { Logger.Error("Error: ", e); throw (e); } }
public void Login(string username, string password) { EmailTextbox.SendKeys(username); PasswordTextbox.SendKeys(password); SubmitButton.Click(); }
private void SendEmail_Click(object sender, RoutedEventArgs e) { if (HostTextbox.Text == string.Empty) { System.Windows.MessageBox.Show("Please fill in the hosting provider.", "Error", MessageBoxButton.OK, MessageBoxImage.Warning); HostTextbox.Focus(); } else if (EmailTextbox.Text == string.Empty) { System.Windows.MessageBox.Show("Please enter your email address.", "Error", MessageBoxButton.OK, MessageBoxImage.Warning); EmailTextbox.Focus(); } else if (EmailTextbox.Text.Contains("@") == false) { System.Windows.MessageBox.Show("Please enter a valid email address.", "Error", MessageBoxButton.OK, MessageBoxImage.Warning); EmailTextbox.Focus(); } else if (PasswordBox.Password == string.Empty) { System.Windows.MessageBox.Show("Please fill in your password.", "Error", MessageBoxButton.OK, MessageBoxImage.Warning); PasswordBox.Focus(); } else if (EmailToTextbox.Text == string.Empty) { System.Windows.MessageBox.Show("Please Enter the email address where you want to send the mail.", "Error", MessageBoxButton.OK, MessageBoxImage.Warning); EmailToTextbox.Focus(); } else if (EmailTextbox.Text.Contains("@") == false) { System.Windows.MessageBox.Show("Please enter a valid email address.", "Error", MessageBoxButton.OK, MessageBoxImage.Warning); EmailToTextbox.Focus(); } else if (SubjectTextbox.Text == string.Empty) { System.Windows.MessageBox.Show("Please fill in the subject of your email.", "Error", MessageBoxButton.OK, MessageBoxImage.Warning); SubjectTextbox.Focus(); } else if (MessageTextbox.Text == string.Empty) { System.Windows.MessageBox.Show("Please leave a message.", "Error", MessageBoxButton.OK, MessageBoxImage.Warning); MessageTextbox.Focus(); } else { SendEmail.IsEnabled = false; if (HostTextbox.Text.StartsWith("pop3")) { HostTextbox.Text = HostTextbox.Text.Replace("pop3", "smtp"); } else if (HostTextbox.Text.StartsWith("imap")) { HostTextbox.Text = HostTextbox.Text.Replace("imap", "smtp"); } else if (!(HostTextbox.Text.Contains("smtp."))) { HostTextbox.Text = "smtp." + HostTextbox.Text; } ErrorFormat = String.Empty; ErrorSmtp = String.Empty; Host = HostTextbox.Text; EmailFrom = EmailTextbox.Text; EmailTo = EmailToTextbox.Text; Password = PasswordBox.Password; Subject = SubjectTextbox.Text; Message = MessageTextbox.Text; AttachmentPath = AttachmentTextbox.Text; StatusTextBlock.Foreground = Brushes.Black; StatusTextBlock.Text = "Sending..."; BackgroundWorker.RunWorkerAsync(); } }
private void EmailTextbox_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e) { EmailTextbox.SelectAll(); }
void ReleaseDesignerOutlets() { if (CreateUserButton != null) { CreateUserButton.Dispose(); CreateUserButton = null; } if (EmailAddress != null) { EmailAddress.Dispose(); EmailAddress = null; } if (EmailTextbox != null) { EmailTextbox.Dispose(); EmailTextbox = null; } if (LastnameLabel != null) { LastnameLabel.Dispose(); LastnameLabel = null; } if (LastnameTextbox != null) { LastnameTextbox.Dispose(); LastnameTextbox = null; } if (NameLabel != null) { NameLabel.Dispose(); NameLabel = null; } if (NameTextbox != null) { NameTextbox.Dispose(); NameTextbox = null; } if (PasswordLabel != null) { PasswordLabel.Dispose(); PasswordLabel = null; } if (PasswordTextbox != null) { PasswordTextbox.Dispose(); PasswordTextbox = null; } if (PhoneNumberLabel != null) { PhoneNumberLabel.Dispose(); PhoneNumberLabel = null; } if (PhoneTextbox != null) { PhoneTextbox.Dispose(); PhoneTextbox = null; } if (UserNameLabel != null) { UserNameLabel.Dispose(); UserNameLabel = null; } if (UserNameTextbox != null) { UserNameTextbox.Dispose(); UserNameTextbox = null; } }
private bool Validar() { bool paso = true; MyerrorProvider.Clear(); if (string.IsNullOrWhiteSpace(MatriculaTextBox.Text)) { MyerrorProvider.SetError(MatriculaTextBox, "El campo Direccion no puede estar vacio"); MatriculaTextBox.Focus(); paso = false; } if (NombreTextbox.Text == string.Empty) { MyerrorProvider.SetError(NombreTextbox, "El campo Nombre no puede estar vacio"); NombreTextbox.Focus(); paso = false; } if (ApellidoTextbox.Text == string.Empty) { MyerrorProvider.SetError(ApellidoTextbox, "El campo Nombre no puede estar vacio"); ApellidoTextbox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(CedulaTextbox.Text.Replace("-", ""))) { MyerrorProvider.SetError(CedulaTextbox, "El campo Cedula no puede estar vacio"); CedulaTextbox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(TelefonoTextbox.Text.Replace("-", ""))) { MyerrorProvider.SetError(TelefonoTextbox, "El campo Telefono no puede estar vacio"); TelefonoTextbox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(CelularTextbox.Text.Replace("-", ""))) { MyerrorProvider.SetError(CelularTextbox, "El campo Celular no puede estar vacio"); CelularTextbox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(EmailTextbox.Text)) { MyerrorProvider.SetError(EmailTextbox, "El campo Email no puede estar vacio"); EmailTextbox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(FechaNacimientoDateTimePicker.Text)) { MyerrorProvider.SetError(FechaNacimientoDateTimePicker, "El campo Fecha de nacimiento no puede estar vacio"); FechaNacimientoDateTimePicker.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(SexoComboBox.Text)) { MyerrorProvider.SetError(SexoComboBox, "El campo Sexo no puede estar vacio"); SexoComboBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(BalanceTextBox.Text)) { MyerrorProvider.SetError(BalanceTextBox, "El campo Balance no puede estar vacio"); BalanceTextBox.Focus(); paso = false; } return(paso); }