private void st_le_al_dtp_end_ValueChanged(object sender, EventArgs e)
        {
            Leave le = new Leave();

            //TimeSpan ts = st_le_al_dtp_end.Value - st_le_al_dtp_start.Value;
            //int du = ts.Days + 1;

            // st_le_al_lb_durationvalue.Text = du.ToString();
            st_le_al_lb_durationvalue.Text = le.CalculateWorkingDays(st_le_al_dtp_start.Value.Date, st_le_al_dtp_end.Value.Date).ToString();
        }
        //Request Leave
        private void st_le_al_btn_apply_Click(object sender, EventArgs e)
        {
            Leave le = new Leave();

            if (st_le_al_tb_empid.Text == "" || (st_le_al_rb_cashual.Checked == false && st_le_al_rb_annual.Checked == false &&
                                                 st_le_al_rb_medical.Checked == false && st_le_al_rb_other.Checked == false && st_le_al_rb_halfday.Checked == false) ||
                st_le_al_rtb_reason.Text == "")
            {
                MessageBox.Show("Please fill all the fields");
            }
            else
            {
                if (0 == le.CalculateWorkingDays(st_le_al_dtp_start.Value.Date, st_le_al_dtp_end.Value.Date))
                {
                    MessageBox.Show("Please select valid dates");
                }
                else
                {
                    if (st_le_al_rb_halfday.Checked == true && st_le_al_cb_session.Text == "")
                    {
                        MessageBox.Show("Please select the session you need to have the half day");
                    }
                    else
                    {
                        le.empid    = Convert.ToInt32(st_le_al_tb_empid.Text);
                        le.start    = st_le_al_dtp_start.Value.Date;
                        le.end      = st_le_al_dtp_end.Value.Date;
                        le.duration = le.CalculateWorkingDays(le.start, le.end);
                        le.status   = false;
                        le.reason   = st_le_al_rtb_reason.Text;

                        if (st_le_al_rb_other.Checked == true)
                        {
                            le.type = st_le_al_rb_other.Text;
                        }
                        else if (st_le_al_rb_annual.Checked == true)
                        {
                            le.type = st_le_al_rb_annual.Text;
                        }
                        else if (st_le_al_rb_cashual.Checked == true)
                        {
                            le.type = st_le_al_rb_cashual.Text;
                        }
                        else if (st_le_al_rb_medical.Checked == true)
                        {
                            le.type = st_le_al_rb_medical.Text;
                        }
                        else
                        {
                            le.type    = st_le_al_rb_halfday.Text;
                            le.session = st_le_al_cb_session.Text;
                        }

                        if (mcm.CheckLeaveBalance(le))
                        {
                            if (mcm.checkIfOnLeave(le))
                            {
                                MessageBox.Show("This person has already applied for a leave in this duration");
                            }
                            else
                            {
                                if (MessageBox.Show("Are you sure you need to request for a leave?", "", MessageBoxButtons.YesNo) == DialogResult.Yes)
                                {
                                    if (mcm.RequestLeave(le))
                                    {
                                        MessageBox.Show("Leave has been sent to approve");
                                        st_le_al_btn_clear_Click(sender, e);
                                        string q = "SELECT EmployeeID,StartDate,EndDate,Duration,LeaveType,ApproveStatus FROM Leave ";
                                        st_le_vl_dgv_leaves.DataSource = mcm.loadGridView(q);
                                    }
                                    else
                                    {
                                    }
                                }
                                else
                                {
                                }
                            }
                        }
                    }
                }
            }
        }