Exemple #1
0
        private void textBox2Bkash_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar))
            {
                e.Handled = true;
                PhoneerrorProvider.SetError(this.textBox2Bkash, "Only Numeric value is valid as Account number");
            }
            else if (textBox2Bkash.Text.IndexOf("0") == 0)
            {
                if (textBox2Bkash.Text.Count() >= 3)
                {
                    if (textBox2Bkash.Text != "017" || textBox2Bkash.Text != "018" ||
                        textBox2Bkash.Text != "019" || textBox2Bkash.Text != "016" ||
                        textBox2Bkash.Text != "015")
                    {
                        BkasherrorProvider.SetError(this.textBox2Bkash, "Invalid Phone Number");
                    }
                }
            }
            else if (textBox2Bkash.Text.IndexOf("0") != 0)
            {
                if (textBox2Bkash.Text.Count() == 3)
                {
                    if (textBox2Bkash.Text != "17" || textBox2Bkash.Text != "18" ||
                        textBox2Bkash.Text != "19" || textBox2Bkash.Text != "16" ||
                        textBox2Bkash.Text != "15")
                    {
                        BkasherrorProvider.SetError(this.textBox2Bkash, "Invalid Phone Number");
                    }
                }
            }
            else
            {
                this.BkasherrorProvider.Clear();
                bkashaccNoValidation = 0;
                this.Refresh();
            }

            if (textBox2Bkash.Text != null)
            {
                AmountPaytextBox.Enabled = true;
            }
            if (textBox2Bkash.Text.IndexOf("0") == 0)
            {
                textBox2Bkash.Text = textBox2Bkash.Text.Remove(0, 1);
            }
        }
Exemple #2
0
        private void phonSignupetextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar))
            {
                e.Handled = true;
                PhoneerrorProvider.SetError(this.phonSignupetextBox, "Only Numeric value is valid as Phone number");
            }
            else if (phonSignupetextBox.Text.IndexOf("0") == 0)
            {
                if (phonSignupetextBox.Text.Count() >= 3)
                {
                    if (phonSignupetextBox.Text != "017" || phonSignupetextBox.Text != "018" ||
                        phonSignupetextBox.Text != "019" || phonSignupetextBox.Text != "016" ||
                        phonSignupetextBox.Text != "015")
                    {
                        PhoneerrorProvider.SetError(this.phonSignupetextBox, "Invalid Phone Number");
                    }
                }
            }
            else if (phonSignupetextBox.Text.IndexOf("0") != 0)
            {
                if (phonSignupetextBox.Text.Count() >= 2)
                {
                    if (phonSignupetextBox.Text != "17" || phonSignupetextBox.Text != "18" ||
                        phonSignupetextBox.Text != "19" || phonSignupetextBox.Text != "16" ||
                        phonSignupetextBox.Text != "15")
                    {
                        PhoneerrorProvider.SetError(this.phonSignupetextBox, "Invalid Phone Number");
                    }
                }
            }
            else
            {
                this.PhoneerrorProvider.Clear();
                PhoneValidation = 0;
                this.Refresh();
            }

            if (phonSignupetextBox.Text.IndexOf("0") == 0)
            {
                phonSignupetextBox.Text = phonSignupetextBox.Text.Remove(0, 1);
            }
        }
Exemple #3
0
 private void phonSignupetextBox_Leave(object sender, EventArgs e)
 {
     if (phonSignupetextBox.Text.IndexOf("0") == 0)
     {
         phonSignupetextBox.Text = phonSignupetextBox.Text.Remove(0, 1);
     }
     if (phonSignupetextBox.Text.Length != 10)
     {
         PhoneerrorProvider.SetError(this.phonSignupetextBox, "Invalid Phone Number");
     }
     else if (phonSignupetextBox.Text.Substring(0, 2) != "17" && phonSignupetextBox.Text.Substring(0, 2) != "18" &&
              phonSignupetextBox.Text.Substring(0, 2) != "19" && phonSignupetextBox.Text.Substring(0, 2) != "16" &&
              phonSignupetextBox.Text.Substring(0, 2) != "15")
     {
         PhoneerrorProvider.SetError(this.phonSignupetextBox, "Invalid Phone Number");
     }
     else
     {
         this.PhoneerrorProvider.Clear();
         PhoneValidation = 0;
         this.Refresh();
     }
 }