public void Update(int postId) { ContentPost post = postService.GetById(postId, ctx.owner.Id); if (post == null) { echo(lang("exDataNotFound")); return; } ContentValidator.SetPostValue(post, ctx); ContentValidator.ValidateTalk(post, ctx); if (errors.HasErrors) { Edit(postId); } else { post.Title = strUtil.SubString(post.Content, 20); postService.Update(post, ctx.Post("TagList")); echoToParentPart(lang("opok")); HtmlHelper.SetPostToContext(ctx, post); } }
public void Update(int postId) { ContentPost post = topicService.GetById(postId, ctx.owner.Id); if (post == null) { echo(lang("exDataNotFound")); return; } post = ContentValidator.SetPostValue(post, ctx); String sectionIds = sectionService.GetSectionIdsByPost(post.Id); topicService.Update(post, sectionIds, ctx.Post("TagList")); // update Poll ContentPoll poll = pollService.GetByTopicId(postId); poll.Title = post.Title; poll.Created = post.Created; poll.Hits = post.Hits; pollService.Update(poll); echoToParentPart(lang("opok")); HtmlHelper.SetPostToContext(ctx, post); }
public void Update(int postId) { ContentPost post = postService.GetById(postId, ctx.owner.Id); if (post == null) { echoError(lang("exDataNotFound")); return; } String sectionIds = ctx.PostIdList("postSection"); if (strUtil.IsNullOrEmpty(sectionIds)) { echoError("请选择区块"); return; } ContentValidator.SetPostValue(post, ctx); ContentValidator.ValidateTitleBody(post, ctx); if (errors.HasErrors) { run(Edit, postId); } else { if (ctx.PostIsCheck("saveContentPic") == 1) { post.Content = wojilu.Net.PageLoader.ProcessPic(post.Content, null); } postService.Update(post, sectionIds, ctx.Post("TagList")); echoToParentPart(lang("opok")); } }
public virtual void Update(long postId) { ContentPost post = postService.GetById(postId, ctx.owner.Id); if (post == null) { echo(lang("exDataNotFound")); return; } ContentValidator.SetPostValue(post, ctx); ContentValidator.ValidateVideo(post, ctx); if (ctx.HasErrors) { run(Edit, postId); } else { postService.Update(post, ctx.Post("TagList")); echoToParentPart(lang("opok")); HtmlHelper.SetPostToContext(ctx, post); } }
public virtual void Update(long postId) { ContentPost post = postService.GetById(postId, ctx.owner.Id); if (post == null) { echo(lang("exDataNotFound")); return; } ContentValidator.SetPostValue(post, ctx); if (strUtil.IsNullOrEmpty(post.Content)) { errors.Add(lang("exContent")); run(Edit, postId); } else { postService.Update(post, null); echoToParentPart(lang("opok")); HtmlHelper.SetPostToContext(ctx, post); } }