Example #1
0
 public ActionResult Delete(Planta planta)
 {
     Planta p = PlantaService.ReadPlantaById(planta.Id);
     p.Activo = false;
     PlantaService.UpdatePlanta(p);
     //PlantaService.DeletePlanta(planta);
     return Json(JSON_SUCCESS, JsonRequestBehavior.AllowGet);
 }
Example #2
0
 public ActionResult Create(Planta planta)
 {
     if (ModelState.IsValid)
     {
         //planta.Activo = true;
         PlantaService.CreatePlanta(planta);
         return Json("Success", JsonRequestBehavior.AllowGet);
         //return RedirectToAction(INDEX_VIEW);
     }
     else
     {
         return Json("Error", JsonRequestBehavior.AllowGet);
         //return View(GetModel(planta));
     }
 }
Example #3
0
 public void UpdatePlanta(Planta planta)
 {
     PlantaRepository.UpdatePlanta(planta);
 }
Example #4
0
 public void DeletePlanta(Planta planta)
 {
     PlantaRepository.DeletePlanta(planta);
 }
Example #5
0
 public void CreatePlanta(Planta planta)
 {
     PlantaRepository.CreatePlanta(planta);
 }
Example #6
0
 public PlantaViewModel(Planta planta)
 {
     Planta = planta;
 }
Example #7
0
 private PlantaViewModel GetModel(Planta planta)
 {
     return new PlantaViewModel(planta);
 }
Example #8
0
 public ActionResult Edit(Planta planta)
 {
     if (ModelState.IsValid)
     {
         planta.Activo = true;
         PlantaService.UpdatePlanta(planta);
         return RedirectToAction(INDEX_VIEW);
     }
     else
     {
         return View(GetModel(planta));
     }
 }