public SpecialistProfileComment SecondSpecialistProfileComment() { var secondSpecialistProfileComment = new SpecialistProfileComment { CommentId = 2 , SpecialistId = 2, PosterId = new Int32(), PosterRole = new Int32(), PosterName = null, PosterPhotoPath = null, Comment = null, CommentDate = new DateTime(), PosterProfileLink = null }; return secondSpecialistProfileComment; }
public ActionResult InsertComment(int? id, string comment) { if (id == null) { return RedirectToAction("Index", "Specialists"); } PosterHelper tempQualifier = UserHelper.PosterHelper; var poster = UserHelper.PosterHelper.GetSendtoFriendPoster(tempQualifier.HttpContext.Request.Url) ?? UserHelper.PosterHelper.DefaultPoster; if (ModelState.IsValid) { var specialistComment = new SpecialistProfileComment { 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), SpecialistId = id }; UnitofWork.SpecialistProfileCommentRepository.Add(specialistComment); UnitofWork.Save(); } return RedirectToAction("Index", new { id, insertingnewcomment = true }); }