private void btnLuu_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (them) { try { BLThe blThe = new BLThe(); blThe.ThemThe(MaThe, MaDG, NgayLapThe, NgayHetHan, ref err); LoadData(); XtraMessageBox.Show("Đã thêm xong!"); } catch { XtraMessageBox.Show("Không thêm được. Lỗi rồi!"); } } else { try { BLThe blThe = new BLThe(); blThe.CapNhatThe(MaThe, MaDG, NgayLapThe, NgayHetHan, ref err); LoadData(); XtraMessageBox.Show("Đã sửa xong!"); } catch { XtraMessageBox.Show("Không sữa được. Lỗi rồi!"); } } }