public ActionResult GetTasks(string id) { TaskList list = this.repository.GetTaskList(id); if (list != null) { PagedTaskSource tasks = this.repository.GetTasks(id, 1000, null, null); return(Json(tasks, JsonRequestBehavior.AllowGet)); } return(null); }
public ActionResult Rss(string listId) { if (string.IsNullOrEmpty(listId)) { IEnumerable <TaskList> lists = this.repository.GetTaskLists(User.IsInRole("Owner")); IList <FeedItem> feedItems = lists.Select(p => new FeedItem() { Title = p.Name, Description = p.IsPublic ? "Public list." : "Private list", Url = new Uri(this.GetAbsoluteUrl(p.ListId)), }).ToList(); var feed = new Feed(feedItems) { Title = "Lists", }; return(this.View(feed)); } else { TaskList list = this.repository.GetTaskList(listId); if (list != null && (Request.IsAuthenticated || list.IsPublic)) { PagedTaskSource tasks = this.repository.GetTasks(listId, 1000, null, null); IList <FeedItem> feedItems = tasks.Tasks.Select(p => new FeedItem { Title = p.Subject, Description = string.Concat(p.IsComplete ? "The task is completed" : "The task is pending", (!p.IsComplete && p.DueDate < DateTime.Now) ? " and overdue." : "."), Url = new Uri(this.GetAbsoluteUrl(listId)), Published = p.StartDate }).ToList(); Feed feed = new Feed(feedItems) { Title = list.Name, Description = "Is Public: " + list.IsPublic, Url = new Uri(this.GetAbsoluteUrl(listId)), }; return(this.View(feed)); } return(new EmptyResult()); } }