├── README.md ├── DocX-Sample ├── template.docx ├── packages.config ├── App.config ├── Lecture.cs ├── Teacher.cs ├── Properties │ └── AssemblyInfo.cs ├── DocX-Sample.csproj ├── Program.cs └── FakeDatabase.cs ├── DocX-Sample.sln └── .gitignore /README.md: -------------------------------------------------------------------------------- 1 | # DocX-sample -------------------------------------------------------------------------------- /DocX-Sample/template.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thatcsharpguy/DocX-sample/master/DocX-Sample/template.docx -------------------------------------------------------------------------------- /DocX-Sample/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /DocX-Sample/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /DocX-Sample/Lecture.cs: -------------------------------------------------------------------------------- 1 | namespace DocX_Sample 2 | { 3 | public class Lecture 4 | { 5 | public int Id { get; set; } 6 | public int TeacherId { get; set; } 7 | public string Name { get; set; } 8 | public string Level { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /DocX-Sample/Teacher.cs: -------------------------------------------------------------------------------- 1 | namespace DocX_Sample 2 | { 3 | public class Teacher 4 | { 5 | public int Id { get; set; } 6 | public string GivenName { get; set; } 7 | public string LastName { get; set; } 8 | public string Email { get; set; } 9 | public int Age { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /DocX-Sample.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocX-Sample", "DocX-Sample\DocX-Sample.csproj", "{701CFDF1-7CE3-4495-B68C-4928E05DAD6F}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {701CFDF1-7CE3-4495-B68C-4928E05DAD6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {701CFDF1-7CE3-4495-B68C-4928E05DAD6F}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {701CFDF1-7CE3-4495-B68C-4928E05DAD6F}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {701CFDF1-7CE3-4495-B68C-4928E05DAD6F}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /DocX-Sample/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | 8 | [assembly: AssemblyTitle("DocX-SAmple")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DocX-SAmple")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | 25 | [assembly: Guid("3f7e2774-801f-4b8e-a635-4dce39515ac5")] 26 | 27 | // Version information for an assembly consists of the following four values: 28 | // 29 | // Major Version 30 | // Minor Version 31 | // Build Number 32 | // Revision 33 | // 34 | // You can specify all the values or you can default the Build and Revision Numbers 35 | // by using the '*' as shown below: 36 | // [assembly: AssemblyVersion("1.0.*")] 37 | 38 | [assembly: AssemblyVersion("1.0.0.0")] 39 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /DocX-Sample/DocX-Sample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {701CFDF1-7CE3-4495-B68C-4928E05DAD6F} 8 | Exe 9 | Properties 10 | DocX_Sample 11 | DocX-Sample 12 | v4.5 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | ..\packages\DocX.1.0.0.19\lib\net40\DocX.dll 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | Always 59 | 60 | 61 | 62 | 69 | -------------------------------------------------------------------------------- /DocX-Sample/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Linq; 4 | using Novacode; 5 | 6 | namespace DocX_Sample 7 | { 8 | internal class Program 9 | { 10 | private static FakeDatabase _database = new FakeDatabase(); 11 | 12 | 13 | private static void Main(string[] args) 14 | { 15 | var teacher = GetMostActiveTeacher(); 16 | var lectures = GetLecturesForTeacher(teacher.Id); 17 | 18 | using (var document = DocX.Create("Prueba.docx")) 19 | { 20 | var titleParagraph = document.InsertParagraph(); 21 | titleParagraph.Append("Reporte " + teacher.LastName).Heading(HeadingType.Heading1); 22 | 23 | var reportParagraph = document.InsertParagraph(); 24 | reportParagraph.Append ("Este es un reporte perteneciente a las clases que imparte "); 25 | reportParagraph.Append (teacher.GivenName + " " + teacher.LastName).Bold().Append(", generado en "); 26 | reportParagraph.Append (DateTime.Now.ToShortDateString ()).Italic().Append (". ") 27 | .Append ("El profesor/ra ").Append(teacher.LastName).Font(new FontFamily("Arial Black")) 28 | .Append(" imparte actualmente ") 29 | .Append(lectures.Length + " asignaturas.").Color(Color.Blue).Italic().Bold(); 30 | 31 | document.AddHeaders (); 32 | document.AddFooters (); 33 | 34 | var header = document.Headers.odd.InsertParagraph (); 35 | header.Append ("Reporte - That C# Guy").Font(new FontFamily("Courier New")); 36 | 37 | document.Footers.odd.PageNumbers = true; 38 | 39 | var table = document.InsertTable (1, 3); 40 | 41 | table.AutoFit = AutoFit.Window; 42 | var border = new Border (BorderStyle.Tcbs_single, BorderSize.one, 0, Color.Black); 43 | table.SetBorder (TableBorderType.InsideH, border); 44 | table.SetBorder (TableBorderType.InsideV, border); 45 | table.SetBorder (TableBorderType.Top, border); 46 | table.SetBorder (TableBorderType.Right, border); 47 | table.SetBorder (TableBorderType.Bottom, border); 48 | table.SetBorder (TableBorderType.Left, border); 49 | 50 | table.Design = TableDesign.ColorfulGrid; 51 | 52 | var tableHeaders = table.Rows[0]; 53 | tableHeaders.Cells[0].InsertParagraph().Append("ID").Bold(); 54 | tableHeaders.Cells[1].InsertParagraph().Append("Clase").Bold(); 55 | tableHeaders.Cells[2].InsertParagraph().Append("Nivel").Bold(); 56 | 57 | foreach (var lecture in lectures) 58 | { 59 | var tableRow = table.InsertRow(); 60 | tableRow.Cells[0].InsertParagraph().Append (lecture.Id.ToString()); 61 | tableRow.Cells[1].InsertParagraph().Append(lecture.Name); 62 | tableRow.Cells[2].InsertParagraph().Append(lecture.Level); 63 | } 64 | 65 | document.Save(); 66 | } 67 | 68 | 69 | using (var template = DocX.Load ("template.docx")) 70 | { 71 | template.ReplaceText("esta entrada", "este post sobre DocX"); 72 | template.ReplaceText("querido", "querido y respetable"); 73 | template.ReplaceText("Facebook", "Twitter"); 74 | template.ReplaceText("correo electrónico", "feregrino@thatcsharpguy.com"); 75 | 76 | template.SaveAs("out.docx"); 77 | } 78 | } 79 | 80 | static Teacher GetMostActiveTeacher() 81 | { 82 | var mostActiveTeacherId = (from lecture in _database.Lectures 83 | group lecture by lecture.TeacherId into group1 84 | orderby group1.Count() descending 85 | select group1.Key).FirstOrDefault(); 86 | 87 | return _database.Teachers.Single(t => t.Id == mostActiveTeacherId); 88 | } 89 | 90 | static Lecture[] GetLecturesForTeacher(int teacherId) 91 | { 92 | return _database.Lectures.Where(lecture => lecture.TeacherId == teacherId).ToArray(); 93 | } 94 | } 95 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/visualstudio,windows 2 | 3 | ### VisualStudio ### 4 | ## Ignore Visual Studio temporary files, build results, and 5 | ## files generated by popular Visual Studio add-ons. 6 | 7 | # User-specific files 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | bld/ 24 | [Bb]in/ 25 | [Oo]bj/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # DNX 46 | project.lock.json 47 | artifacts/ 48 | 49 | *_i.c 50 | *_p.c 51 | *_i.h 52 | *.ilk 53 | *.meta 54 | *.obj 55 | *.pch 56 | *.pdb 57 | *.pgc 58 | *.pgd 59 | *.rsp 60 | *.sbr 61 | *.tlb 62 | *.tli 63 | *.tlh 64 | *.tmp 65 | *.tmp_proj 66 | *.log 67 | *.vspscc 68 | *.vssscc 69 | .builds 70 | *.pidb 71 | *.svclog 72 | *.scc 73 | 74 | # Chutzpah Test files 75 | _Chutzpah* 76 | 77 | # Visual C++ cache files 78 | ipch/ 79 | *.aps 80 | *.ncb 81 | *.opendb 82 | *.opensdf 83 | *.sdf 84 | *.cachefile 85 | 86 | # Visual Studio profiler 87 | *.psess 88 | *.vsp 89 | *.vspx 90 | *.sap 91 | 92 | # TFS 2012 Local Workspace 93 | $tf/ 94 | 95 | # Guidance Automation Toolkit 96 | *.gpState 97 | 98 | # ReSharper is a .NET coding add-in 99 | _ReSharper*/ 100 | *.[Rr]e[Ss]harper 101 | *.DotSettings.user 102 | 103 | # JustCode is a .NET coding add-in 104 | .JustCode 105 | 106 | # TeamCity is a build add-in 107 | _TeamCity* 108 | 109 | # DotCover is a Code Coverage Tool 110 | *.dotCover 111 | 112 | # NCrunch 113 | _NCrunch_* 114 | .*crunch*.local.xml 115 | nCrunchTemp_* 116 | 117 | # MightyMoose 118 | *.mm.* 119 | AutoTest.Net/ 120 | 121 | # Web workbench (sass) 122 | .sass-cache/ 123 | 124 | # Installshield output folder 125 | [Ee]xpress/ 126 | 127 | # DocProject is a documentation generator add-in 128 | DocProject/buildhelp/ 129 | DocProject/Help/*.HxT 130 | DocProject/Help/*.HxC 131 | DocProject/Help/*.hhc 132 | DocProject/Help/*.hhk 133 | DocProject/Help/*.hhp 134 | DocProject/Help/Html2 135 | DocProject/Help/html 136 | 137 | # Click-Once directory 138 | publish/ 139 | 140 | # Publish Web Output 141 | *.[Pp]ublish.xml 142 | *.azurePubxml 143 | # TODO: Comment the next line if you want to checkin your web deploy settings 144 | # but database connection strings (with potential passwords) will be unencrypted 145 | *.pubxml 146 | *.publishproj 147 | 148 | # NuGet Packages 149 | *.nupkg 150 | # The packages folder can be ignored because of Package Restore 151 | **/packages/* 152 | # except build/, which is used as an MSBuild target. 153 | !**/packages/build/ 154 | # Uncomment if necessary however generally it will be regenerated when needed 155 | #!**/packages/repositories.config 156 | # NuGet v3's project.json files produces more ignoreable files 157 | *.nuget.props 158 | *.nuget.targets 159 | 160 | # Microsoft Azure Build Output 161 | csx/ 162 | *.build.csdef 163 | 164 | # Microsoft Azure Emulator 165 | ecf/ 166 | rcf/ 167 | 168 | # Microsoft Azure ApplicationInsights config file 169 | ApplicationInsights.config 170 | 171 | # Windows Store app package directory 172 | AppPackages/ 173 | BundleArtifacts/ 174 | 175 | # Visual Studio cache files 176 | # files ending in .cache can be ignored 177 | *.[Cc]ache 178 | # but keep track of directories ending in .cache 179 | !*.[Cc]ache/ 180 | 181 | # Others 182 | ClientBin/ 183 | ~$* 184 | *~ 185 | *.dbmdl 186 | *.dbproj.schemaview 187 | *.pfx 188 | *.publishsettings 189 | node_modules/ 190 | orleans.codegen.cs 191 | 192 | # RIA/Silverlight projects 193 | Generated_Code/ 194 | 195 | # Backup & report files from converting an old project file 196 | # to a newer Visual Studio version. Backup files are not needed, 197 | # because we have git ;-) 198 | _UpgradeReport_Files/ 199 | Backup*/ 200 | UpgradeLog*.XML 201 | UpgradeLog*.htm 202 | 203 | # SQL Server files 204 | *.mdf 205 | *.ldf 206 | 207 | # Business Intelligence projects 208 | *.rdl.data 209 | *.bim.layout 210 | *.bim_*.settings 211 | 212 | # Microsoft Fakes 213 | FakesAssemblies/ 214 | 215 | # GhostDoc plugin setting file 216 | *.GhostDoc.xml 217 | 218 | # Node.js Tools for Visual Studio 219 | .ntvs_analysis.dat 220 | 221 | # Visual Studio 6 build log 222 | *.plg 223 | 224 | # Visual Studio 6 workspace options file 225 | *.opt 226 | 227 | # Visual Studio LightSwitch build output 228 | **/*.HTMLClient/GeneratedArtifacts 229 | **/*.DesktopClient/GeneratedArtifacts 230 | **/*.DesktopClient/ModelManifest.xml 231 | **/*.Server/GeneratedArtifacts 232 | **/*.Server/ModelManifest.xml 233 | _Pvt_Extensions 234 | 235 | # Paket dependency manager 236 | .paket/paket.exe 237 | 238 | # FAKE - F# Make 239 | .fake/ 240 | 241 | 242 | ### Windows ### 243 | # Windows image file caches 244 | Thumbs.db 245 | ehthumbs.db 246 | 247 | # Folder config file 248 | Desktop.ini 249 | 250 | # Recycle Bin used on file shares 251 | $RECYCLE.BIN/ 252 | 253 | # Windows Installer files 254 | *.cab 255 | *.msi 256 | *.msm 257 | *.msp 258 | 259 | # Windows shortcuts 260 | *.lnk 261 | 262 | 263 | -------------------------------------------------------------------------------- /DocX-Sample/FakeDatabase.cs: -------------------------------------------------------------------------------- 1 | namespace DocX_Sample 2 | { 3 | public class FakeDatabase 4 | { 5 | private static readonly Lecture[] _lectures = 6 | { 7 | new Lecture {Id = 1, TeacherId = 10, Name = "JSON-RPC", Level = "intermediate"}, 8 | new Lecture {Id = 2, TeacherId = 3, Name = "Zenoss", Level = "advanced"}, 9 | new Lecture {Id = 3, TeacherId = 14, Name = "HDL Designer", Level = "basic"}, 10 | new Lecture {Id = 4, TeacherId = 26, Name = "Pianist", Level = "basic"}, 11 | new Lecture {Id = 5, TeacherId = 13, Name = "Java", Level = "intermediate"}, 12 | new Lecture {Id = 6, TeacherId = 14, Name = "NFPA 101", Level = "advanced"}, 13 | new Lecture {Id = 7, TeacherId = 29, Name = "TNS", Level = "advanced"}, 14 | new Lecture {Id = 8, TeacherId = 18, Name = "Gas Chromatography", Level = "advanced"}, 15 | new Lecture {Id = 9, TeacherId = 8, Name = "Whole Life", Level = "basic"}, 16 | new Lecture {Id = 10, TeacherId = 12, Name = "osCommerce", Level = "intermediate"}, 17 | new Lecture {Id = 11, TeacherId = 25, Name = "Turbines", Level = "advanced"}, 18 | new Lecture {Id = 12, TeacherId = 29, Name = "EBMS", Level = "basic"}, 19 | new Lecture {Id = 13, TeacherId = 28, Name = "RHIA", Level = "basic"}, 20 | new Lecture {Id = 14, TeacherId = 21, Name = "DBVisualizer", Level = "basic"}, 21 | new Lecture {Id = 15, TeacherId = 11, Name = "GSS", Level = "basic"}, 22 | new Lecture {Id = 16, TeacherId = 26, Name = "McKesson STAR", Level = "basic"}, 23 | new Lecture {Id = 17, TeacherId = 27, Name = "NRA", Level = "intermediate"}, 24 | new Lecture {Id = 18, TeacherId = 22, Name = "SSPS", Level = "basic"}, 25 | new Lecture {Id = 19, TeacherId = 8, Name = "Twitter API", Level = "basic"}, 26 | new Lecture {Id = 20, TeacherId = 25, Name = "FTTx", Level = "advanced"}, 27 | new Lecture {Id = 21, TeacherId = 6, Name = "Blog Marketing", Level = "intermediate"}, 28 | new Lecture {Id = 22, TeacherId = 28, Name = "FM", Level = "intermediate"}, 29 | new Lecture {Id = 23, TeacherId = 4, Name = "Global Business Development", Level = "intermediate"}, 30 | new Lecture {Id = 24, TeacherId = 12, Name = "Early Childhood Development", Level = "advanced"}, 31 | new Lecture {Id = 25, TeacherId = 8, Name = "VAS", Level = "advanced"}, 32 | new Lecture {Id = 26, TeacherId = 11, Name = "Theatre", Level = "basic"}, 33 | new Lecture {Id = 27, TeacherId = 24, Name = "OmniGraffle", Level = "advanced"}, 34 | new Lecture {Id = 28, TeacherId = 27, Name = "Video", Level = "intermediate"}, 35 | new Lecture {Id = 29, TeacherId = 14, Name = "CND", Level = "basic"}, 36 | new Lecture {Id = 30, TeacherId = 10, Name = "Legal Issues", Level = "advanced"}, 37 | new Lecture {Id = 31, TeacherId = 10, Name = "Fashion Blogging", Level = "intermediate"}, 38 | new Lecture {Id = 32, TeacherId = 8, Name = "LTACH", Level = "basic"}, 39 | new Lecture {Id = 33, TeacherId = 8, Name = "Education", Level = "intermediate"}, 40 | new Lecture {Id = 34, TeacherId = 1, Name = "Fashion Illustration", Level = "advanced"}, 41 | new Lecture {Id = 35, TeacherId = 24, Name = "Architectural Design", Level = "intermediate"}, 42 | new Lecture {Id = 36, TeacherId = 9, Name = "Workshop Facilitation", Level = "intermediate"}, 43 | new Lecture {Id = 37, TeacherId = 23, Name = "PPDS", Level = "intermediate"}, 44 | new Lecture {Id = 38, TeacherId = 29, Name = "Corporate FP&A", Level = "intermediate"}, 45 | new Lecture {Id = 39, TeacherId = 19, Name = "Bylaws", Level = "basic"}, 46 | new Lecture {Id = 40, TeacherId = 25, Name = "Win CVS", Level = "advanced"}, 47 | new Lecture {Id = 41, TeacherId = 11, Name = "Program Evaluation", Level = "advanced"}, 48 | new Lecture {Id = 42, TeacherId = 4, Name = "TGI", Level = "intermediate"}, 49 | new Lecture {Id = 43, TeacherId = 9, Name = "Corporate Tax", Level = "basic"}, 50 | new Lecture {Id = 44, TeacherId = 23, Name = "SEO", Level = "basic"}, 51 | new Lecture {Id = 45, TeacherId = 2, Name = "Strategic HR", Level = "advanced"}, 52 | new Lecture {Id = 46, TeacherId = 12, Name = "Lesson Planning", Level = "basic"}, 53 | new Lecture {Id = 47, TeacherId = 24, Name = "Insurance", Level = "advanced"}, 54 | new Lecture {Id = 48, TeacherId = 0, Name = "NVR", Level = "intermediate"}, 55 | new Lecture {Id = 49, TeacherId = 26, Name = "Volunteer Recruiting", Level = "basic"}, 56 | new Lecture {Id = 50, TeacherId = 5, Name = "Efficent", Level = "intermediate"}, 57 | new Lecture {Id = 51, TeacherId = 23, Name = "CPCU", Level = "advanced"}, 58 | new Lecture {Id = 52, TeacherId = 21, Name = "FFA", Level = "advanced"}, 59 | new Lecture {Id = 53, TeacherId = 6, Name = "SSADM", Level = "advanced"}, 60 | new Lecture {Id = 54, TeacherId = 9, Name = "Data Entry", Level = "basic"}, 61 | new Lecture {Id = 55, TeacherId = 28, Name = "PET-CT", Level = "intermediate"}, 62 | new Lecture {Id = 56, TeacherId = 27, Name = "GI", Level = "advanced"}, 63 | new Lecture {Id = 57, TeacherId = 28, Name = "Global Management", Level = "intermediate"}, 64 | new Lecture {Id = 58, TeacherId = 22, Name = "Validation", Level = "advanced"}, 65 | new Lecture {Id = 59, TeacherId = 7, Name = "Aviation", Level = "advanced"}, 66 | new Lecture {Id = 60, TeacherId = 7, Name = "Running", Level = "basic"}, 67 | new Lecture {Id = 61, TeacherId = 7, Name = "FDA", Level = "advanced"}, 68 | new Lecture {Id = 62, TeacherId = 8, Name = "RTL Coding", Level = "advanced"}, 69 | new Lecture {Id = 63, TeacherId = 24, Name = "DLX", Level = "advanced"}, 70 | new Lecture {Id = 64, TeacherId = 29, Name = "Military Training", Level = "intermediate"}, 71 | new Lecture {Id = 65, TeacherId = 8, Name = "NCFM Certified", Level = "advanced"}, 72 | new Lecture {Id = 66, TeacherId = 28, Name = "Music Education", Level = "intermediate"}, 73 | new Lecture {Id = 67, TeacherId = 15, Name = "Karaoke", Level = "basic"}, 74 | new Lecture {Id = 68, TeacherId = 0, Name = "Ffmpeg", Level = "basic"}, 75 | new Lecture {Id = 69, TeacherId = 0, Name = "Benefits Administration", Level = "advanced"}, 76 | new Lecture {Id = 70, TeacherId = 8, Name = "Electronics", Level = "basic"}, 77 | new Lecture {Id = 71, TeacherId = 26, Name = "Grants", Level = "advanced"}, 78 | new Lecture {Id = 72, TeacherId = 16, Name = "Inspection", Level = "intermediate"}, 79 | new Lecture {Id = 73, TeacherId = 6, Name = "Social Media Marketing", Level = "basic"}, 80 | new Lecture {Id = 74, TeacherId = 18, Name = "E-commerce", Level = "advanced"}, 81 | new Lecture {Id = 75, TeacherId = 26, Name = "TL1", Level = "intermediate"}, 82 | new Lecture {Id = 76, TeacherId = 5, Name = "PMC", Level = "basic"}, 83 | new Lecture {Id = 77, TeacherId = 11, Name = "FTL", Level = "advanced"}, 84 | new Lecture {Id = 78, TeacherId = 9, Name = "VLSI CAD", Level = "advanced"}, 85 | new Lecture {Id = 79, TeacherId = 14, Name = "TSYS", Level = "advanced"}, 86 | new Lecture {Id = 80, TeacherId = 3, Name = "Usability Testing", Level = "intermediate"}, 87 | new Lecture {Id = 81, TeacherId = 7, Name = "DVB-C", Level = "basic"}, 88 | new Lecture {Id = 82, TeacherId = 21, Name = "Sketching", Level = "basic"}, 89 | new Lecture {Id = 83, TeacherId = 3, Name = "ABR", Level = "advanced"}, 90 | new Lecture {Id = 84, TeacherId = 7, Name = "RDMA", Level = "intermediate"}, 91 | new Lecture {Id = 85, TeacherId = 17, Name = "Geological Mapping", Level = "basic"}, 92 | new Lecture {Id = 86, TeacherId = 23, Name = "Game Design", Level = "advanced"}, 93 | new Lecture {Id = 87, TeacherId = 18, Name = "GPS Units", Level = "basic"}, 94 | new Lecture {Id = 88, TeacherId = 19, Name = "Store Operations", Level = "intermediate"}, 95 | new Lecture {Id = 89, TeacherId = 16, Name = "RSLinx", Level = "advanced"}, 96 | new Lecture {Id = 90, TeacherId = 23, Name = "AU", Level = "advanced"}, 97 | new Lecture {Id = 91, TeacherId = 7, Name = "Purchase Management", Level = "intermediate"}, 98 | new Lecture {Id = 92, TeacherId = 8, Name = "NHPA", Level = "advanced"}, 99 | new Lecture {Id = 93, TeacherId = 8, Name = "Failure Analysis", Level = "intermediate"}, 100 | new Lecture {Id = 94, TeacherId = 19, Name = "Molecular Biology", Level = "advanced"}, 101 | new Lecture {Id = 95, TeacherId = 8, Name = "Biotechnology", Level = "advanced"}, 102 | new Lecture {Id = 96, TeacherId = 9, Name = "PVR", Level = "basic"}, 103 | new Lecture {Id = 97, TeacherId = 27, Name = "Swift", Level = "intermediate"}, 104 | new Lecture {Id = 98, TeacherId = 4, Name = "Yii", Level = "advanced"}, 105 | new Lecture {Id = 99, TeacherId = 15, Name = "Structural Dynamics", Level = "advanced"}, 106 | new Lecture {Id = 100, TeacherId = 23, Name = "LabVIEW", Level = "basic"}, 107 | new Lecture {Id = 101, TeacherId = 11, Name = "Oil & Gas", Level = "advanced"}, 108 | new Lecture {Id = 102, TeacherId = 2, Name = "Ice Cream", Level = "advanced"}, 109 | new Lecture {Id = 103, TeacherId = 26, Name = "Electrical Engineering", Level = "intermediate"}, 110 | new Lecture {Id = 104, TeacherId = 16, Name = "Rugs", Level = "basic"}, 111 | new Lecture {Id = 105, TeacherId = 26, Name = "Private Banking", Level = "intermediate"}, 112 | new Lecture {Id = 106, TeacherId = 14, Name = "CGI scripts", Level = "basic"}, 113 | new Lecture {Id = 107, TeacherId = 27, Name = "Legal Issues", Level = "advanced"}, 114 | new Lecture {Id = 108, TeacherId = 20, Name = "XACT", Level = "advanced"}, 115 | new Lecture {Id = 109, TeacherId = 25, Name = "eZ Publish", Level = "intermediate"}, 116 | new Lecture {Id = 110, TeacherId = 17, Name = "Geophysics", Level = "intermediate"}, 117 | new Lecture {Id = 111, TeacherId = 8, Name = "HCPCS", Level = "advanced"}, 118 | new Lecture {Id = 112, TeacherId = 28, Name = "Forecasting", Level = "advanced"}, 119 | new Lecture {Id = 113, TeacherId = 27, Name = "IRB", Level = "advanced"}, 120 | new Lecture {Id = 114, TeacherId = 11, Name = "People Management", Level = "basic"}, 121 | new Lecture {Id = 115, TeacherId = 5, Name = "Utility Regulation", Level = "advanced"}, 122 | new Lecture {Id = 116, TeacherId = 18, Name = "Nursing Management", Level = "advanced"}, 123 | new Lecture {Id = 117, TeacherId = 12, Name = "Global Business Development", Level = "advanced"}, 124 | new Lecture {Id = 118, TeacherId = 17, Name = "SQR", Level = "intermediate"}, 125 | new Lecture {Id = 119, TeacherId = 16, Name = "SMTP", Level = "basic"} 126 | }; 127 | 128 | private static readonly Teacher[] _teachers = 129 | { 130 | new Teacher {Id = 1, GivenName = "Janet", LastName = "Nelson", Age = 41, Email = "dnelson0@ft.com"}, 131 | new Teacher {Id = 2, GivenName = "Martha", LastName = "Brooks", Age = 42, Email = "mbrooks1@msu.edu"}, 132 | new Teacher 133 | { 134 | Id = 3, 135 | GivenName = "Janice", 136 | LastName = "Franklin", 137 | Age = 44, 138 | Email = "jfranklin2@cornell.edu" 139 | }, 140 | new Teacher {Id = 4, GivenName = "Martha", LastName = "Burke", Age = 26, Email = ""}, 141 | new Teacher 142 | { 143 | Id = 5, 144 | GivenName = "Virginia", 145 | LastName = "Williams", 146 | Age = 50, 147 | Email = "vwilliams4@wikispaces.com" 148 | }, 149 | new Teacher {Id = 6, GivenName = "Jonathan", LastName = "Graham", Age = 44, Email = ""}, 150 | new Teacher {Id = 7, GivenName = "Helen", LastName = "Snyder", Age = 41, Email = "hsnyder6@tuttocitta.it"}, 151 | new Teacher {Id = 8, GivenName = "George", LastName = "Jackson", Age = 21, Email = "gjackson7@apple.com"}, 152 | new Teacher {Id = 9, GivenName = "Carol", LastName = "Frazier", Age = 38, Email = "cfrazier8@taobao.com"}, 153 | new Teacher {Id = 10, GivenName = "Janet", LastName = "Little", Age = 38, Email = ""}, 154 | new Teacher {Id = 11, GivenName = "Frank", LastName = "Hunt", Age = 24, Email = ""}, 155 | new Teacher {Id = 12, GivenName = "Carl", LastName = "Foster", Age = 36, Email = "cfosterb@harvard.edu"}, 156 | new Teacher {Id = 13, GivenName = "Margaret", LastName = "Burton", Age = 77, Email = ""}, 157 | new Teacher {Id = 14, GivenName = "Carol", LastName = "James", Age = 30, Email = "cjamesd@com.com"}, 158 | new Teacher {Id = 15, GivenName = "Shawn", LastName = "Hanson", Age = 40, Email = "shansone@linkedin.com"}, 159 | new Teacher {Id = 16, GivenName = "Eugene", LastName = "Stevens", Age = 18, Email = "estevensf@g.co"}, 160 | new Teacher {Id = 17, GivenName = "Maria", LastName = "Myers", Age = 23, Email = "mmyersg@prnewswire.com"}, 161 | new Teacher {Id = 18, GivenName = "Terry", LastName = "Williams", Age = 26, Email = "tlawrenceh@wiley.com"}, 162 | new Teacher {Id = 19, GivenName = "Phyllis", LastName = "Burns", Age = 33, Email = "pburnsi@umn.edu"}, 163 | new Teacher 164 | { 165 | Id = 20, 166 | GivenName = "Emily", 167 | LastName = "Robertson", 168 | Age = 35, 169 | Email = "erobertsonj@oracle.com" 170 | }, 171 | new Teacher 172 | { 173 | Id = 21, 174 | GivenName = "Janet", 175 | LastName = "Gordon", 176 | Age = 45, 177 | Email = "cgordonk@barnesandnoble.com" 178 | }, 179 | new Teacher 180 | { 181 | Id = 22, 182 | GivenName = "Linda", 183 | LastName = "Ramirez", 184 | Age = 24, 185 | Email = "lramirezl@bravesites.com" 186 | }, 187 | new Teacher {Id = 23, GivenName = "Lillian", LastName = "Lynch", Age = 39, Email = "llynchm@thetimes.co.uk"}, 188 | new Teacher {Id = 24, GivenName = "Christopher", LastName = "Jackson", Age = 54, Email = ""}, 189 | new Teacher {Id = 25, GivenName = "Laura", LastName = "Williams", Age = 67, Email = ""}, 190 | new Teacher {Id = 26, GivenName = "William", LastName = "Allen", Age = 16, Email = "wallenp@army.mil"}, 191 | new Teacher {Id = 27, GivenName = "Henry", LastName = "Arnold", Age = 33, Email = "harnoldq@exblog.jp"}, 192 | new Teacher {Id = 28, GivenName = "Nancy", LastName = "Peters", Age = 39, Email = "npetersr@engadget.com"}, 193 | new Teacher {Id = 29, GivenName = "Janet", LastName = "Torres", Age = 50, Email = "storress@npr.org"}, 194 | new Teacher 195 | { 196 | Id = 30, 197 | GivenName = "Ruth", 198 | LastName = "Williams", 199 | Age = 26, 200 | Email = "rbishopt@ezinearticles.com" 201 | } 202 | }; 203 | 204 | public Lecture[] Lectures 205 | { 206 | get { return _lectures; } 207 | } 208 | 209 | public Teacher[] Teachers 210 | { 211 | get { return _teachers; } 212 | } 213 | } 214 | } --------------------------------------------------------------------------------