Example #1
0
 public void UpdatePKDK(DTO_PKDaKhoa pkdk)
 {
     using (var context = new SQLServerDBContext())
     {
         context.Entry(pkdk).State = EntityState.Modified;
         context.SaveChanges();
     }
 }
Example #2
0
 public void UpdateCTBaoCaoDoanhThu(DTO_CTBaoCaoDoanhThu cTBaoCaoDoanhThu)
 {
     using (var context = new SQLServerDBContext())
     {
         context.Entry(cTBaoCaoDoanhThu).State = EntityState.Modified;
         context.SaveChanges();
     }
 }
Example #3
0
 public void UpdateBCDoanhThu(DTO_BCDoanhThu bc)
 {
     using (var context = new SQLServerDBContext())
     {
         context.Entry(bc).State = EntityState.Modified;
         context.SaveChanges();
     }
 }
Example #4
0
 public void LoadNPCTBaoCaoDoanhThu(DTO_BCDoanhThu bCDoanhThu)
 {
     using (var context = new SQLServerDBContext())
     {
         context.BaoCaoDoanhThu.Attach(bCDoanhThu);
         var entry = context.Entry(bCDoanhThu);
         entry.Collection(bc => bc.DS_CTBaoCaoDoanhThu).Load();
     }
 }
Example #5
0
 public bool UpdateInfo(DTO_BenhNhan bn)
 {
     using (var context = new SQLServerDBContext())
     {
         try
         {
             context.Entry(bn).State = EntityState.Modified;
             context.SaveChanges();
             return(true);
         }
         catch (Exception e)
         {
             throw e;
         }
     }
 }
Example #6
0
 public bool LoadNPPKDaKhoa(DTO_PKChuyenKhoa pKChuyenKhoa)
 {
     try
     {
         using (var context = new SQLServerDBContext())
         {
             context.PKChuyenKhoa.Attach(pKChuyenKhoa);
             var entry = context.Entry(pKChuyenKhoa);
             entry.Reference(p => p.PhieuKhamDaKhoa).Load();
             return(true);
         }
     }
     catch (Exception e)
     {
         Debug.WriteLine($"[ERRROR DAL_PKCHUYENKHOA] {e.Message}");
         return(false);
     }
 }
Example #7
0
 public void UpdateThamSo(List <DTO_ThamSo> thamSo)
 {
     using (var context = new SQLServerDBContext())
     {
         try
         {
             foreach (var ts in thamSo)
             {
                 context.Entry(ts).State = EntityState.Modified;
             }
             context.SaveChanges();
         }
         catch (Exception e)
         {
             throw e;
         }
     }
 }
Example #8
0
 public bool LoadNPCachDung(DTO_CTDonThuoc ctDonThuoc)
 {
     try
     {
         using (var context = new SQLServerDBContext())
         {
             context.CT_DonThuoc.Attach(ctDonThuoc);
             var entry = context.Entry(ctDonThuoc);
             entry.Reference(p => p.CachDung).Load();
             return(true);
         }
     }
     catch (Exception e)
     {
         Debug.WriteLine($"[ERRROR DAL CTDonThuoc] {e.Message}");
         return(false);
     }
 }
Example #9
0
 public bool LoadNP_DSPKCK(DTO_PKDaKhoa pKDaKhoa)
 {
     try
     {
         using (var context = new SQLServerDBContext())
         {
             context.PKDaKhoa.Attach(pKDaKhoa);
             var entry = context.Entry(pKDaKhoa);
             entry.Collection(p => p.DS_PKhamChuyenKhoa).Load();
             return(true);
         }
     }
     catch (Exception e)
     {
         Debug.WriteLine($"[ERRROR LOADNP_DSPKCK] {e.Message}");
         return(false);
     }
 }
Example #10
0
 public bool LoadNPBenhNhan(DTO_HoaDon hoaDon)
 {
     try
     {
         using (var context = new SQLServerDBContext())
         {
             context.HoaDon.Attach(hoaDon);
             var entry = context.Entry(hoaDon);
             entry.Reference(p => p.BenhNhan).Load();
             return(true);
         }
     }
     catch (Exception e)
     {
         Debug.WriteLine($"[ERRROR DAL HOADON] {e.Message}");
         return(false);
     }
 }
