private void LuuDotTiepNhan() { SplashScreenManager.ShowForm(this, typeof(DiaglogFrm.WaitingfromSave), true, true, false); var lst = this.lstTiepNhan.OrderByDescending(p => p.MaDonVi).ToList(); if (lst.Count > 0) { bool isOK = true; foreach (var tiepnhan in lst) { var result = BioNet_Bus.InsertTiepNhan(tiepnhan); if (!result.Result) { XtraMessageBox.Show("Lưu không thành công phiếu " + tiepnhan.MaPhieu + "\r\n Lý do : " + result.StringError, "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning); isOK = false; } else { var res = this.lstTiepNhan.FirstOrDefault(p => p.MaPhieu == tiepnhan.MaPhieu); this.lstTiepNhan.Remove(res); } } this.FrmLoad_From(); this.LoadGCDaTiepNhan(); this.LoadDanhSachTiepNhan(); SplashScreenManager.CloseForm(); if (isOK) { XtraMessageBox.Show("Đã lưu thành công!", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }