Ejemplo n.º 1
0
        // GET: Comment/Delete/5
        public ActionResult DeleteComm(int id, string idUser, DateTime date)
        {
            commentt item = new commentt();

            item = commSer.Get(t => t.article.idArticle == id && t.idUser.Equals(idUser) && t.date == date);
            CommentViewModels g = new CommentViewModels()
            {
                idArticle   = item.idArticle,
                idUser      = item.idUser,
                description = item.description,
                date        = item.date,
            }; return(View(g));
        }
Ejemplo n.º 2
0
        public ActionResult DeleteComm(int id, string idUser, DateTime date, commentt c)
        {
            if (ModelState.IsValid)
            {
                commentt b = commSer.Get(t => t.article.idArticle == id && t.idUser.Equals(idUser) && t.date == date);

                commSer.Delete(b);
                return(RedirectToAction("Details", new { id = b.idArticle }));
            }
            else
            {
                return(View());
            }
        }
Ejemplo n.º 3
0
        public ActionResult DeleteComm(int id, commentt c)
        {
            if (ModelState.IsValid)
            {
                commentt b = commSer.GetById(id);

                commSer.Delete(b);
                return(RedirectToAction("getComment"));
            }
            else
            {
                return(View());
            }
        }
Ejemplo n.º 4
0
        // GET: Comment/Delete/5
        public ActionResult DeleteComm(int id)
        {
            commentt item = new commentt();

            item = commSer.GetById(id);
            CommentViewModels g = new CommentViewModels()
            {
                idArticle   = item.idArticle,
                idUser      = item.idUser,
                description = item.description,
                date        = item.date,
                user        = item.user,
                article     = item.article,
            }; return(View(g));
        }