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

            db.detalleordenproductos.Remove(detalleordenproductos);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "id,OrdenCompra_Id,Productos_Id,cantidad,preciounitario,monto")] detalleordenproductos detalleordenproductos)
 {
     if (ModelState.IsValid)
     {
         db.Entry(detalleordenproductos).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Productos_Id   = new SelectList(db.productos, "id", "Codigo", detalleordenproductos.Productos_Id);
     ViewBag.OrdenCompra_Id = new SelectList(db.ordencompra, "id", "NombreProyecto", detalleordenproductos.OrdenCompra_Id);
     return(View(detalleordenproductos));
 }
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            detalleordenproductos detalleordenproductos = db.detalleordenproductos.Find(id);

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

            if (detalleordenproductos == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Productos_Id   = new SelectList(db.productos, "id", "Codigo", detalleordenproductos.Productos_Id);
            ViewBag.OrdenCompra_Id = new SelectList(db.ordencompra, "id", "NombreProyecto", detalleordenproductos.OrdenCompra_Id);
            return(View(detalleordenproductos));
        }