Beispiel #1
0
 /// <summary>
 /// Очищает все TextBox.
 /// </summary>
 void ClearTextBox()
 {
     TargetAddressTextBox.Clear();
     ICAOTypeCodeTextBox.Clear();
     RegistrationTextBox.Clear();
     TypeAircraftTextBox.Clear();
     CountryTextBox.Clear();
     ClassTextBox.Clear();
     UserTextBox.Clear();
 }
Beispiel #2
0
        private void CountryTextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (CountryTextBox.Text.StartsWith(" "))
            {
                CountryTextBox.Text = "";
            }

            CountryTextBox.Text = Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(this.CountryTextBox.Text);
            CountryTextBox.Select(CountryTextBox.Text.Length, 0);

            TextOfCountryTextBox = CountryTextBox.Text.Trim();
        }
Beispiel #3
0
        internal void RefreshTabCustomer()
        {
            customerBindingSource.Clear();
            for (int i = 0; i < manager.Customers.Count; i++)
            {
                customerBindingSource.Add(manager.Customers[i]);
            }
            CustomerNameTextBox.Clear();
            CustomerSurnameTextBox.Clear();
            CountryTextBox.Clear();
            AgreementDateTimePicker.Value = DateTime.Now;
            CustomerDataGridView.ClearSelection();


            for (int i = 0; i < manager.Customers.Count; i++)
            {
                LoadProjectInfoToCustomer(manager.Customers[i]);
            }
        }
Beispiel #4
0
 private void очиститьToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ProductNameTextBox.Clear();
     InventoryNumberMaskedTextBox.Clear();
     SizeTrackBar.Value      = 0;
     radioButton1.Checked    = true;
     radioButton2.Checked    = false;
     GettingDatePicker.Value = DateTime.Now;
     WeightMaskedTextBox.Clear();
     NumberMaskedTextBox.Clear();
     PriceMaskedTextBox.Clear();
     OrganizationNameTextBox.Clear();
     CountryTextBox.Clear();
     TelephoneNumberMaskedTextBox.Clear();
     form2.CityTextBox.Clear();
     form2.StreetTextBox.Clear();
     form2.HouseMaskedTextBox.Clear();
     Act = "очистка всех полей";
 }
Beispiel #5
0
        private bool ValidateForm()
        {
            bool isValid = true;

            if (!_validator.IsStringValid(FilmNameTextBox.Text))
            {
                FindErrorProvider.SetError(FilmNameTextBox, "String must be russian and not contains special simbols");
                FilmNameTextBox.Focus();
                isValid = false;
            }
            if (!YearFromTextBox.IsYearValid())
            {
                isValid = false;
            }
            if (!YearToTextBox.IsYearValid())
            {
                isValid = false;
            }
            if (!_validator.IsStringValid(CountryTextBox.Text))
            {
                FindErrorProvider.SetError(CountryTextBox, "String must be russian and not contains special simbols");
                CountryTextBox.Focus();
                isValid = false;
            }
            if (!_validator.IsStringValid(ProducerTextBox.Text))
            {
                ProducerTextBox.Focus();
                FindErrorProvider.SetError(ProducerTextBox, "String must be russian and not contains special simbols");
                isValid = false;
            }
            if (!_validator.IsStringValid(MainActorsTextBox.Text))
            {
                FindErrorProvider.SetError(MainActorsTextBox, "String must be russian and not contains special simbols");
                MainActorsTextBox.Focus();
                isValid = false;
            }
            else
            {
                FindErrorProvider.SetError(FilmNameTextBox, String.Empty);
            }
            return(isValid);
        }
