Пример #1
0
 /// <summary>
 /// Метод проверки ввода номера телефона
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="ex"></param>
 private void PhoneTextbox_TextChanged(object sender, EventArgs ex)
 {
     UpperFirstSimbol(sender);
     try
     {
         _contact.Num           = new PhoneNumber();
         _contact.Num.Number    = Convert.ToInt64(PhoneTextbox.Text);
         PhoneTextbox.BackColor = Color.White;
         errorProvider.SetError(PhoneTextbox, String.Empty);
         _checkPhoneResult = true;
     }
     catch (ArgumentNullException e)
     {
         errorProvider.SetError(PhoneTextbox, e.Message);
         PhoneTextbox.Focus();
         PhoneTextbox.BackColor = Color.LightSalmon;
         _checkPhoneResult      = false;
     }
     catch (FormatException e)
     {
         errorProvider.SetError(PhoneTextbox, e.Message);
         PhoneTextbox.Focus();
         PhoneTextbox.BackColor = Color.LightSalmon;
         _checkPhoneResult      = false;
     }
     catch (ArgumentException e)
     {
         errorProvider.SetError(PhoneTextbox, e.Message);
         PhoneTextbox.Focus();
         PhoneTextbox.BackColor = Color.LightSalmon;
         _checkPhoneResult      = false;
     }
 }
Пример #2
0
 private void ClearForm()
 {
     if (CustomerId == 0)
     {
         IdTextbox.Text = "0";
         AddressTextbox.Clear();
         AgentTextbox.Clear();
         CompanyNameTextbox.Clear();
         ContactPersonTextbox.Clear();
         CodeTextbox.Clear();
         FaxTextbox.Clear();
         PaymentTextbox.Text = "0";
         TINTextbox.Clear();
         PhoneTextbox.Clear();
     }
     else
     {
         LoadCustomerDetails();
     }
 }
        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;
            }
        }