public ActionResult Detail_AddComment(DiaryCommentEntity comment) { var model = new DetailModel(this.ServiceManager, comment.DiaryId); model.AddComment(this.Request, comment); return(this.Redirect(this.Url.Action("Detail", "Diary") + string.Format("?id={0}", comment.DiaryId))); }
public void Insert(DiaryCommentEntity item) { if (item == null) { throw new ArgumentNullException("item"); } this._repository.Insert(item); }
public void AddComment(HttpRequestBase request, DiaryCommentEntity comment) { comment.CreatedTime = DateTime.Now; comment.IPAddress = Utils.GetRequestIPAddress(request); this.ServiceManager.DiaryCommentService.Insert(comment); }