public ActionResult DeleteConfirmed(int id)
        {
            CMarcaVehiculo cMarcaVehiculo = db.CMarcaVehiculo.Find(id);

            db.CMarcaVehiculo.Remove(cMarcaVehiculo);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "IdMarca,Descripcion")] CMarcaVehiculo cMarcaVehiculo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cMarcaVehiculo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cMarcaVehiculo));
 }
        public ActionResult Create([Bind(Include = "IdMarca,Descripcion")] CMarcaVehiculo cMarcaVehiculo)
        {
            if (ModelState.IsValid)
            {
                db.CMarcaVehiculo.Add(cMarcaVehiculo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(cMarcaVehiculo));
        }
        // GET: CMarcasVehiculo/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CMarcaVehiculo cMarcaVehiculo = db.CMarcaVehiculo.Find(id);

            if (cMarcaVehiculo == null)
            {
                return(HttpNotFound());
            }
            return(View(cMarcaVehiculo));
        }
Beispiel #5
0
 private void cargarMarcas()
 {
     cbMarcaVehiculo.ValueMember   = "ID_MARCAVEH";
     cbMarcaVehiculo.DisplayMember = "DESCRIPCION";
     cbMarcaVehiculo.DataSource    = CMarcaVehiculo.GetMarcas();
 }