public ActionResult CreateContent(ContentViewModel content) { var bllContent = content.ToBllContent(); bllContent.UserId = _userService.GetUserEntity(User.Identity.Name).Id; _contentService.Create(bllContent); return RedirectToAction("Index"); }
public ActionResult Create(ContentViewModel content) { if (content != null) { var temp = _contentService.Create(content.ToBllContent()); return RedirectToAction("Content", new { Id = temp.Id }); } return HttpNotFound(); }
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 }); }
public ActionResult Edit(ContentViewModel content) { _contentService.Update(content.ToBllContent()); return RedirectToAction("Content", new { Id = content.Id }); }