public ActionResult DeleteConfirmed(int id) { encargo encargo = db.encargo.Find(id); db.encargo.Remove(encargo); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
// 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)); }
// 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)); }