protected override void SaveDetail() { try { if (ValidateData()) { MessageBox.Show(@"Vui lòng nhập đầy đủ thông tin", @"Lỗi"); } else { foreach (var row in dgv_DanhSach.Rows.Where(row => string.IsNullOrEmpty(row.Cells["ID"].Text))) { var hs = new NamHoc { namhoc = row.Cells["NamHoc"].Text }; _listAdd.Add(hs); } if (_listUpdate.Count <= 0 && IdDelete.Count <= 0 && _listAdd.Count <= 0) { return; } if (_listUpdate.Count > 0) { UpdateData.UpdateNamHoc(_listUpdate); } if (_listAdd.Count > 0) { InsertData.ThemNamHoc(_listAdd); } MessageBox.Show(FormResource.MsgThongbaothanhcong, FormResource.MsgCaption, MessageBoxButtons.OK, MessageBoxIcon.Information); LoadFormDetail(); } } catch (Exception ex) { Log2File.LogExceptionToFile(ex); } }