private void btnSua_Click(object sender, EventArgs e) { if (txtMaMayBay.Text.Trim() != "") { if (txtTenMayBay.Text.Trim() != "" && txtSoLuongGhe.Text.Trim() != "") { try { dtoMayBay = new DTO_MayBay(txtMaMayBay.Text, txtTenMayBay.Text, Convert.ToInt32(txtSoLuongGhe.Text)); if (busMayBay.Update(dtoMayBay)) { MessageBox.Show("Sửa thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Sửa không thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception a) { MessageBox.Show("Sửa không thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { TaoLai(); } } else { MessageBox.Show("Vui lòng nhập đầy đủ thông tin!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("Vui lòng chọn một hàng trong danh sách!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } }