예제 #1
0
        private void GetUserDetails(int sort, string Location)
        {
            try
            {
                Attendance.BAL.Report obj = new Report();

                DataTable dt = obj.GetUsers(Location.Trim(), sort);
                Session["AllusersData"] = dt;
                if (dt.Rows.Count > 0)
                {
                    if (sort == 0)
                    {
                        lblTotal.Text = "Total employee: " + dt.Rows[0]["TotalCount"].ToString() + " " + " " + " " + " " + "Active employee: " + dt.Rows[0]["ActiveCount"].ToString() + " " + " " + " " + " " + "Incative employee: " + dt.Rows[0]["InactiveCount"].ToString();
                    }
                    else if (sort == 1)
                    {
                        lblTotal.Text = "Total employee: " + dt.Rows[0]["TotalCount"].ToString() + " " + " " + " " + " " + "Active employee: " + dt.Rows[0]["ActiveCount"].ToString() + " " + " " + " " + " " + "Incative employee: " + dt.Rows[0]["InactiveCount"].ToString();
                    }
                    else
                    {
                        lblTotal.Text = "Total employee: " + dt.Rows[0]["TotalCount"].ToString() + " " + " " + " " + " " + "Active employee: " + dt.Rows[0]["ActiveCount"].ToString() + " " + " " + " " + " " + "Incative employee: " + dt.Rows[0]["InactiveCount"].ToString();
                    }
                    grdUsers.DataSource = dt;
                    grdUsers.DataBind();

                    BizUtility.GridSortInitail("Ascending", "Firstname", grdUsers, 0, dt);
                }
            }
            catch (Exception ex)
            {
            }
        }