Exemplo n.º 1
0
 /// <summary>
 /// Метод проверки ввода фамилии
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SurnameTextbox_TextChanged(object sender, EventArgs ex)
 {
     UpperFirstSimbol(sender);
     try
     {
         _contact.Surname         = SurnameTextbox.Text;
         SurnameTextbox.BackColor = Color.White;
         errorProvider.SetError(SurnameTextbox, String.Empty);
         _checkSurnameResult = true;
     }
     catch (ArgumentNullException e)
     {
         errorProvider.SetError(SurnameTextbox, e.Message);
         SurnameTextbox.Focus();
         SurnameTextbox.BackColor = Color.LightSalmon;
         _checkSurnameResult      = false;
     }
     catch (ArgumentException e)
     {
         errorProvider.SetError(SurnameTextbox, e.Message);
         SurnameTextbox.Focus();
         SurnameTextbox.BackColor = Color.LightSalmon;
         _checkSurnameResult      = false;
     }
 }
Exemplo n.º 2
0
 private void SetSurname(string Surname)
 {
     try
     {
         Console.WriteLine("Is Surname textbox displayed? {0}", SurnameTextbox.Displayed);
         SurnameTextbox.Clear();
         SurnameTextbox.SendKeys(Surname);
     }
     catch (Exception e)
     {
         Logger.Error("Error: ", e);
         throw (e);
     }
 }