コード例 #1
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            ArrayList listofStaff = dbmanager.GetStaffByName(txtSearch.Text);

            if (listofStaff.Count != 0)
            {
                ManageStaffGrid.DataSource = listofStaff;
                ManageStaffGrid.DataBind();
            }
        }
コード例 #2
0
        protected void BindGrid()
        {
            ArrayList listofStaff = dbmanager.GetAllStaffDetails();

            if (listofStaff.Count != 0)
            {
                ManageStaffGrid.DataSource = listofStaff;
                ManageStaffGrid.DataBind();

                Session["StaffGrid"] = ManageStaffGrid.DataSource;

                if (ManageStaffGrid.PageCount > 10)
                {
                    lbViewAll.Text = "View all";
                }
            }
            else
            {
                Session["ManageUserPage"] = "ManageUserAdd.aspx?return";
                Response.Redirect("~/ManageUserAdd.aspx?adduser");
            }
        }
コード例 #3
0
        //protected void viewAllBtn_Click(object sender, EventArgs e)
        //{
        //    if (Session["StaffGrid"] != null)
        //    {
        //        ArrayList arrayTable = (ArrayList)Session["StaffGrid"];

        //        if (Session["ViewALLExportUser"] == null)
        //        {
        //            ManageStaffGrid.AllowPaging = false;
        //            ManageStaffGrid.DataSource = arrayTable;
        //            ManageStaffGrid.DataBind();
        //            lbViewAll.Text = "view with paging";
        //            Session["ViewALLExportUser"] = true;
        //        }
        //        else
        //        {
        //            ManageStaffGrid.AllowPaging = true;
        //            ManageStaffGrid.DataSource = arrayTable;
        //            ManageStaffGrid.DataBind();
        //            lbViewAll.Text = "view all";
        //            Session["ViewALLExportUser"] = null;
        //        }
        //    }
        //}

        protected void lbViewAll_Click(object sender, EventArgs e)
        {
            if (Session["StaffGrid"] != null)
            {
                ArrayList arrayTable = (ArrayList)Session["StaffGrid"];

                if (Session["ViewALLExportUser"] == null)
                {
                    ManageStaffGrid.AllowPaging = false;
                    ManageStaffGrid.DataSource  = arrayTable;
                    ManageStaffGrid.DataBind();
                    lbViewAll.Text = "view with paging";
                    Session["ViewALLExportUser"] = true;
                }
                else
                {
                    ManageStaffGrid.AllowPaging = true;
                    ManageStaffGrid.DataSource  = arrayTable;
                    ManageStaffGrid.DataBind();
                    lbViewAll.Text = "view all";
                    Session["ViewALLExportUser"] = null;
                }
            }
        }