Beispiel #1
0
 private void IDTB_TextChanged(object sender, EventArgs e)
 {
     if (AmounttextBox.Text == "0")
     {
         AmounttextBox.Clear();
     }
 }
Beispiel #2
0
 private void IDTB_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         GetDataMethod(IDTB.Text);
         AmounttextBox.Focus();
     }
 }
Beispiel #3
0
        private Boolean Validation()
        {
            String Com, Dt;

            Com = MonthYear.Value.Date.ToString();
            Dt  = DateTime.Today.ToString();


            if (AmounttextBox.Text == "" || AmounttextBox.Text == "0")
            {
                AmounttextBox.BackColor = Color.DodgerBlue;
                MessageBox.Show("Amount Is Required", "Please Enter Amount", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                AmounttextBox.Focus();
                return(true);
            }
            if (ReasonCB.Text == "")
            {
                ReasonCB.BackColor = Color.DodgerBlue;
                MessageBox.Show("Reason Is Required", "Please Enter Reason", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                ReasonCB.Focus();
                return(true);
            }
            if (AttendanceAllowancetb.SelectedIndex == -1)
            {
                AttendanceAllowancetb.BackColor = Color.DodgerBlue;
                MessageBox.Show("Attendance Allowance Is Required", "Please Select Yes Or No", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                AttendanceAllowancetb.Focus();
                return(true);
            }

            if (Com == 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)
                {
                    MonthYear.Focus();
                    return(true);
                }
            }

            return(false);
        }
Beispiel #4
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";
        }
Beispiel #5
0
        private void perradioButton_CheckedChanged(object sender, EventArgs e)
        {
            if (perradioButton.Checked)
            {
                PertextBox.Enabled = true;
            }

            if (!perradioButton.Checked)
            {
                PertextBox.Enabled = false;
                PertextBox.Clear();
            }

            if (AmountradioButton.Checked)
            {
                AmounttextBox.Enabled = true;
            }
            if (!AmountradioButton.Checked)
            {
                AmounttextBox.Enabled = false;
                AmounttextBox.Clear();
            }
        }