static string CreateSecretSocieties() { var societies = Factory.Build <SecretSociety>().ToList( ); var completeHtml = HtmlGenerator.BuildWithLayout( "items", new List <string> { "Name", "Special?", "Society Points", "Leader Account", "Alt. Leader Account" }, HtmlGenerator.Build(societies) ); return(completeHtml); }
static string CreateItems() { var potentialItems = Factory.Build <PotentialItem>(); var actualItems = Factory.Build <Item>(); var itemsList = new List <IItem>(); itemsList.AddRange(potentialItems); itemsList.AddRange(actualItems); var completeHtml = HtmlGenerator.BuildWithLayout( "items", new List <string> { "Name", "Description", "Cost", "Clearance", "Suggestor" }, HtmlGenerator.Build(itemsList) ); return(completeHtml); }
static string CreateIndex( ) { var forumList = Factory.Build <Forum>(); var posts = Factory.Build <Post>().OrderBy(post => post.PostTime); var postsLists = posts.GroupBy(post => new { post.TopicId, post.ForumId }) .Select(group => new { group.Key.TopicId, group.Key.ForumId, Posts = group.ToList() }) .ToList(); foreach (var forum in forumList) { forum.Topics = postsLists.Where(topic => topic.ForumId == forum.ForumId) .Select(topic => topic.Posts) .ToList(); } var categoryList = Factory.Build <Category>().OrderBy(category => category.CatOrder).ToList(); foreach (var category in categoryList) { category.Forums = forumList.Where(forum => forum.CatId == category.CatId).OrderBy(forum => forum.ForumOrder).ToList(); } var completeHtml = HtmlGenerator.BuildWithLayout( "pln_forums", new List <string> { "Topics", "Forum", "Description", "Category", "CategoryOrder" }, HtmlGenerator.Build(categoryList) ); return(completeHtml); }