コード例 #1
0
        public ActionResult DeleteConfirmed(int?idCliente, string placa)
        {
            TCompra tCompra = db.TCompra.Find(idCliente, placa);

            db.TCompra.Remove(tCompra);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 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));
 }
コード例 #3
0
        // 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));
        }
コード例 #4
0
        // 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));
        }