Example #1
0
 private void ClearMethod()
 {
     FirstNameTB.Clear();
     designationtextBox.Clear();
     LastNametextBox.Clear();
     StatusTB.Clear();
     DateOfHired.Clear();
     BasicSalaryTB.Clear();
     Amountlabel.Text          = "Basic Salary : 0";
     UpdatedSalaryTb.Text      = "Salary After Updation : 0";
     perradioButton.Checked    = false;
     AmountradioButton.Checked = false;
 }
Example #2
0
        private void ClearMethod()
        {
            IDTB.Clear();
            FirstNameTB.Clear();
            LastNametextBox.Clear();
            DateOfHired.Clear();
            BasicSalarytextBox.Clear();
            DepartmentTextBoc.Clear();
            designationtextBox.Clear();
            StatusTB.Clear();
            MonthYear.Value           = DateTime.Now;
            perradioButton.Checked    = false;
            AmountradioButton.Checked = false;
            PertextBox.Clear();
            AmounttextBox.Clear();
            ReasontextBox.Clear();

            button1.Enabled        = false;
            button3.Enabled        = false;
            Amountlabel.Text       = "Total Salary : 0";
            DeductionSalaryTb.Text = "Salary After Deduction : 0";
        }
        private Boolean Validation()
        {

            

            if (FirstNameTB.Text == "")
            {
                FirstNameTB.BackColor = Color.DodgerBlue;
                MessageBox.Show("First Name Is Required", "Please Enter First Name", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                FirstNameTB.Focus();
                return true;
            }
            if (LastNametextBox.Text == "")
            {
                LastNametextBox.BackColor = Color.DodgerBlue;
                MessageBox.Show("Last Name Is Required", "Please Enter Last Name", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                LastNametextBox.Focus();
                return true;
            }
            if (DateOfBirthTB.Value == Dt)
            {
                DateOfBirthTB.BackColor = Color.DodgerBlue;
                MessageBox.Show("Date Of Birth Is Required", "Please Enter Date Of Birth", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                DateOfBirthTB.Focus();
                return true;
            }

            if (GenderTB.SelectedIndex == -1)
            {
                GenderTB.BackColor = Color.DodgerBlue;
                MessageBox.Show("Gender Is Required", "Please Select Gender", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                GenderTB.Focus();
                return true;
            }

            if (ContacttextBox.Text == "")
            {
                ContacttextBox.BackColor = Color.DodgerBlue;
                MessageBox.Show("Contact Number Is Required", "Please Enter Contact", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                ContacttextBox.Focus();
                return true;
            }
            if (NICtextBox.Text == "")
            {
                NICtextBox.BackColor = Color.DodgerBlue;
                MessageBox.Show("NIC Is Required", "Please Enter NIC", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                NICtextBox.Focus();
                return true;
            }

            if (DepartmentTextBoc.SelectedIndex == -1)
            {
                DepartmentTextBoc.BackColor = Color.DodgerBlue;
                MessageBox.Show("Department Is Required", "Please Select Department", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                DepartmentTextBoc.Focus();
                return true;
            }
            if (designationtextBox.SelectedIndex == -1)
            {
                designationtextBox.BackColor = Color.DodgerBlue;
                MessageBox.Show("Designation Is Required", "Please Select Designation", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                designationtextBox.Focus();
                return true;
            }
            if (StatuscomboBox.SelectedIndex == -1)
            {
                StatuscomboBox.BackColor = Color.DodgerBlue;
                MessageBox.Show("Status Is Required", "Please Select Status", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                StatuscomboBox.Focus();
                return true;
            }


            if (DateOfHired.Value == Dt)
            {
                DialogResult Result = MessageBox.Show("Do You Want To Enter To Day's Date ? ", "Yes Or No", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (Result == DialogResult.No)
                {
                    DateOfHired.Focus();
                    return true;
                }

            }


            if (BasicSalarytextBox.Text == "")
            {
                BasicSalarytextBox.BackColor = Color.DodgerBlue;
                MessageBox.Show("Basic Salary Is Required", "Please Enter Basic Salary", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                BasicSalarytextBox.Focus();
                return true;
            }

            if (JobTitletextBox.Text == "")
            {
                JobTitletextBox.BackColor = Color.DodgerBlue;
                MessageBox.Show("Job Title Is Required", "Please Enter Title", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                JobTitletextBox.Focus();
                return true;
            }

            if (HouseNOtextBox.Text == "")
            {
                HouseNOtextBox.BackColor = Color.DodgerBlue;
                MessageBox.Show("House Number Is Required", "Please Enter House Number", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                HouseNOtextBox.Focus();
                return true;
            }

            if (AddLine1Tb.Text == "")
            {
                AddLine1Tb.BackColor = Color.DodgerBlue;
                MessageBox.Show("Address Is Required", "Please Enter Address", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                AddLine1Tb.Focus();
                return true;
            }

            if (PasswordTb.Text == "")
            {
                PasswordTb.BackColor = Color.DodgerBlue;
                MessageBox.Show("Password Number Is Required", "Please Enter Password", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                PasswordTb.Focus();
                return true;
            }


            return false;
        }