public ActionResult DeleteConfirmed(int?idCliente, string placa) { TCompra tCompra = db.TCompra.Find(idCliente, placa); db.TCompra.Remove(tCompra); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "IdCliente,Placa,Monto,Fecha")] TCompra tCompra) { if (ModelState.IsValid) { db.Entry(tCompra).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdCliente = new SelectList(db.TCliente, "IdCliente", "Identificacion", tCompra.IdCliente); ViewBag.Placa = new SelectList(db.TVehiculo, "Placa", "Estilo", tCompra.Placa); return(View(tCompra)); }
// GET: Compras/Details/5 public ActionResult Details(int?idCliente, string placa) { if (idCliente == null && placa == String.Empty) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TCompra tCompra = db.TCompra.Find(idCliente, placa); if (tCompra == null) { return(HttpNotFound()); } return(View(tCompra)); }
// GET: Compras/Edit/5 public ActionResult Edit(int?idCliente, string placa) { if (idCliente == null && placa == String.Empty) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TCompra tCompra = db.TCompra.Find(idCliente, placa); if (tCompra == null) { return(HttpNotFound()); } ViewBag.IdCliente = new SelectList(db.TCliente, "IdCliente", "Identificacion", tCompra.IdCliente); ViewBag.Placa = new SelectList(db.TVehiculo, "Placa", "Estilo", tCompra.Placa); return(View(tCompra)); }