public IActionResult Edit(long id, TreatmentDetailViewModel vm) { Treatment treatment = TreatmentConverter.ViewModelToModel(vm); treatmentRepository.Update(treatment); return(RedirectToAction("index", "treatment")); }
public void UpdateFalseInput() { EmptyLists(); treatmentRepository = new TreatmentRepository(context); Exception ex = Assert.Throws <NullReferenceException>(() => treatmentRepository.Update(null)); Assert.Equal("De behandeling is leeg.", ex.Message); }
public void Update() { EmptyLists(); Treatment treatment = new Treatment(1, "een", DateTime.Today, DateTime.Today); treatmentRepository = new TreatmentRepository(context); Assert.True(treatmentRepository.Update(treatment)); }
public void UpdateT(TreatmentModelView model) { using (var treatment = new TreatmentRepository()) { Treatment treat = treatment.GetById(model.Tid); if (treat != null) { treat.Tid = model.Tid; treat.Tname = model.Tname; treatment.Update(treat); } } }