public void Update(int postId) { ContentPost post = postService.GetById(postId, ctx.owner.Id); if (post == null) { echo(lang("exDataNotFound")); return; } String sectionIds = ctx.PostIdList("postSection"); ContentValidator.ValidateEdit(post, ctx); ContentValidator.ValidateArticle(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 void Update(int postId) { ContentPost post = postService.GetById(postId, ctx.owner.Id); if (post == null) { echo(lang("exDataNotFound")); return; } ContentValidator.ValidateEdit(post, ctx); ContentValidator.ValidateTalk(post, ctx); if (errors.HasErrors) { Edit(postId); } else { postService.Update(post, null); echoToParentPart(lang("opok")); } }
public void Update(int postId) { ContentPost post = postService.GetById(postId, ctx.owner.Id); if (post == null) { echo(lang("exDataNotFound")); return; } ContentValidator.ValidateEdit(post, ctx); if (strUtil.IsNullOrEmpty(post.Content)) { errors.Add(lang("exContent")); run(Edit, postId); } else { postService.Update(post, null); echoToParentPart(lang("opok")); } }