public ActionResult Edit(Silo silo) { if (ModelState.IsValid) { SiloService.UpdateSilo(silo); return RedirectToAction(INDEX_VIEW); } else { return View(GetModel(silo)); } }
public ActionResult Create(Silo silo) { if (ModelState.IsValid) { SiloService.CreateSilo(silo); return Json("Success", JsonRequestBehavior.AllowGet); //return RedirectToAction(INDEX_VIEW); } else { return Json("Error", JsonRequestBehavior.AllowGet); //return View(GetModel(silo)); } }
public void UpdateSilo(Silo silo) { SiloRepository.UpdateSilo(silo); }
public void DeleteSilo(Silo silo) { SiloRepository.DeleteSilo(silo); }
public void CreateSilo(Silo silo) { SiloRepository.CreateSilo(silo); }
public ActionResult Delete(Silo silo) { SiloService.DeleteSilo(silo); return Json(JSON_SUCCESS, JsonRequestBehavior.AllowGet); }
private SiloViewModel GetModel(Silo silo) { return new SiloViewModel(silo, PlantaService.ReadPlanta()); }
public SiloViewModel(Silo silo, IEnumerable<Planta> plantas) { Silo = silo; _plantas = plantas; }
public SiloViewModel(Silo silo) { Silo = silo; }