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 modDeleteCommand4(Object sender, GridViewDeleteEventArgs e) { int id = Convert.ToInt32(GridViewDAA.DataKeys[e.RowIndex].Value); PS_DISCIPLINARY_AND_AMNESTY PDAA = new PS_DISCIPLINARY_AND_AMNESTY(); PDAA.PS_DAA_ID = id; PDAA.DELETE_PS_DISCIPLINARY_AND_AMNESTY(); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('ลบข้อมูลเรียบร้อย')", true); if (string.IsNullOrEmpty(labelCitizenID.Text)) { GridViewDAA.EditIndex = -1; BindData(); } else { GridViewDAA.EditIndex = -1; BindData1(); } }
protected void modUpdateCommand4(Object sender, GridViewUpdateEventArgs e) { Label lblPersonDAAID = (Label)GridViewDAA.Rows[e.RowIndex].FindControl("lblPersonDAAID"); Label lblPersonDAACitizenID = (Label)GridViewDAA.Rows[e.RowIndex].FindControl("lblPersonDAACitizenID"); DropDownList ddlPersonDAAYear = (DropDownList)GridViewDAA.Rows[e.RowIndex].FindControl("ddlPersonDAAYear"); TextBox txtPersonDAAName = (TextBox)GridViewDAA.Rows[e.RowIndex].FindControl("txtPersonDAAName"); TextBox txtPersonDAARef = (TextBox)GridViewDAA.Rows[e.RowIndex].FindControl("txtPersonDAARef"); PS_DISCIPLINARY_AND_AMNESTY PDAA = new PS_DISCIPLINARY_AND_AMNESTY(Convert.ToInt32(lblPersonDAAID.Text) , lblPersonDAACitizenID.Text , Convert.ToInt32(ddlPersonDAAYear.SelectedValue) , txtPersonDAAName.Text , txtPersonDAARef.Text); if (ddlPersonDAAYear.SelectedIndex == 0) { 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 (txtPersonDAAName.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 (txtPersonDAARef.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 = ""; } PDAA.UPDATE_PS_DISCIPLINARY_AND_AMNESTY(); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('อัพเดทข้อมูลเรียบร้อย')", true); if (string.IsNullOrEmpty(labelCitizenID.Text)) { GridViewDAA.EditIndex = -1; BindData(); } else { GridViewDAA.EditIndex = -1; BindData1(); } }
protected void lbuTab8Save_Click(object sender, EventArgs e) { if (ddlYear13.SelectedIndex == 0) { 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 (tbName13.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 (tbREF13.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_DISCIPLINARY_AND_AMNESTY PDAA = new PS_DISCIPLINARY_AND_AMNESTY(); PDAA.PS_CITIZEN_ID = p; PDAA.PS_YEAR = Convert.ToInt32(ddlYear13.SelectedValue); PDAA.PS_DAA_NAME = tbName13.Text; PDAA.PS_REF = tbREF13.Text; PDAA.INSERT_PS_DISCIPLINARY_AND_AMNESTY(); ClearPDAA13(); DataTable dt4 = PDAA.SELECT_PS_DISCIPLINARY_AND_AMNESTY(p, "", "", ""); GridViewDAA.DataSource = dt4; GridViewDAA.DataBind(); SetViewState(dt4); notification.Attributes["class"] = "alert alert_success"; notification.InnerHtml = ""; notification.InnerHtml += "<div><img src='Image/Small/correct.png' /><strong>บันทึกข้อมูลการได้รับโทษทางวินัยและการนิรโทษกรรมสำเร็จ</strong></div>"; }