예제 #1
0
        // 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));
        }
예제 #2
0
        // 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));
        }
예제 #3
0
        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"));
        }