public ActionResult DeleteConfirmed(int id) { TB_bonEntre tb_bonentre = db.TB_bonEntre.Find(id); db.TB_bonEntre.Remove(tb_bonentre); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id_bon_entrestock,Date_entre,Description,Id_livraison,DateCreer,CreerPar")] TB_bonEntre tb_bonentre) { if (ModelState.IsValid) { db.Entry(tb_bonentre).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Id_livraison = new SelectList(db.TB_livraison, "Id_livraison", "Code_fiche", tb_bonentre.Id_livraison); return(View(tb_bonentre)); }
// GET: /BonEntrer/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TB_bonEntre tb_bonentre = db.TB_bonEntre.Find(id); if (tb_bonentre == null) { return(HttpNotFound()); } return(View(tb_bonentre)); }
// GET: /BonEntrer/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TB_bonEntre tb_bonentre = db.TB_bonEntre.Find(id); if (tb_bonentre == null) { return(HttpNotFound()); } ViewBag.Id_livraison = new SelectList(db.TB_livraison, "Id_livraison", "Code_fiche", tb_bonentre.Id_livraison); return(View(tb_bonentre)); }
// save data in table BonEntrer public JsonResult Save(TB_bonEntre tb_bonentre) { try { if (ModelState.IsValid) { db.TB_bonEntre.Add(tb_bonentre); db.SaveChanges(); return(Json(new { Success = 1, BonentrerID = tb_bonentre.Id_bon_entrestock, ex = "" })); } } catch (Exception ex) { return(Json(new { Success = 0, ex = ex.Message.ToString() })); } return(Json(new { Success = 0, ex = new Exception("les informations ne sont enregistrer").Message.ToString() })); }