Ejemplo n.º 1
0
        private void btnCapNhatGiangVien_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult result = MessageBox.Show("Bạn có chắc muốn cập nhật thông tin của Giảng Viên này không?",
                                                      "Question",
                                                      MessageBoxButtons.YesNo,
                                                      MessageBoxIcon.Question,
                                                      MessageBoxDefaultButton.Button1);
                if (result == DialogResult.Yes)
                {
                    giangVienUpdateDTO.TenGiangVien = txtTenGiangVienUpdate.Text;
                    giangVienUpdateDTO.SoDienThoai  = txtSoDienThoaiUpdate.Text;
                    giangVienUpdateDTO.DiaChi       = txtDiaChiUpdate.Text;
                    giangVienUpdateDTO.Email        = txtEmailUpdate.Text;

                    GiangVienBUS.UpdateRecord(giangVienUpdateDTO);
                    MessageBox.Show("Cập nhật thông tin Giảng Viên thành công");
                    layDanhSachGiangVien();
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }