public void AddCTPhieuNhapThuoc(DTO_CTPhieuNhapThuoc ctPhieuNhapThuoc) { using (var context = new SQLServerDBContext()) { context.CTPhieuNhapThuoc.Add(ctPhieuNhapThuoc); context.SaveChanges(); } }
public void UpdatePKDK(DTO_PKDaKhoa pkdk) { using (var context = new SQLServerDBContext()) { context.Entry(pkdk).State = EntityState.Modified; context.SaveChanges(); } }
public void AddBCDoanhThu(DTO_BCDoanhThu bCDoanhThu) { using (var context = new SQLServerDBContext()) { context.BaoCaoDoanhThu.Add(bCDoanhThu); context.SaveChanges(); } }
public void UpdateBCDoanhThu(DTO_BCDoanhThu bc) { using (var context = new SQLServerDBContext()) { context.Entry(bc).State = EntityState.Modified; context.SaveChanges(); } }
public void UpdateCTBaoCaoDoanhThu(DTO_CTBaoCaoDoanhThu cTBaoCaoDoanhThu) { using (var context = new SQLServerDBContext()) { context.Entry(cTBaoCaoDoanhThu).State = EntityState.Modified; context.SaveChanges(); } }
public void AddCTHDThuoc(DTO_CTHDThuoc cTHDThuoc) { using (var context = new SQLServerDBContext()) { context.CTHoaDdonThuoc.Add(cTHDThuoc); context.SaveChanges(); } }
public void AddCTBaoCaoDoanhThu(DTO_CTBaoCaoDoanhThu cTBaoCaoDoanhThu) { using (var context = new SQLServerDBContext()) { context.CT_BaoCaoDoanhThu.Add(cTBaoCaoDoanhThu); context.SaveChanges(); } }
public void AddBCSuDungThuoc(DTO_BCSudungThuoc bCSudungThuoc) { using (var context = new SQLServerDBContext()) { context.BaoCaoSuDungThuoc.Add(bCSudungThuoc); context.SaveChanges(); } }
public void SuDungThuoc(string maThuoc, int soLuongDung) { using (var context = new SQLServerDBContext()) { var res = context.Thuoc.Where(t => t.MaThuoc == maThuoc).FirstOrDefault(); if (res != null) { res.SoLuong -= soLuongDung; } context.SaveChanges(); } }
public void CapNhatBCSDThuoc(string maThuoc, DateTime ngaySuDung, int soLuongDung) { using (var context = new SQLServerDBContext()) { var res = context.BaoCaoSuDungThuoc.Where(t => (t.MaThuoc == maThuoc) && (t.Thang == ngaySuDung.Month) && (t.Nam == ngaySuDung.Year)).FirstOrDefault(); if (res != null) { res.SoLanDung++; res.SoLuongDung += soLuongDung; } context.SaveChanges(); } }
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; } } }
public bool UpdateInfoAcc(DTO_Account acc, string username, string password) { using (var context = new SQLServerDBContext()) { var res = context.Account.FirstOrDefault(a => a.Username == acc.Username); if (res != null) { res.Username = username; res.Password = password; context.SaveChanges(); return(true); } } return(false); }
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; } } }
public bool UpdateInfoNV(DTO_NhanVien nv, string ten, DateTime ngaySinh, bool gioiTinh, string email, string diaChi, string sdt, string soCMND, string maNhom, string maPhong) { using (var context = new SQLServerDBContext()) { var res = context.NhanVien.FirstOrDefault(n => n.MaNhanVien == nv.MaNhanVien); if (res != null) { res.HoTen = ten; res.NgaySinh = ngaySinh; res.GioiTinh = gioiTinh; res.Email = email; res.DiaChi = diaChi; res.SoDienThoai = sdt; res.SoCMND = soCMND; res.MaNhom = maNhom; res.MaPhong = maPhong; context.SaveChanges(); return(true); } } return(false); }