Beispiel #1
0
        private void btnCapNhatMonHoc_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult result = MessageBox.Show("Bạn có chắc muốn cập nhật môn học này không?",
                                                      "Question",
                                                      MessageBoxButtons.YesNo,
                                                      MessageBoxIcon.Question,
                                                      MessageBoxDefaultButton.Button1);
                if (result == DialogResult.Yes)
                {
                    monDTO.TenMon = txtTenMonHocUpdate.Text;

                    MonBUS.UpdateRecord(monDTO);
                    MessageBox.Show("Cập nhật môn học thành công");
                    layDanhSachMon();
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }