Пример #1
0
 private void DisableCustomeroptions()
 {
     CustomerNameLbl.Hide();
     CustomerNameTxtBox.Hide();
     CustomerPhoneLbl.Hide();
     CustomersAccountAmount.Hide();
     CustomersAccountAmountTxtBox.Hide();
     PhoneTxtBox.Hide();
 }
Пример #2
0
 private void EnableCustomeroptions()
 {
     CustomerNameLbl.Show();
     CustomerNameTxtBox.Show();
     CustomerPhoneLbl.Show();
     CustomersAccountAmount.Show();
     CustomersAccountAmountTxtBox.Show();
     PhoneTxtBox.Show();
 }
Пример #3
0
 private void clearTxtBox()
 {
     NameTxtBox.Clear();
     CompanyTxtBox.Clear();
     AddressTxtBox.Clear();
     EmailTxtBox.Clear();
     PositionTxtBox.Clear();
     BirthDayTxtBox.Clear();
     PhoneTxtBox.Clear();
     GenderTxtBox.Clear();
     YearsTxtBox.Clear();
     NotesTxtBox.Clear();
 }
Пример #4
0
        private void PhoneTxtBox_TextChanged(object sender, EventArgs e)
        {
            PhoneNumber currentNumber = Number;

            try
            {
                PhoneTxtBox.TextMaskFormat = MaskFormat.IncludePromptAndLiterals;//.ExcludePromptAndLiterals;
                PhoneNumber newNumber = new PhoneNumber(PhoneTxtBox.Text);

                foreach (Country country in PhoneList.AllCountries)
                {
                    if (newNumber.ValidatePhoneNumber(country)) //country is valid
                    {
                        currentNumber.UpdateCurrentNumber(newNumber);
                        CountryBox.SelectedItem = country;
                        if (!string.IsNullOrWhiteSpace(currentNumber.areaCode))
                        {
                            AreaCodeBox.SelectedItem = currentNumber.areaCode;
                        }

                        return;
                    }
                }
                int i = PhoneTxtBox.SelectionStart;
                PhoneTxtBox.Text           = currentNumber.ToString(); //reset it back to what it was before being changed
                PhoneTxtBox.SelectionStart = i;
                PhoneTxtBox.Select(Number.ToString().TrimEnd().Length, 0);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            /*
             * foreach (Country country in PhoneList.AllCountries)
             * {
             * if (PhoneTxtBox.Text.First().ToString() == country.countryCode)
             * {
             * CountryBox.SelectedItem = country;
             * currentNumber.countryCode = PhoneTxtBox.Text.First().ToString();
             * }
             * }
             *
             * //get all possible areacodes based on the current phone number
             *
             *
             * foreach (string areaCode in ((Country)CountryBox.SelectedItem).areaCodes)
             * {
             * //2,3,4
             *
             * if (PhoneTxtBox.Text[2] != ' ')
             * {
             *
             * }
             *
             *
             * if (PhoneTxtBox.Text[2] == areaCode[0])
             * {
             * number.areaCode = PhoneTxtBox.Text[2].ToString() + number.areaCode[1].ToString() + number.areaCode[2].ToString();
             *
             * }
             * if (PhoneTxtBox.Text[3] == areaCode[1])
             * {
             * number.areaCode = number.areaCode[0].ToString() + PhoneTxtBox.Text[3].ToString() + number.areaCode[2].ToString();
             *
             * }
             * if (PhoneTxtBox.Text[4] == areaCode[2])
             * {
             * number.areaCode = number.areaCode[0].ToString() + number.areaCode[1].ToString() + PhoneTxtBox.Text[4].ToString();
             *
             * }
             * }
             */
        }