Exemple #1
0
 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));
     }
 }
Exemple #2
0
 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));
     }
 }
Exemple #3
0
 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());
     }
 }
Exemple #4
0
        public ActionResult Edit(int id)
        {
            var vehiculo = VehiculoN.ObtenerVehiculo(id);

            return(View(vehiculo));
        }
Exemple #5
0
 public ActionResult Index()
 {
     return(View(VehiculoN.GetVehiculo()));
 }