public ActionResult RealDeleteConfirmed(string id) { DepositoDeVehiculo depositoDeVehiculo = db.DEPOSITOVEHICULO.Find(id); db.DEPOSITOVEHICULO.Remove(depositoDeVehiculo); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Descripcion,Estado,FechaDeInicio,FechaDeFin")] DepositoDeVehiculo depositoDeVehiculo) { if (ModelState.IsValid) { db.Entry(depositoDeVehiculo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(depositoDeVehiculo)); }
// GET: DepositoDeVehiculoes/Edit/5 public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DepositoDeVehiculo depositoDeVehiculo = db.DEPOSITOVEHICULO.Find(id); if (depositoDeVehiculo == null) { return(HttpNotFound()); } return(View(depositoDeVehiculo)); }
public ActionResult DeleteConfirmed(string id) { DepositoDeVehiculo depositoDeVehiculo = db.DEPOSITOVEHICULO.Find(id); if (depositoDeVehiculo.Estado == "I") { depositoDeVehiculo.Estado = "A"; } else { depositoDeVehiculo.Estado = "I"; } db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create([Bind(Include = "Id,Descripcion,Estado,FechaDeInicio,FechaDeFin")] DepositoDeVehiculo depositoDeVehiculo) { if (ModelState.IsValid) { db.DEPOSITOVEHICULO.Add(depositoDeVehiculo); string mensaje = Verificar(depositoDeVehiculo.Id); if (mensaje == "") { db.SaveChanges(); TempData["Type"] = "success"; TempData["Message"] = "El registro se realizó correctamente"; return(RedirectToAction("Index")); } else { ViewBag.Type = "warning"; ViewBag.Message = mensaje; return(View(depositoDeVehiculo)); } } return(View(depositoDeVehiculo)); }