private bool IsFormValid()
 {
     if (NameTextBox.Text.Trim() == string.Empty)
     {
         Messages.ShowErrorMessage("Name is required");
         NameTextBox.Clear();
         NameTextBox.Focus();
         return(false);
     }
     if (EmailTextBox.Text.Trim() == string.Empty)
     {
         Messages.ShowErrorMessage("Email is required");
         EmailTextBox.Clear();
         EmailTextBox.Focus();
         return(false);
     }
     if (TelephoneTextBox.Text.Trim() == string.Empty)
     {
         Messages.ShowErrorMessage("Telephone is required");
         TelephoneTextBox.Clear();
         TelephoneTextBox.Focus();
         return(false);
     }
     return(true);
 }
Exemplo n.º 2
0
        private bool isFormValidate()
        {
            if (BranchNametextBox.Text.Trim() == "")
            {
                MessageBox.Show("Branch Name is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                BranchNametextBox.Clear();
                BranchNametextBox.Focus();
                return(false);
            }
            if (EmailAddressTextBox.Text.Trim() == "")
            {
                MessageBox.Show("Email is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                EmailAddressTextBox.Clear();
                EmailAddressTextBox.Focus();
                return(false);
            }
            if (TelephoneTextBox.Text.Trim() == "")
            {
                MessageBox.Show("Telephone is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TelephoneTextBox.Clear();
                TelephoneTextBox.Focus();
                return(false);
            }
            if (AddressLineTextBox.Text.Trim() == "")
            {
                MessageBox.Show("Address is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                AddressLineTextBox.Clear();
                AddressLineTextBox.Focus();
                return(false);
            }

            return(true);
        }
Exemplo n.º 3
0
 private void ClearText()
 {
     NameTextBox.Clear();
     AddressTextBox.Clear();
     PostalCodeTextBox.Clear();
     CityTextBox.Clear();
     TelephoneTextBox.Clear();
     EmailTextBox.Clear();
     ContactTypeComboBox.SelectedIndex = -1;
 }
Exemplo n.º 4
0
        private void TelephoneTextBox_Enter(object sender, EventArgs e)
        {
            TelephoneTextBox.ForeColor    = Color.FromArgb(78, 184, 206);
            TelephonePictureBox.Image     = Properties.Resources.phone_icon_colored;
            TelephoneFieldPanel.BackColor = Color.FromArgb(78, 184, 206);

            RegisterStatusLabel.Text = "";

            if (TelephoneTextBox.Text == "Телефон")
            {
                TelephoneTextBox.Clear();
            }
        }
Exemplo n.º 5
0
        private bool IsFormValidate()
        {
            if (FullNameTextBox.Text.Trim() == "")
            {
                MessageBox.Show("Full Name is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                FullNameTextBox.Clear();
                FullNameTextBox.Focus();
                return(false);
            }
            if (EmailAddressTextBox.Text.Trim() == "")
            {
                MessageBox.Show("Email is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                EmailAddressTextBox.Clear();
                EmailAddressTextBox.Focus();
                return(false);
            }
            if ((TelephoneTextBox.Text.Trim() == "") && (MobileTextBox.Text.Trim() == ""))
            {
                MessageBox.Show("Mobile or Telephone Number is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TelephoneTextBox.Clear();
                TelephoneTextBox.Focus();
                return(false);
            }
            if (NICTextBox.Text.Trim() == "")
            {
                MessageBox.Show("NIC is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                NICTextBox.Clear();
                NICTextBox.Focus();
                return(false);
            }
            if (GenderComboBox.SelectedIndex == -1)
            {
                MessageBox.Show("Gender is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }

            if (AddressLineTextBox.Text.Trim() == "")
            {
                MessageBox.Show("Address is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                AddressLineTextBox.Clear();
                AddressLineTextBox.Focus();
                return(false);
            }
            if (CityComboBox.SelectedIndex == -1)
            {
                MessageBox.Show("City is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }
            if (DistrictComboBox.SelectedIndex == -1)
            {
                MessageBox.Show("District is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }
            if (PostCodeTextBox.Text.Trim() == "")
            {
                MessageBox.Show("PostCode is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                PostCodeTextBox.Clear();
                PostCodeTextBox.Focus();
                return(false);
            }
            if (JobTitleComboBox.SelectedIndex == -1)
            {
                MessageBox.Show("Job Title is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }
            if (CurrentSalaryTextBox1.Text.Trim() == "")
            {
                MessageBox.Show("Current Salary is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                CurrentSalaryTextBox1.Clear();
                CurrentSalaryTextBox1.Focus();
                return(false);
            }
            else
            {
                if (Convert.ToDecimal(CurrentSalaryTextBox1.Text.Trim()) < 1)
                {
                    MessageBox.Show("Current Salary can not be Zero or less than zero");
                    CurrentSalaryTextBox1.Focus();
                    return(false);
                }
            }
            if (StartingSalaryTextBox.Text.Trim() == "")
            {
                MessageBox.Show("Starting Salary is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                StartingSalaryTextBox.Clear();
                StartingSalaryTextBox.Focus();
                return(false);
            }
            else
            {
                if (Convert.ToDecimal(StartingSalaryTextBox.Text.Trim()) < 1)
                {
                    MessageBox.Show("Starting Salary can not be Zero or less than zero");
                    StartingSalaryTextBox.Focus();
                    return(false);
                }
            }

            return(true);
        }