Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            encargo encargo = db.encargo.Find(id);

            db.encargo.Remove(encargo);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "idEncargo,fechaEncargo,fechaEntrega,monto,fkCliente,fkAnillo")] encargo encargo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(encargo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.fkAnillo  = new SelectList(db.anillo, "idAnillo", "material", encargo.fkAnillo);
     ViewBag.fkCliente = new SelectList(db.cliente, "idCliente", "nombre", encargo.fkCliente);
     return(View(encargo));
 }
Esempio n. 3
0
        // GET: encargoes/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            encargo encargo = db.encargo.Find(id);

            if (encargo == null)
            {
                return(HttpNotFound());
            }
            return(View(encargo));
        }
Esempio n. 4
0
        // GET: encargoes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            encargo encargo = db.encargo.Find(id);

            if (encargo == null)
            {
                return(HttpNotFound());
            }
            ViewBag.fkAnillo  = new SelectList(db.anillo, "idAnillo", "material", encargo.fkAnillo);
            ViewBag.fkCliente = new SelectList(db.cliente, "idCliente", "nombre", encargo.fkCliente);
            return(View(encargo));
        }