protected void btnSubmitPositionWork_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtInsertPositionWorkID.Text)) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณาใส่ รหัสตำแหน่งในสายงาน')", true); return; } if (string.IsNullOrEmpty(txtInsertPositionWorkName.Text)) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณาใส่ ชื่อตำแหน่งในสายงาน')", true); return; } ClassPositionWork pw = new ClassPositionWork(); pw.POSITION_WORK_ID = txtInsertPositionWorkID.Text; pw.POSITION_WORK_NAME = txtInsertPositionWorkName.Text; if (pw.CheckUsePositionWorkID()) { pw.InsertPositionWork(); BindData(); ClearData(); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('เพิ่มข้อมูลเรียบร้อย')", true); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('มีรหัสตำแหน่งในสายงานนี้ อยู่ในระบบแล้ว !')", true); } }