public ActionResult Edit(Guid id) { var barn = _barnService.GetById(id); var barnForm = BarnForm.FromBarn(barn); return(View(barnForm)); }
public ActionResult Edit(Guid id, BarnForm barnForm) { if (!ModelState.IsValid) { return View(barnForm); } _barnService.Edit(barnForm.ToBarn()); return RedirectToAction("Index", new BarnListFiltersModel().GetRouteValues()).WithSuccess("Galpón Editado"); }
public ActionResult Edit(Guid id, BarnForm barnForm) { if (!ModelState.IsValid) { return(View(barnForm)); } _barnService.Edit(barnForm.ToBarn()); return(RedirectToAction("Index", new BarnListFiltersModel().GetRouteValues()).WithSuccess("Galpón Editado")); }
public ActionResult Create(BarnForm barnForm) { if (!ModelState.IsValid) { return View(barnForm); } var barn = barnForm.ToBarn(); _barnService.Create(barn); return RedirectToAction("Index", new BarnListFiltersModel().GetRouteValues()).WithSuccess("Galpón Creado"); }
public ActionResult Create(BarnForm barnForm) { if (!ModelState.IsValid) { return(View(barnForm)); } var barn = barnForm.ToBarn(); _barnService.Create(barn); return(RedirectToAction("Index", new BarnListFiltersModel().GetRouteValues()).WithSuccess("Galpón Creado")); }
public ActionResult Create() { var barnForm = new BarnForm(); return View(barnForm); }
public ActionResult Create() { var barnForm = new BarnForm(); return(View(barnForm)); }