protected void lbuRefresh_Click(object sender, EventArgs e)
 {
     ClearData();
     ClassFaculty f = new ClassFaculty();
     DataTable dt = f.GetFaculty("", "");
     GridView1.DataSource = dt;
     GridView1.DataBind();
     SetViewState(dt);
 }
        protected void lbuSearch_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtSearchFacultyName.Text) && ddlSearchCampus.SelectedIndex == 0)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณากรอก คำค้นหา')", true);

                return;
            }
            else
            {
                if (!string.IsNullOrEmpty(txtSearchFacultyName.Text))
                {
                    ClassFaculty f1 = new ClassFaculty();
                    DataTable dt1 = f1.GetFaculty(txtSearchFacultyName.Text, "");
                    GridView1.DataSource = dt1;
                    GridView1.DataBind();
                    SetViewState(dt1);
                }
                if (ddlSearchCampus.SelectedIndex != 0)
                {
                    ClassFaculty f2 = new ClassFaculty();
                    DataTable dt2 = f2.GetFaculty("", ddlSearchCampus.SelectedValue);
                    GridView1.DataSource = dt2;
                    GridView1.DataBind();
                    SetViewState(dt2);
                }
            }
        }
 void BindData1()
 {
     if (!string.IsNullOrEmpty(txtSearchFacultyName.Text))
     {
         ClassFaculty f1 = new ClassFaculty();
         DataTable dt1 = f1.GetFaculty(txtSearchFacultyName.Text, "");
         GridView1.DataSource = dt1;
         GridView1.DataBind();
         SetViewState(dt1);
     }
     if (ddlSearchCampus.SelectedIndex != 0)
     {
         ClassFaculty f2 = new ClassFaculty();
         DataTable dt2 = f2.GetFaculty("", ddlSearchCampus.SelectedValue);
         GridView1.DataSource = dt2;
         GridView1.DataBind();
         SetViewState(dt2);
     }
 }
 void BindData()
 {
     ClassFaculty f = new ClassFaculty();
     DataTable dt = f.GetFaculty("", "");
     GridView1.DataSource = dt;
     GridView1.DataBind();
     SetViewState(dt);
 }