protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack == false)
            {
                //  StuDT = StuAdapter.Select_UNAME(Session["sname"].ToString());

                DataTable std = StdMst.GetAllActiveData();

                int       month        = DateTime.Now.Month;
                DataTable attendancedt = CHECKINOUT.GetAllMonthlyAttendanceRecord(int.Parse(Session["Sid"].ToString()), month);

                if (attendancedt != null && attendancedt.Rows.Count > 0)
                {
                    lbltotalatt.Text = attendancedt.Rows.Count.ToString();


                    // AttDT = AttAdapter.Select_Roll_Atatus(StuDT.Rows[0]["rollno"].ToString(), "Present");

                    try
                    {
                        lblpresent.Text = attendancedt.Select("Status='Present' OR Status='Holiday'").CopyToDataTable().Rows.Count.ToString();
                    }
                    catch
                    {
                        lblpresent.Text = "0";
                    }
                    try
                    {
                        lblabsent.Text = attendancedt.Select("Status='Abscent'").CopyToDataTable().Rows.Count.ToString();
                    }
                    catch
                    {
                        lblabsent.Text = "0";
                    }
                    // AttDT = AttAdapter.Select_Roll_Atatus(StuDT.Rows[0]["rollno"].ToString(), "Absent");

                    try
                    {
                        lblleave.Text = attendancedt.Select("Status='Leave'").CopyToDataTable().Rows.Count.ToString();
                    }
                    catch
                    {
                        lblleave.Text = "0";
                    }


                    DataTable LeaveDT = LeaveMst.GetAllDataRecordByStId("", null, int.Parse(Session["Sid"].ToString()));
                    lbltotalleave.Text = LeaveDT.Rows.Count.ToString();


                    DataTable CompDT = Complainmst.GetAllDataRecordByStId("", null, int.Parse(Session["Sid"].ToString()));
                    lbltotalattcompl.Text = CompDT.Rows.Count.ToString();
                }
            }
        }
        protected void btnreject_Click(object sender, EventArgs e)
        {
            MultiView1.ActiveViewIndex = 2;
            DataTable LeaveDT = LeaveMst.GetAllDataRecordByStId("Reject");

            //LeaveAdapter.Select_By_STD_and_STATUS(drpstd.SelectedItem.Text, "Reject");

            GridView3.DataSource = LeaveDT;
            GridView3.DataBind();
            lblrej.Text = GridView3.Rows.Count.ToString();
        }
        protected void btnnewleave_Click(object sender, EventArgs e)
        {
            MultiView1.ActiveViewIndex = 0;
            DataTable LeaveDT = LeaveMst.GetAllDataRecordByStId("Pending");

            //.Select_By_STD_and_STATUS(drpstd.SelectedItem.Text, "Pending");

            GridView1.DataSource = LeaveDT;
            GridView1.DataBind();
            lblnew.Text = GridView1.Rows.Count.ToString();
        }
Beispiel #4
0
        protected void Bindgridview(string status)
        {
            try
            {
                if (Session["SID"] != null)
                {
                    int staffId = int.Parse(Session["SID"].ToString());

                    DataRow drstaff = StaffMst.GetDataByKey(staffId);
                    if (drstaff != null)
                    {
                        DataTable LeaveDT = LeaveMst.GetAllDataRecordByStId(status, int.Parse(drstaff["StdId"].ToString()));
                        GridView3.DataSource = LeaveDT;
                        GridView3.DataBind();
                    }
                }
            }
            catch
            {
            }
        }