public ProviderProfileComment SecondProviderProfileComment() { var secondProviderProfileComment = new ProviderProfileComment { CommentId = new Int32() , ProviderId = new Int32(), PosterId = new Int32(), PosterRole = new Int32(), PosterName = null, PosterPhotoPath = null, Comment = null, CommentDate = new DateTime(), PosterProfileLink = null }; return secondProviderProfileComment; }
public ActionResult InsertComment(int? id, string comment) { if (id == null) { return RedirectToAction("Index", "ProviderProfile"); } var poster = UserHelper.GetSendtoFriendPoster(HttpContext.Request.Url) ?? UserHelper.PosterHelper.DefaultPoster; if (ModelState.IsValid) { var providerComment = new ProviderProfileComment { Comment = Sanitizer.GetSafeHtmlFragment(comment), CommentDate = DateTime.UtcNow, PosterId = poster.PosterId, PosterName = poster.FirstName + " , " + poster.LastName, PosterPhotoPath = poster.ProfilePicturePath, PosterProfileLink = poster.ProfileLink, PosterRole = UserHelper.GetRoleId(poster.Role), ProviderId = id }; UnitofWork.ProviderProfileCommentRepository.Add(providerComment); UnitofWork.Save(); } return RedirectToAction("Index", new { id, insertingnewcomment = true }); }