// GET: Commentaire public ActionResult Index1(CommentaireModels cm) { ViewData["nbre"] = cmS.nbreCommentaireByPolicy((int)Session["id"]); ViewData["nbreC"] = cmS.nbreCommentaireNonVu(); cm.users = cmS.UserWithCommentaireNonVu(); cm.commentaires = cmS.sortById((int)Session["id"]); return(View(cm)); }
// GET: Commentaire/Edit/5 public ActionResult Edit(int id) { commentaire com = cmS.GetById(id); CommentaireModels CM = new CommentaireModels() { text = com.text, id = com.id, }; return(View(CM)); }
public ActionResult Edit(int id, CommentaireModels CM) { commentaire com = cmS.GetById(id); com.text = CM.text; cmS.Update(com); UpdateModel(CM); cmS.Commit(); return(RedirectToAction("Index")); }