private void btnLuu_Click(object sender, EventArgs e) { LopBLL LopBll = new LopBLL(); ErrorType result; //neu them moi string infor; if (this.maLop == null) { result = LopBll.Themlop(tbMaLop.Text, tbTenLop.Text, cbMaKhoiLop.Text, tbSiSo.Text); infor = "Thêm thành công!"; } else { result = LopBll.SuaLop(tbMaLop.Text, tbTenLop.Text, cbMaKhoiLop.Text, tbSiSo.Text); infor = "Xóa thành công!"; } if (result == ErrorType.THANH_CONG) { MessageBox.Show(infor, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (result == ErrorType.KI_TU_RONG) { MessageBox.Show("Bạn nên điền đầy đủ thông tin để thực hiện", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { MessageBox.Show("Thất bại, vui lòng xem lại chuỗi kết nối CSDL!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } }