Example #1
0
        private void LuuDanhSachDaCapMa()
        {
            bool ok = true;

            foreach (var item in this.lstDaDanhMaXN)
            {
                var res = BioNet_Bus.InsertMauDaDanhMaXN(item);
                if (!res.Result)
                {
                    ok = false;
                    XtraMessageBox.Show("Lỗi khi lưu phiếu :" + item.MaPhieu.ToString() + "\r\n Lỗi chi tiết :" + res.StringError, "BioNet - Chương trình sàng lọc sơ sinh!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            if (ok)
            {
                BioNet_Bus.UpdateMaXNVaoBangGhi(this.maKT.ToString());
                XtraMessageBox.Show("Lưu danh sách phiếu thành công", "BioNet - Chương trình sàng lọc sơ sinh!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                foreach (var phieu in this.lstDaDanhMaXN)
                {
                    var result = this.lstCho.FirstOrDefault(p => p.MaPhieu == phieu.MaPhieu && p.MaTiepNhan == phieu.MaTiepNhan);
                    if (result != null)
                    {
                        try
                        {
                            this.lstCho.Remove(result);
                        }
                        catch (Exception ex)
                        {
                            XtraMessageBox.Show("Lỗi khi lấy cập nhật lại danh sách chờ! \r\n Lỗi chi tiết :" + ex.ToString(), "BioNet - Chương trình sàng lọc sơ sinh!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                }
                this.lstDaDanhMaXN.Clear();
                this.lstCanDanhMa.Clear();
                this.LoadGCDanhSachCho();
                this.LoadGCDanhSachDaDanhMa();
            }
        }