Beispiel #6
0
        private string TextBoxValidation()
        {
            string errorMessage = string.Empty;

            if (FirstNameTextBox.Text.Length > 0 && FirstNameTextBox.Text != null)
            {
                this.FirstName = FirstNameTextBox.Text;
            }
            else
            {
                errorMessage = "Invalid entry for first name. Please enter a valid first name";

                FirstNameTextBox.Focus();
            }

            if (MiddleNameTextBox.Text != null)
            {
                this.MiddleName = MiddleNameTextBox.Text;
            }
            else
            {
                errorMessage = "Invalid entry for middle name. Please enter a valid middle name";

                MiddleNameTextBox.Focus();
            }

            if (LastNameTextBox.Text.Length > 0 && LastNameTextBox.Text != null)
            {
                this.LastName = LastNameTextBox.Text;
            }
            else
            {
                errorMessage = "Invalid entry for last name. Please enter a valid last name";

                LastNameTextBox.Focus();
            }

            if (CityTextBox.Text.Length > 0 && CityTextBox.Text != null)
            {
                this.City = CityTextBox.Text;
            }
            else
            {
                errorMessage = "Invalid entry for city. Please enter a valid city";

                CityTextBox.Focus();
            }

            if (StateTextBox.Text.Length > 0 && StateTextBox.Text != null)
            {
                this.State = StateTextBox.Text;
            }
            else
            {
                errorMessage = "Invalid entry for state. Please enter a valid state";

                StateTextBox.Focus();
            }

            if (CountryTextBox.Text.Length > 0 && CountryTextBox.Text != null)
            {
                this.Country = CountryTextBox.Text;
            }
            else
            {
                errorMessage = "Invalid entry for Country. Please enter a valid country";

                CountryTextBox.Focus();
            }

            if (PhoneNumberTextBox.Text.Length > 0 && PhoneNumberTextBox.Text != null)
            {
                this.PhoneNumber = PhoneNumberTextBox.Text;
            }
            else
            {
                errorMessage = "Invalid entry for phone number. Please enter a valid phone number";

                PhoneNumberTextBox.Focus();
            }

            if (EmailAddressTextBox.Text.Length > 0 && EmailAddressTextBox.Text != null)
            {
                this.EmailAddress = EmailAddressTextBox.Text;
            }
            else
            {
                errorMessage = "Invalid entry for email address. Please enter a valid email address";

                EmailAddressTextBox.Focus();
            }

            return(errorMessage);
        }
Beispiel #7
0
        private void InitializeDataBindings()
        {
            ChkSendHomeAddress.DataBindings.Clear();
            HomeAddressStreetTextBox.DataBindings.Clear();
            HomeAddressZipCodeTextBox.DataBindings.Clear();
            HomeAddressCityTextBox.DataBindings.Clear();
            HomeAddressSubCityTextBox.DataBindings.Clear();

            ChkSendBoxAddress.DataBindings.Clear();
            BoxZipCodeTextBox.DataBindings.Clear();
            BoxCityTextBox.DataBindings.Clear();
            BoxNumberTextBox.DataBindings.Clear();

            CountryTextBox.DataBindings.Clear();
            StateTextBox.DataBindings.Clear();

            ApplyGcdDataStreetButton.DataBindings.Clear();
            ApplyGcdDataZipCodeButton.DataBindings.Clear();
            ApplyGcdDataCityButton.DataBindings.Clear();
            ApplyGcdDataCountryButton.DataBindings.Clear();


            if (_address?.HomeAddress == null)
            {
                return;
            }

            HomeAddress   homeAddress = _address.HomeAddress;
            PostOfficeBox box         = _address.PostOfficeBox;

            ChkSendHomeAddress.SetCheckedDataBinding(_address, nameof(_address.HasHomeAddress));

            SetHasHomeAddressEnabledBinding(HomeAddressStreetTextBox)
            .SetTextDataBinding(homeAddress, nameof(homeAddress.Street));

            SetHasHomeAddressEnabledBinding(HomeAddressZipCodeTextBox)
            .SetTextDataBinding(homeAddress, nameof(homeAddress.ZipCode));

            SetHasHomeAddressEnabledBinding(HomeAddressCityTextBox)
            .SetTextDataBinding(homeAddress, nameof(homeAddress.City));

            SetHasHomeAddressEnabledBinding(HomeAddressSubCityTextBox)
            .SetTextDataBinding(homeAddress, nameof(homeAddress.SubCity));

            ChkSendBoxAddress.SetCheckedDataBinding(_address, nameof(_address.HasPostOfficeBox));

            SetHasPostOfficeBoxEnabledBinding(BoxZipCodeTextBox)
            .SetTextDataBinding(box, nameof(box.ZipCode));

            SetHasPostOfficeBoxEnabledBinding(BoxCityTextBox)
            .SetTextDataBinding(box, nameof(box.City));

            SetHasPostOfficeBoxEnabledBinding(BoxNumberTextBox)
            .SetTextDataBinding(box, nameof(box.Number));

            CountryTextBox.SetTextDataBinding(_address, nameof(_address.Country));
            StateTextBox.SetTextDataBinding(_address, nameof(_address.State));

            SetHasHomeAddressEnabledBinding(ApplyGcdDataStreetButton);
            SetHasHomeAddressEnabledBinding(ApplyGcdDataZipCodeButton);
            SetHasHomeAddressEnabledBinding(ApplyGcdDataCityButton);
        }