public ActionResult Delete(int identificador) { try { VehiculoN.Eliminar(identificador); return(Json(new { ok = true, toRedirect = Url.Action("Index") }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { ok = false, msg = ex.Message }, JsonRequestBehavior.AllowGet)); } }
public ActionResult Edit(Vehiculo vehiculo) { try { VehiculoN.Editar(vehiculo); return(Json(new { ok = true, toRedirect = Url.Action("Index") }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { ok = false, msg = ex.Message }, JsonRequestBehavior.AllowGet)); } }
public ActionResult Create(Vehiculo vehiculo) { try { VehiculoN.Agregar(vehiculo); //return Json(new { ok = true, toRedirect = Url.Action("Index") }, JsonRequestBehavior.AllowGet); return(RedirectToAction("Index")); } catch (Exception ex) { //return Json(new { ok = false, msg = ex.Message }, JsonRequestBehavior.AllowGet); ModelState.AddModelError("", "Ocurrió un error al agregar un Empleado"); return(View()); } }
public ActionResult Edit(int id) { var vehiculo = VehiculoN.ObtenerVehiculo(id); return(View(vehiculo)); }
public ActionResult Index() { return(View(VehiculoN.GetVehiculo())); }