Exemple #1
0
        private void tsbDelete_Click(object sender, EventArgs e)
        {
            if (labBookTypeID.Text == "")
            {
                this.showErrorMessage("เลือกข้อมูลที่จะแก้ไขก่อน");
                return;
            }
            DialogResult result;

            result = MessageBox.Show("ต้องการลบข้อมูลใช่หรือไม่", "ยืนยัน", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
            if (result == DialogResult.No)
            {
                return;
            }
            BookType booktype = new BookType();

            booktype.BookTypeID = int.Parse(labBookTypeID.Text);
            booktype.delete();
            this.showDgvBookType();
            this.clear();
        }