protected void BtnAdd_Click(object sender, EventArgs e)
    {
        strmonth = DateTime.Now.ToString("MMMM");
        DateTime dt = DateTime.Today;

        strday = dt.DayOfWeek.ToString();
        dtA    = obj.CheckAttendance(txtdate.Text, strmonth, strday, Convert.ToInt32(ddnstaff.SelectedValue));
        if (dtA.Rows.Count > 0)
        {
            lblmsg.Text    = "Data Already Exist";
            BtnAdd.Enabled = false;
        }
        if (dtA.Rows.Count <= 0)
        {
            i = obj.AddStaffAttendance(Convert.ToInt32(ddnstaff.SelectedValue), txtdate.Text, strmonth, strday, txttimein.Text, txttimeout.Text, txttwhrs.Text, ddnprsnt.SelectedItem.Text, "Admin", 1, DateTime.Now.ToString());
            if (i > 0)
            {
                lblmsg.Text = "Attendance Inserted";
                BindData();
                ClearFields();
            }
        }
    }