Beispiel #1
0
        public static PsReponse UpdateChiDinh(PSXN_KetQua ketqua)
        {
            PsReponse res = new PsReponse();

            try
            {
                ProcessDataSync cn = new ProcessDataSync();
                db = cn.db;
                db.Connection.Open();
                db.Transaction = db.Connection.BeginTransaction();
                var dv = db.PSXN_KetQuas.FirstOrDefault(p => p.MaKetQua == ketqua.MaKetQua);
                if (dv != null)
                {
                    dv.isDongBo = true;
                    db.SubmitChanges();
                }
                db.Transaction.Commit();
                db.Connection.Close();
                res.Result = true;
            }
            catch (Exception ex)
            {
                db.Transaction.Rollback();
                db.Connection.Close();
                res.Result      = false;
                res.StringError = ex.ToString();
            }
            return(res);
        }
Beispiel #2
0
 private void CapMaXNTheoMaPhieu()
 {
     if (this.lstCanDanhMaFull.Count > 0)
     {
         foreach (var mau in this.lstCanDanhMaFull)
         {
             if (mau.MaChiDinh.Substring(0, 2).Equals("XN"))
             {
                 PSXN_KetQua ds = new PSXN_KetQua();
                 ds.MaChiDinh        = mau.MaChiDinh;
                 ds.MaDonVi          = mau.MaDonVi;
                 ds.MaPhieu          = mau.MaPhieu;
                 ds.NgayLamXetNghiem = DateTime.Now.Date;
                 ds.MaTiepNhan       = mau.MaTiepNhan;
                 ds.NgayChiDinh      = mau.NgayChiDinhLamViec;
                 ds.NgayTiepNhan     = mau.NgayTiepNhan;
                 ds.MaGoiXN          = mau.IDGoiDichVu;
                 ds.MaXetNghiem      = string.IsNullOrEmpty(BioNet_Bus.GetMaXN(mau.MaTiepNhan)) == true? mau.MaPhieu + "_L2": BioNet_Bus.GetMaXN(mau.MaTiepNhan) + "_L2";
                 this.lstDaDanhMaXN.Add(ds);
             }
             else
             {
                 PSXN_KetQua ds = new PSXN_KetQua();
                 ds.MaChiDinh        = mau.MaChiDinh;
                 ds.MaDonVi          = mau.MaDonVi;
                 ds.MaPhieu          = mau.MaPhieu;
                 ds.NgayLamXetNghiem = DateTime.Now.Date;
                 ds.MaTiepNhan       = mau.MaTiepNhan;
                 ds.NgayChiDinh      = mau.NgayChiDinhLamViec;
                 ds.NgayTiepNhan     = mau.NgayTiepNhan;
                 ds.MaXetNghiem      = mau.MaPhieu;
                 ds.MaGoiXN          = mau.IDGoiDichVu;
                 this.lstDaDanhMaXN.Add(ds);
             }
         }
         foreach (var phieu in 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 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.LoadGCDanhSachCho();
         this.LoadGCDanhSachDaDanhMa();
     }
 }
Beispiel #3
0
 private void CapMaXetNghiemCho1PhieuTuDong()
 {
     if (this.KiemTraDieuKienLamMoiDanhSach())
     {
         if (this.lstCanDanhMa.Count <= 0 && this.GVDanhSachDaCapMa.RowCount <= 0)
         {
             int bd = 1;
             try
             {
                 bd = int.Parse(BioNet_Bus.GetMaXNTrongBangGhi()) + 1;
             }
             catch { }
             this.lstDaDanhMaXN.Clear();
             if (this.maChiDinhFocusHandle.Substring(0, 2).Equals("XN"))
             {
                 PSXN_KetQua ds = new PSXN_KetQua();
                 ds.MaChiDinh        = this.maChiDinhFocusHandle;
                 ds.MaDonVi          = this.maDonviFocusHandle;
                 ds.MaPhieu          = this.maPhieuFocusHandle;
                 ds.NgayTiepNhan     = this.ngayTiepNhanFocusHandle;
                 ds.NgayChiDinh      = this.ngayChiDinhFocusHandle;
                 ds.NgayLamXetNghiem = DateTime.Now.Date;
                 ds.MaTiepNhan       = this.maTiepNhanFocusHandle;
                 ds.MaGoiXN          = this.maGoiXNFocusHandle;
                 ds.MaXetNghiem      = BioNet_Bus.GetMaXN(this.maTiepNhanFocusHandle) + "_L2";
                 this.lstDaDanhMaXN.Add(ds);
                 this.maKT = bd - 1;
                 this.LuuDanhSachDaCapMa();
             }
             else
             {
                 if (bd < 10)
                 {
                     XtraMessageBox.Show("Lỗi khi cấp mã xét nghiệm: không lấy được mã phiếu tự động. Vui lòng thử lại.", "BioNet - Chương trình sàng lọc sơ sinh!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 }
                 else
                 {
                     var tttrungtam = BioNet_Bus.GetThongTinTrungTam();
                     if (tttrungtam != null)
                     {
                         if (!tttrungtam.isCapMaXNTheoMaPhieu ?? true) //chọn cấp mã tự động
                         {
                             PSXN_KetQua ds = new PSXN_KetQua();
                             ds.MaChiDinh        = this.maChiDinhFocusHandle;
                             ds.MaDonVi          = this.maDonviFocusHandle;
                             ds.MaPhieu          = this.maPhieuFocusHandle;
                             ds.NgayLamXetNghiem = DateTime.Now.Date;
                             ds.NgayTiepNhan     = this.ngayTiepNhanFocusHandle;
                             ds.NgayChiDinh      = this.ngayChiDinhFocusHandle;
                             ds.MaTiepNhan       = this.maTiepNhanFocusHandle;
                             ds.MaGoiXN          = this.maGoiXNFocusHandle;
                             ds.MaXetNghiem      = bd.ToString();
                             this.lstDaDanhMaXN.Add(ds);
                             this.maKT = bd;
                             this.LuuDanhSachDaCapMa();
                         }
                         else //cấp mã xét nghiệm = mã phiếu
                         {
                             PSXN_KetQua ds = new PSXN_KetQua();
                             ds.MaChiDinh        = this.maChiDinhFocusHandle;
                             ds.MaDonVi          = this.maDonviFocusHandle;
                             ds.MaPhieu          = this.maPhieuFocusHandle;
                             ds.NgayLamXetNghiem = DateTime.Now.Date;
                             ds.NgayTiepNhan     = this.ngayTiepNhanFocusHandle;
                             ds.NgayChiDinh      = this.ngayChiDinhFocusHandle;
                             ds.MaTiepNhan       = this.maTiepNhanFocusHandle;
                             ds.MaXetNghiem      = this.maPhieuFocusHandle;
                             ds.MaGoiXN          = this.maGoiXNFocusHandle;
                             this.lstDaDanhMaXN.Add(ds);
                             this.maKT = bd - 1;
                             this.LuuDanhSachDaCapMa();
                         }
                     }
                     else
                     {
                         XtraMessageBox.Show("Lỗi khi cấp mã xét nghiệm: Không lấy được thông tin cấu hình của trung tâm.\r\n Vui lòng thử lại  hoặc liên hệ với quản trị viên kiểm tra lại thông tin cấu hình!", "BioNet - Chương trình sàng lọc sơ sinh!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                     }
                 }
             }
         }
     }
     else
     {
         XtraMessageBox.Show("Đưa danh sách đã cấp mã vào phòng xét nghiệm hoặc hủy danh sách đã cấp mã và làm lại từ đầu", "BioNet - Chương trình sàng lọc sơ sinh!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Beispiel #4
0
 private void CapMa()
 {
     foreach (var cd in this.lstCapMaTheoDonVi)
     {
         long maDB = cd.soBatDau;
         foreach (var row in this.lstCanDanhMaFull)
         {
             if (row.MaDonVi == cd.maDonVi)
             {
                 if (row.MaChiDinh.Substring(0, 2).Equals("XN"))
                 {
                     PSXN_KetQua ds = new PSXN_KetQua();
                     ds.MaChiDinh        = row.MaChiDinh;
                     ds.MaDonVi          = cd.maDonVi;
                     ds.MaPhieu          = row.MaPhieu;
                     ds.NgayLamXetNghiem = DateTime.Now.Date;
                     ds.MaTiepNhan       = row.MaTiepNhan;
                     ds.NgayChiDinh      = row.NgayChiDinhLamViec;
                     ds.NgayTiepNhan     = row.NgayTiepNhan;
                     ds.MaXetNghiem      = BioNet_Bus.GetMaXN(row.MaTiepNhan) + "_L2";
                     ds.MaGoiXN          = row.IDGoiDichVu;
                     this.lstDaDanhMaXN.Add(ds);
                 }
                 else
                 {
                     PSXN_KetQua ds = new PSXN_KetQua();
                     ds.MaChiDinh        = row.MaChiDinh;
                     ds.MaDonVi          = cd.maDonVi;
                     ds.MaPhieu          = row.MaPhieu;
                     ds.NgayLamXetNghiem = DateTime.Now.Date;
                     ds.MaTiepNhan       = row.MaTiepNhan;
                     ds.NgayChiDinh      = row.NgayChiDinhLamViec;
                     ds.NgayTiepNhan     = row.NgayTiepNhan;
                     ds.MaXetNghiem      = maDB.ToString();
                     ds.MaGoiXN          = row.IDGoiDichVu;;
                     this.lstDaDanhMaXN.Add(ds);
                     maDB += 1;
                 }
             }
             else
             {
                 if (row.MaChiDinh.Substring(0, 2).Equals("XN"))
                 {
                     var phieutontai = this.lstDaDanhMaXN.FirstOrDefault(p => p.MaChiDinh == row.MaChiDinh);
                     if (phieutontai == null)
                     {
                         PSXN_KetQua ds = new PSXN_KetQua();
                         ds.MaChiDinh        = row.MaChiDinh;
                         ds.MaDonVi          = row.MaDonVi;
                         ds.MaPhieu          = row.MaPhieu;
                         ds.NgayLamXetNghiem = DateTime.Now.Date;
                         ds.MaTiepNhan       = row.MaTiepNhan;
                         ds.NgayChiDinh      = row.NgayChiDinhLamViec;
                         ds.NgayTiepNhan     = row.NgayTiepNhan;
                         ds.MaXetNghiem      = BioNet_Bus.GetMaXN(row.MaTiepNhan) + "_L2";
                         ds.MaGoiXN          = row.IDGoiDichVu;;
                         this.lstDaDanhMaXN.Add(ds);
                     }
                 }
             }
         }
         foreach (var phieu in 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 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.LoadGCDanhSachCho();
     this.LoadGCDanhSachDaDanhMa();
 }