示例#1
0
 public ActionResult CreateContent(ContentViewModel content)
 {
     var bllContent = content.ToBllContent();
     bllContent.UserId = _userService.GetUserEntity(User.Identity.Name).Id;
      _contentService.Create(bllContent);
     return RedirectToAction("Index");
 }
示例#2
0
 public ActionResult Create(ContentViewModel content)
 {
     if (content != null)
     {
         var temp = _contentService.Create(content.ToBllContent());
         return RedirectToAction("Content", new { Id = temp.Id });
     }
     return HttpNotFound();
 }
示例#3
0
 public ActionResult Dislike(ContentViewModel content)
 {
     var rating = _contentService.DownVoteContent(content.ToBllContent(), _userService.GetUserEntity(User.Identity.Name));
     if (Request.IsAjaxRequest())
     {
         return Content(rating.ToString() + "<style> #voting {display:none} </style > ", "text/html");
     }
     return RedirectToAction("Content", new { id = content.Id });
 }
示例#4
0
 public ActionResult Edit(ContentViewModel content)
 {
     _contentService.Update(content.ToBllContent());
     return RedirectToAction("Content", new { Id = content.Id });
 }