public ActionResult Edit(int id, CommentaireModels CM) { Session["msg"] = "false"; commentaire com = cmS.GetById(id); com.text = CM.text; cmS.Update(com); UpdateModel(CM); cmS.Commit(); return(RedirectToAction("Index1")); }
public ActionResult Edit(int id, CommentaireViewModels c) { try { if (ModelState.IsValid) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } commentaires p = cs.GetById(id); p.note = c.note; p.text = c.text; p.employ_U_ID = c.employ_U_ID; // p.Employee_U_ID = f.Employee_U_ID; if (p == null) { return(HttpNotFound()); } Console.WriteLine("updaaaaaaaaaaaate"); cs.Update(p); cs.Commit(); // Service.Dispose(); return(RedirectToAction("Index")); } // TODO: Add delete logic here return(View(c)); } catch { return(View()); } }