public ActionResult DeleteConfirmed(int id) { TB_lot_entrestock tb_lot_entrestock = db.TB_lot_entrestock.Find(id); db.TB_lot_entrestock.Remove(tb_lot_entrestock); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id_lot_entrestock,Date_entrer,Id_articles,Id_bon_entrestock,Quantite,Total")] TB_lot_entrestock tb_lot_entrestock) { if (ModelState.IsValid) { db.Entry(tb_lot_entrestock).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Id_articles = new SelectList(db.TB_articles, "Id_articles", "Nom_articles", tb_lot_entrestock.Id_articles); ViewBag.Id_bon_entrestock = new SelectList(db.TB_bonEntre, "Id_bon_entrestock", "Description", tb_lot_entrestock.Id_bon_entrestock); return(View(tb_lot_entrestock)); }
// GET: /LotEntrer/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TB_lot_entrestock tb_lot_entrestock = db.TB_lot_entrestock.Find(id); if (tb_lot_entrestock == null) { return(HttpNotFound()); } return(View(tb_lot_entrestock)); }
// GET: /LotEntrer/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TB_lot_entrestock tb_lot_entrestock = db.TB_lot_entrestock.Find(id); if (tb_lot_entrestock == null) { return(HttpNotFound()); } ViewBag.Id_articles = new SelectList(db.TB_articles, "Id_articles", "Nom_articles", tb_lot_entrestock.Id_articles); ViewBag.Id_bon_entrestock = new SelectList(db.TB_bonEntre, "Id_bon_entrestock", "Description", tb_lot_entrestock.Id_bon_entrestock); return(View(tb_lot_entrestock)); }
// GET: /LotEntrer/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var article = from art in db.TB_lot_entrestock where (art.Id_lot_entrestock == id) select art.Id_articles; var id_art = article.First(); var query = from qte in db.TB_lot_entrestock where qte.Id_articles == id_art select qte.Quantite; ViewBag.sumQte = query.Sum(); var alerte = from alt in db.TB_articles where (alt.Id_articles == id_art) select alt.Qte_alerte; var QteAlerte = alerte.First(); ViewBag._QteAlerte = QteAlerte; TB_lot_entrestock tb_lot_entrestock = db.TB_lot_entrestock.Find(id); if (tb_lot_entrestock == null) { return(HttpNotFound()); } return(View(tb_lot_entrestock)); }