Example #11
0
 public bool LoadNPGroup(DTO_NhanVien nhanVien)
 {
     try
     {
         using (var context = new SQLServerDBContext())
         {
             context.NhanVien.Attach(nhanVien);
             var entry = context.Entry(nhanVien);
             //if (!entry.Reference(p => p.Nhom).IsLoaded)
             entry.Reference(p => p.Nhom).Load();
             return(true);
         }
     }
     catch (Exception e)
     {
         Debug.WriteLine($"[ERRROR DAL NHANVIEN] {e.Message}");
         return(false);
     }
 }
Example #12
0
 public bool LoadNP_PhieuNhapThuoc(DTO_CTPhieuNhapThuoc cTPhieuNhapThuoc)
 {
     try
     {
         using (var context = new SQLServerDBContext())
         {
             context.CTPhieuNhapThuoc.Attach(cTPhieuNhapThuoc);
             var entry = context.Entry(cTPhieuNhapThuoc);
             if (!entry.Reference(p => p.PhieuNhapThuoc).IsLoaded)
             {
                 entry.Reference(p => p.PhieuNhapThuoc).Load();
             }
             return(true);
         }
     }
     catch (Exception e)
     {
         Debug.WriteLine($"[ERRROR DAL CTPHIEUNHAPTHUOC] {e.Message}");
         return(false);
     }
 }
Example #13
0
 public bool LoadNP_DSPKDK(DTO_BenhNhan bn)
 {
     try
     {
         using (var context = new SQLServerDBContext())
         {
             context.BenhNhan.Attach(bn);
             var entry = context.Entry(bn);
             if (!entry.Collection(p => p.DS_PKDaKhoa).IsLoaded)
             {
                 entry.Collection(p => p.DS_PKDaKhoa).Load();
             }
             return(true);
         }
     }
     catch (Exception e)
     {
         Debug.WriteLine($"[ERRROR LOADNP_DSPKDK] {e.Message}");
         return(false);
     }
 }
Example #14
0
 public bool LoadNPThuoc(DTO_CTHDThuoc cTHDThuoc)
 {
     try
     {
         using (var context = new SQLServerDBContext())
         {
             context.CTHoaDdonThuoc.Attach(cTHDThuoc);
             var entry = context.Entry(cTHDThuoc);
             if (!entry.Reference(p => p.Thuoc).IsLoaded)
             {
                 entry.Reference(p => p.Thuoc).Load();
             }
             return(true);
         }
     }
     catch (Exception e)
     {
         Debug.WriteLine($"[ERRROR DAL BENH] {e.Message}");
         return(false);
     }
 }
Example #15
0
 public bool LoadNPBenhNhan(DTO_PKDaKhoa pKDaKhoa)
 {
     try
     {
         using (var context = new SQLServerDBContext())
         {
             context.PKDaKhoa.Attach(pKDaKhoa);
             var entry = context.Entry(pKDaKhoa);
             if (!entry.Reference(p => p.BenhNhan).IsLoaded)
             {
                 entry.Reference(p => p.BenhNhan).Load();
             }
             return(true);
         }
     }
     catch (Exception e)
     {
         Debug.WriteLine($"[ERRROR DAL_PKDAKHOA] {e.Message}");
         return(false);
     }
 }
Example #16
0
 public bool LoadNPNhanVien(DTO_Account acc)
 {
     try
     {
         using (var context = new SQLServerDBContext())
         {
             context.Account.Attach(acc);
             var entry = context.Entry(acc);
             if (!entry.Reference(p => p.NhanVien).IsLoaded)
             {
                 entry.Reference(p => p.NhanVien).Load();
             }
             return(true);
         }
     }
     catch (Exception e)
     {
         Debug.WriteLine($"[ERRROR DAL ACCOUNT] {e.Message}");
         return(false);
     }
 }
Example #17
0
 public bool LoadNP_DSCTDonThuoc(DTO_DonThuoc donThuoc)
 {
     try
     {
         using (var context = new SQLServerDBContext())
         {
             context.DonThuoc.Attach(donThuoc);
             var entry = context.Entry(donThuoc);
             if (!entry.Collection(p => p.DS_CTDonThuoc).IsLoaded)
             {
                 entry.Collection(p => p.DS_CTDonThuoc).Load();
             }
             return(true);
         }
     }
     catch (Exception e)
     {
         Debug.WriteLine($"[ERRROR DAL DonThuoc] {e.Message}");
         return(false);
     }
 }