Example #1
0
 public void AddCTHDThuoc(DTO_CTHDThuoc cTHDThuoc)
 {
     using (var context = new SQLServerDBContext())
     {
         context.CTHoaDdonThuoc.Add(cTHDThuoc);
         context.SaveChanges();
     }
 }
Example #2
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 #3
0
 public void AddCTHDThuoc(DTO_CTHDThuoc cTHDThuoc)
 {
     DALManager.CTHDThuocDAL.AddCTHDThuoc(cTHDThuoc);
 }
Example #4
0
 public bool LoadNP_Thuoc(DTO_CTHDThuoc cTHDThuoc)
 {
     return(DALManager.CTHDThuocDAL.LoadNPThuoc(cTHDThuoc));
 }
Example #5
0
 public bool LoadNP_HoaDon(DTO_CTHDThuoc cTHDThuoc)
 {
     return(DALManager.CTHDThuocDAL.LoadNPHoaDon(cTHDThuoc));
 }