public void MuonSach(int id, MuonSachModel model) { var entity = new MuonTraSach() { SachId = id, DocGiaId = model.DocGiaId, // SachId = model.SachId, NgayMuon = model.NgayMuon }; var docGia = _docGiaRepository.Get(model.DocGiaId); _muonTraSachRepository.Insert(entity); docGia.SoSachDangMuon += 1; _docGiaRepository.Update(docGia); }
public void DeleteDocGia(int id) { var docGia = _repository.Get(id); _repository.Delete(docGia); }