void BindData1()
        {
            PS_STUDY PStudy = new PS_STUDY();
            DataTable dt1 = PStudy.SELECT_PS_STUDY(labelCitizenID.Text, "", "", "", "", "", "", "", "", "");
            GridViewStudy.DataSource = dt1;
            GridViewStudy.DataBind();
            SetViewState(dt1);

            PS_PROFESSIONAL_LICENSE PLicense = new PS_PROFESSIONAL_LICENSE();
            DataTable dt2 = PLicense.SELECT_PS_PROFESSIONAL_LICENSE(labelCitizenID.Text, "", "", "", "");
            GridViewLicense.DataSource = dt2;
            GridViewLicense.DataBind();
            SetViewState(dt2);

            PS_TRAINING PTraining = new PS_TRAINING();
            DataTable dt3 = PTraining.SELECT_PS_TRAINING(labelCitizenID.Text, "", "", "", "", "", "");
            GridViewTraining.DataSource = dt3;
            GridViewTraining.DataBind();
            SetViewState(dt3);

            PS_DISCIPLINARY_AND_AMNESTY PDAA = new PS_DISCIPLINARY_AND_AMNESTY();
            DataTable dt4 = PDAA.SELECT_PS_DISCIPLINARY_AND_AMNESTY(labelCitizenID.Text, "", "", "");
            GridViewDAA.DataSource = dt4;
            GridViewDAA.DataBind();
            SetViewState(dt4);

            PS_POSITION_AND_SALARY PPAS = new PS_POSITION_AND_SALARY();
            DataTable dt5 = PPAS.SELECT_PS_POSITION_AND_SALARY(labelCitizenID.Text, "", "", "", "", "", "", "", "");
            GridViewPAS.DataSource = dt5;
            GridViewPAS.DataBind();
            SetViewState(dt5);

            TB_PDH_GOVER PDHgover = new TB_PDH_GOVER();
            DataTable dt6 = PDHgover.SELECT_POSI_GOVER_ONLY(labelCitizenID.Text, "", "");
            GridviewPDHgover.DataSource = dt6;
            GridviewPDHgover.DataBind();
            SetViewState(dt6);

            TB_PDH_EMP PDHemp = new TB_PDH_EMP();
            DataTable dt7 = PDHemp.SELECT_POSI_EMP_ONLY(labelCitizenID.Text, "", "");
            GridviewPDHemp.DataSource = dt7;
            GridviewPDHemp.DataBind();
            SetViewState(dt7);
        }
 void BindData()
 {
     //GridViewStudy
     PS_STUDY PStudy = new PS_STUDY();
     DataTable dt1 = PStudy.SELECT_PS_STUDY(p, "", "", "", "", "", "", "", "", "");
     GridViewStudy.DataSource = dt1;
     GridViewStudy.DataBind();
     SetViewState(dt1);
     //GridViewLicense
     PS_PROFESSIONAL_LICENSE PLicense = new PS_PROFESSIONAL_LICENSE();
     DataTable dt2 = PLicense.SELECT_PS_PROFESSIONAL_LICENSE(p, "", "", "", "");
     GridViewLicense.DataSource = dt2;
     GridViewLicense.DataBind();
     SetViewState(dt2);
     //GridViewTraining
     PS_TRAINING PTraining = new PS_TRAINING();
     DataTable dt3 = PTraining.SELECT_PS_TRAINING(p, "", "", "", "", "", "");
     GridViewTraining.DataSource = dt3;
     GridViewTraining.DataBind();
     SetViewState(dt3);
     //GridViewDisciplinary
     PS_DISCIPLINARY_AND_AMNESTY PDAA = new PS_DISCIPLINARY_AND_AMNESTY();
     DataTable dt4 = PDAA.SELECT_PS_DISCIPLINARY_AND_AMNESTY(p, "", "", "");
     GridViewDAA.DataSource = dt4;
     GridViewDAA.DataBind();
     SetViewState(dt4);
     //GridViewPositionAndSalary
     PS_POSITION_AND_SALARY PPAS = new PS_POSITION_AND_SALARY();
     DataTable dt5 = PPAS.SELECT_PS_POSITION_AND_SALARY(p, "", "", "", "", "", "", "", "");
     GridViewPAS.DataSource = dt5;
     GridViewPAS.DataBind();
     SetViewState(dt5);
     //GridViewPositionDegreeHistoryGover
     TB_PDH_GOVER PDHgover = new TB_PDH_GOVER();
     DataTable dt6 = PDHgover.SELECT_POSI_GOVER_ONLY(p, "", "");
     GridviewPDHgover.DataSource = dt6;
     GridviewPDHgover.DataBind();
     SetViewState(dt6);
     //GridViewPositionDegreeHistoryEMP
     TB_PDH_EMP PDHemp = new TB_PDH_EMP();
     DataTable dt7 = PDHemp.SELECT_POSI_EMP_ONLY(p, "", "");
     GridviewPDHemp.DataSource = dt7;
     GridviewPDHemp.DataBind();
     SetViewState(dt7);
 }
        protected void modDeleteCommand2(Object sender, GridViewDeleteEventArgs e)
        {
            int id = Convert.ToInt32(GridViewLicense.DataKeys[e.RowIndex].Value);
            PS_PROFESSIONAL_LICENSE PLicense = new PS_PROFESSIONAL_LICENSE();
            PLicense.PS_PL_ID = id;
            PLicense.DELETE_PS_PROFESSIONAL_LICENSE();
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('ลบข้อมูลเรียบร้อย')", true);

            if (string.IsNullOrEmpty(labelCitizenID.Text))
            {
                GridViewLicense.EditIndex = -1;
                BindData();
            }
            else
            {
                GridViewLicense.EditIndex = -1;
                BindData1();
            }
        }
        protected void modUpdateCommand2(Object sender, GridViewUpdateEventArgs e)
        {
            Label lblPersonLicenseID = (Label)GridViewLicense.Rows[e.RowIndex].FindControl("lblPersonLicenseID");
            Label lblPersonLicenseCitizenID = (Label)GridViewLicense.Rows[e.RowIndex].FindControl("lblPersonLicenseCitizenID");
            TextBox txtPersonLicenseName = (TextBox)GridViewLicense.Rows[e.RowIndex].FindControl("txtPersonLicenseName");
            TextBox txtPersonLicenseDepartment = (TextBox)GridViewLicense.Rows[e.RowIndex].FindControl("txtPersonLicenseDepartment");
            TextBox txtPersonLicenseNo = (TextBox)GridViewLicense.Rows[e.RowIndex].FindControl("txtPersonLicenseNo");
            TextBox txtPersonLicenseDate = (TextBox)GridViewLicense.Rows[e.RowIndex].FindControl("txtPersonLicenseDate");

            PS_PROFESSIONAL_LICENSE PLicense = new PS_PROFESSIONAL_LICENSE(Convert.ToInt32(lblPersonLicenseID.Text)
                , lblPersonLicenseCitizenID.Text
                , txtPersonLicenseName.Text
                , txtPersonLicenseDepartment.Text
                , txtPersonLicenseNo.Text
                , Util.ODT(txtPersonLicenseDate.Text));

            if (txtPersonLicenseName.Text == "")
            {
                notification.Attributes["class"] = "alert alert_danger";
                notification.InnerHtml = "";
                notification.InnerHtml += "<div><img src='Image/Small/red_alert.png' /><strong>กรุณากรอกข้อมูลให้ครบถ้วน</strong></div>";
                notification.InnerHtml += "<div>กรุณากรอกชื่อใบอนุญาต</div>";
                return;
            }
            else
            {
                notification.Attributes["class"] = "none";
                notification.InnerHtml = "";
            }
            if (txtPersonLicenseDepartment.Text == "")
            {
                notification.Attributes["class"] = "alert alert_danger";
                notification.InnerHtml = "";
                notification.InnerHtml += "<div><img src='Image/Small/red_alert.png' /><strong>กรุณากรอกข้อมูลให้ครบถ้วน</strong></div>";
                notification.InnerHtml += "<div>กรุณากรอกหน่วยงาน</div>";
                return;
            }
            else
            {
                notification.Attributes["class"] = "none";
                notification.InnerHtml = "";
            }
            if (txtPersonLicenseNo.Text == "")
            {
                notification.Attributes["class"] = "alert alert_danger";
                notification.InnerHtml = "";
                notification.InnerHtml += "<div><img src='Image/Small/red_alert.png' /><strong>กรุณากรอกข้อมูลให้ครบถ้วน</strong></div>";
                notification.InnerHtml += "<div>กรุณากรอกเลขที่ใบอนุญาต</div>";
                return;
            }
            else
            {
                notification.Attributes["class"] = "none";
                notification.InnerHtml = "";
            }
            if (txtPersonLicenseDate.Text == "")
            {
                notification.Attributes["class"] = "alert alert_danger";
                notification.InnerHtml = "";
                notification.InnerHtml += "<div><img src='Image/Small/red_alert.png' /><strong>กรุณากรอกข้อมูลให้ครบถ้วน</strong></div>";
                notification.InnerHtml += "<div>กรุณากรอกวันที่มีผลบังคับใช้ (วัน เดือน ปี)</div>";
                return;
            }
            else
            {
                notification.Attributes["class"] = "none";
                notification.InnerHtml = "";
            }

            PLicense.UPDATE_PS_PROFESSIONAL_LICENSE();
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('อัพเดทข้อมูลเรียบร้อย')", true);
            if (string.IsNullOrEmpty(labelCitizenID.Text))
            {
                GridViewLicense.EditIndex = -1;
                BindData();
            }
            else
            {
                GridViewLicense.EditIndex = -1;
                BindData1();
            }
        }
        protected void lbuTab6Save_Click(object sender, EventArgs e)
        {
            if (tbLicenseName11.Text == "")
            {
                notification.Attributes["class"] = "alert alert_danger";
                notification.InnerHtml = "";
                notification.InnerHtml += "<div><img src='Image/Small/red_alert.png' /><strong>กรุณากรอกข้อมูลให้ครบถ้วน</strong></div>";
                notification.InnerHtml += "<div>กรุณากรอกชื่อใบอนุญาต</div>";
                return;
            }
            else
            {
                notification.Attributes["class"] = "none";
                notification.InnerHtml = "";
            }
            if (tbDepartment11.Text == "")
            {
                notification.Attributes["class"] = "alert alert_danger";
                notification.InnerHtml = "";
                notification.InnerHtml += "<div><img src='Image/Small/red_alert.png' /><strong>กรุณากรอกข้อมูลให้ครบถ้วน</strong></div>";
                notification.InnerHtml += "<div>กรุณากรอกหน่วยงาน</div>";
                return;
            }
            else
            {
                notification.Attributes["class"] = "none";
                notification.InnerHtml = "";
            }
            if (tbLicenseNo11.Text == "")
            {
                notification.Attributes["class"] = "alert alert_danger";
                notification.InnerHtml = "";
                notification.InnerHtml += "<div><img src='Image/Small/red_alert.png' /><strong>กรุณากรอกข้อมูลให้ครบถ้วน</strong></div>";
                notification.InnerHtml += "<div>กรุณากรอกเลขที่ใบอนุญาต</div>";
                return;
            }
            else
            {
                notification.Attributes["class"] = "none";
                notification.InnerHtml = "";
            }
            if (tbUseDate11.Text == "")
            {
                notification.Attributes["class"] = "alert alert_danger";
                notification.InnerHtml = "";
                notification.InnerHtml += "<div><img src='Image/Small/red_alert.png' /><strong>กรุณากรอกข้อมูลให้ครบถ้วน</strong></div>";
                notification.InnerHtml += "<div>กรุณากรอกวันที่มีผลบังคับใช้ (วัน เดือน ปี)</div>";
                return;
            }
            else
            {
                notification.Attributes["class"] = "none";
                notification.InnerHtml = "";
            }

            PS_PROFESSIONAL_LICENSE PLicense = new PS_PROFESSIONAL_LICENSE();
            PLicense.PS_CITIZEN_ID = p;
            PLicense.PS_LICENSE_NAME = tbLicenseName11.Text;
            PLicense.PS_DEPARTMENT = tbDepartment11.Text;
            PLicense.PS_LICENSE_NO = tbLicenseNo11.Text;
            PLicense.PS_USE_DATE = Util.ODT(tbUseDate11.Text);
            PLicense.INSERT_PS_PROFESSIONAL_LICENSE();

            ClearPLicense11();
            DataTable dt2 = PLicense.SELECT_PS_PROFESSIONAL_LICENSE(p, "", "", "", "");
            GridViewLicense.DataSource = dt2;
            GridViewLicense.DataBind();
            SetViewState(dt2);

            notification.Attributes["class"] = "alert alert_success";
            notification.InnerHtml = "";
            notification.InnerHtml += "<div><img src='Image/Small/correct.png' /><strong>บันทึกข้อมูลใบอนุญาตประกอบวิชาชีพสำเร็จ</strong></div>";
        }