public ActionResult DeleteConfirmed(int id) { tbl_Ventas tbl_Ventas = db.tbl_Ventas.Find(id); db.tbl_Ventas.Remove(tbl_Ventas); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "vent_IdVentasPk,vent_FechaVenta,vent_IdClienteFk,vent_IdProductoFk")] tbl_Ventas tbl_Ventas) { if (ModelState.IsValid) { db.Entry(tbl_Ventas).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.vent_IdClienteFk = new SelectList(db.tbl_Clientes, "clie_IdClientePk", "clie_Descripcion", tbl_Ventas.vent_IdClienteFk); ViewBag.vent_IdProductoFk = new SelectList(db.tbl_Productos, "prod_IdProductoPk", "prod_Descripcion", tbl_Ventas.vent_IdProductoFk); return(View(tbl_Ventas)); }
// GET: tbl_Ventas/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbl_Ventas tbl_Ventas = db.tbl_Ventas.Find(id); if (tbl_Ventas == null) { return(HttpNotFound()); } return(View(tbl_Ventas)); }
// GET: tbl_Ventas/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbl_Ventas tbl_Ventas = db.tbl_Ventas.Find(id); if (tbl_Ventas == null) { return(HttpNotFound()); } ViewBag.vent_IdClienteFk = new SelectList(db.tbl_Clientes, "clie_IdClientePk", "clie_Descripcion", tbl_Ventas.vent_IdClienteFk); ViewBag.vent_IdProductoFk = new SelectList(db.tbl_Productos, "prod_IdProductoPk", "prod_Descripcion", tbl_Ventas.vent_IdProductoFk); return(View(tbl_Ventas)); }