private void btnDel_Click(object sender, EventArgs e) { if (txtID.Text == "0") { MessageBox.Show("กรุณาเลือกรายการที่ต้องการลบ"); return; } DocTypeFunc fnc = new DocTypeFunc(); if (fnc.DeleteDocType(Convert.ToInt16(txtID.Text)) == true) { ClearForm(); getDocTypeAllList(); MessageBox.Show("ลบข้อมูลเรียบร้อย"); } else { MessageBox.Show(fnc.ErrorMessage); } }