public void GetEditViewTest() { var model = _applicationDbContext.Types.First(); TypesUpdateModel updateModel = _typesService.GetEditView(model.ID); Assert.IsNotNull(updateModel); }
public void Update(int id, TypesUpdateModel type) { var _type = _typesRepository.Get(id); if (_type == null) { throw new ApplicationException("Błąd, blad edycji"); } _type.Update(type); if (!_typesRepository.Update(_type)) { throw new ApplicationException(); } }
public ActionResult Edit(int id, TypesUpdateModel typesUpdate) { if (!ModelState.IsValid) { return(View(typesUpdate)); } try { _typesService.Update(id, typesUpdate); } catch (Exception e) { return(new HttpStatusCodeResult(500, e.Message)); } return(RedirectToAction("Index")); }
public void Update(TypesUpdateModel typesCreate) { Description = typesCreate.Description; }