public ActionResult DeleteConfirmed(long id) { Despachos despachos = db.Despachos.Find(id); db.Despachos.Remove(despachos); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Fecha,Tipo_de_accion,Cliente,contacto,Detalle_de_productos")] Despachos despachos) { if (ModelState.IsValid) { db.Entry(despachos).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(despachos)); }
public ActionResult Edit([Bind(Include = "Id,Fecha,TipoDeAccion,IdCliente,Contacto,DetalleDeProductos")] Despachos despachos) { if (ModelState.IsValid) { db.Entry(despachos).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdCliente = new SelectList(db.Clientes, "Id", "Codigo", despachos.IdCliente); return(View(despachos)); }
public ActionResult Create([Bind(Include = "Id,Fecha,Tipo_de_accion,Cliente,contacto,Detalle_de_productos")] Despachos despachos) { if (ModelState.IsValid) { db.Despachos.Add(despachos); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(despachos)); }
// GET: Despachos/Details/5 public ActionResult Details(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Despachos despachos = db.Despachos.Find(id); if (despachos == null) { return(HttpNotFound()); } return(View(despachos)); }
// GET: Despachos/Edit/5 public ActionResult Edit(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Despachos despachos = db.Despachos.Find(id); if (despachos == null) { return(HttpNotFound()); } ViewBag.IdCliente = new SelectList(db.Clientes, "Id", "Codigo", despachos.IdCliente); return(View(despachos)); }