public virtual void Create() { String rssLink = ctx.Post("Link"); if (strUtil.IsNullOrEmpty(rssLink)) { echoError("rss url can not be empty"); return; } long categoryId = ctx.PostLong("CategoryId"); FeedSysCategory category = categoryService.GetById(categoryId); String name = ctx.Post("Name"); FeedSource f = feedService.CreateRss(rssLink, name, category); if (f == null) { echoError("create rss error,please try again later"); return; } else { redirect(Index); } }
public virtual FeedSource CreateRss(String url, String name, FeedSysCategory category) { FeedSource f = CreateRss(url); if (f == null) { return(null); } if (strUtil.HasText(name)) { f.Name = name; } f.Category = category; f.update(); return(f); }