public void ClearFilters(object sender, RoutedEventArgs e)
        {
            //clear the textBoxes
            FullNameTextBox.Clear();
            BirthdateTextBox.Clear();

            //reset the sliders
            HeightSlider.LowerValue = 150;
            HeightSlider.UpperValue = 250;
            WeightSlider.LowerValue = 50;
            WeightSlider.UpperValue = 250;

            //select empty item for comboBoxes
            NationalityComboBox.SelectedIndex = -1;
            TeamComboBox.SelectedIndex        = -1;
            PositionComboBox.SelectedIndex    = -1;

            //untick checkBoxes
            ActivePlayerCheckBox.IsChecked = false;
            AllStarCheckBox.IsChecked      = false;
            MVPCheckBox.IsChecked          = false;
            DPOYCheckBox.IsChecked         = false;
        }
Example #2
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);
        }
Example #3
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 (FatherNameTextBox.Text.Trim() == "")
            {
                MessageBox.Show("Father Name is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                FatherNameTextBox.Clear();
                FatherNameTextBox.Focus();
                return(false);
            }
            if (MotherNameTextBox.Text.Trim() == "")
            {
                MessageBox.Show("Mother Name is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                MotherNameTextBox.Clear();
                MotherNameTextBox.Focus();
                return(false);
            }
            if (AddressTextBox.Text.Trim() == "")
            {
                MessageBox.Show("Address is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                AddressTextBox.Clear();
                AddressTextBox.Focus();
                return(false);
            }
            if (EmailTextBox.Text.Trim() == "")
            {
                MessageBox.Show("Email Name is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                EmailTextBox.Clear();
                EmailTextBox.Focus();
                return(false);
            }
            if (MobileTextBox.Text.Trim() == "")
            {
                MessageBox.Show("Mobile number is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                MobileTextBox.Clear();
                MobileTextBox.Focus();
                return(false);
            }
            if (BloodGroupTextBox.Text.Trim() == "")
            {
                MessageBox.Show("Blood Group is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                BloodGroupTextBox.Clear();
                BloodGroupTextBox.Focus();
                return(false);
            }

            if (GenderComboBox.SelectedIndex == -1)
            {
                MessageBox.Show("Gender is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }
            if (BranchComboBox.SelectedIndex == -1)
            {
                MessageBox.Show("Branch is required", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }

            return(true);
        }