├── README.md ├── EPPlus-Sample ├── teachers.xlsx ├── packages.config ├── App.config ├── Lecture.cs ├── Teacher.cs ├── Properties │ └── AssemblyInfo.cs ├── EPPlus-Sample.csproj ├── Program.cs └── FakeDatabase.cs ├── EPPlus-Sample.sln └── .gitignore /README.md: -------------------------------------------------------------------------------- 1 | # EPPlus-sample -------------------------------------------------------------------------------- /EPPlus-Sample/teachers.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thatcsharpguy/EPPlus-sample/master/EPPlus-Sample/teachers.xlsx -------------------------------------------------------------------------------- /EPPlus-Sample/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /EPPlus-Sample/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /EPPlus-Sample/Lecture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace EPPlus_Sample 8 | { 9 | public class Lecture 10 | { 11 | public int Id { get; set; } 12 | public int TeacherId { get; set; } 13 | public string Name { get; set; } 14 | public string Level { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /EPPlus-Sample/Teacher.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace EPPlus_Sample 8 | { 9 | public class Teacher 10 | { 11 | public int Id { get; set; } 12 | public string GivenName { get; set; } 13 | public string LastName { get; set; } 14 | public string Email { get; set; } 15 | public int Age { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /EPPlus-Sample.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EPPlus-Sample", "EPPlus-Sample\EPPlus-Sample.csproj", "{DECF3725-0423-4589-BAC6-D00CED0B7AC7}" 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 | {DECF3725-0423-4589-BAC6-D00CED0B7AC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {DECF3725-0423-4589-BAC6-D00CED0B7AC7}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {DECF3725-0423-4589-BAC6-D00CED0B7AC7}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {DECF3725-0423-4589-BAC6-D00CED0B7AC7}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /EPPlus-Sample/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // La información general de un ensamblado se controla mediante el siguiente 6 | // conjunto de atributos. Cambie estos valores de atributo para modificar la información 7 | // asociada con un ensamblado. 8 | [assembly: AssemblyTitle("EPPlus.Sample")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("EPPlus.Sample")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Si establece ComVisible en false, los tipos de este ensamblado no estarán visibles 18 | // para los componentes COM. Si necesita obtener acceso a un tipo de este ensamblado desde 19 | // COM, establezca el atributo ComVisible en true en este tipo. 20 | [assembly: ComVisible(false)] 21 | 22 | // El siguiente GUID sirve como id. de typelib si este proyecto se expone a COM. 23 | [assembly: Guid("decf3725-0423-4589-bac6-d00ced0b7ac7")] 24 | 25 | // La información de versión de un ensamblado consta de los cuatro valores siguientes: 26 | // 27 | // Versión principal 28 | // Versión secundaria 29 | // Número de compilación 30 | // Revisión 31 | // 32 | // Puede especificar todos los valores o usar los valores predeterminados de número de compilación y de revisión 33 | // mediante el carácter '*', como se muestra a continuación: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /EPPlus-Sample/EPPlus-Sample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {DECF3725-0423-4589-BAC6-D00CED0B7AC7} 8 | Exe 9 | Properties 10 | EPPlus_Sample 11 | EPPlus-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 | ..\packages\EPPlus.4.0.5\lib\net20\EPPlus.dll 37 | True 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | Always 61 | 62 | 63 | 64 | 71 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | 24 | # Visual Studio 2015 cache/options directory 25 | .vs/ 26 | # Uncomment if you have tasks that create the project's static files in wwwroot 27 | #wwwroot/ 28 | 29 | # MSTest test Results 30 | [Tt]est[Rr]esult*/ 31 | [Bb]uild[Ll]og.* 32 | 33 | # NUNIT 34 | *.VisualState.xml 35 | TestResult.xml 36 | 37 | # Build Results of an ATL Project 38 | [Dd]ebugPS/ 39 | [Rr]eleasePS/ 40 | dlldata.c 41 | 42 | # DNX 43 | project.lock.json 44 | artifacts/ 45 | 46 | *_i.c 47 | *_p.c 48 | *_i.h 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.tmp_proj 63 | *.log 64 | *.vspscc 65 | *.vssscc 66 | .builds 67 | *.pidb 68 | *.svclog 69 | *.scc 70 | 71 | # Chutzpah Test files 72 | _Chutzpah* 73 | 74 | # Visual C++ cache files 75 | ipch/ 76 | *.aps 77 | *.ncb 78 | *.opendb 79 | *.opensdf 80 | *.sdf 81 | *.cachefile 82 | 83 | # Visual Studio profiler 84 | *.psess 85 | *.vsp 86 | *.vspx 87 | *.sap 88 | 89 | # TFS 2012 Local Workspace 90 | $tf/ 91 | 92 | # Guidance Automation Toolkit 93 | *.gpState 94 | 95 | # ReSharper is a .NET coding add-in 96 | _ReSharper*/ 97 | *.[Rr]e[Ss]harper 98 | *.DotSettings.user 99 | 100 | # JustCode is a .NET coding add-in 101 | .JustCode 102 | 103 | # TeamCity is a build add-in 104 | _TeamCity* 105 | 106 | # DotCover is a Code Coverage Tool 107 | *.dotCover 108 | 109 | # NCrunch 110 | _NCrunch_* 111 | .*crunch*.local.xml 112 | nCrunchTemp_* 113 | 114 | # MightyMoose 115 | *.mm.* 116 | AutoTest.Net/ 117 | 118 | # Web workbench (sass) 119 | .sass-cache/ 120 | 121 | # Installshield output folder 122 | [Ee]xpress/ 123 | 124 | # DocProject is a documentation generator add-in 125 | DocProject/buildhelp/ 126 | DocProject/Help/*.HxT 127 | DocProject/Help/*.HxC 128 | DocProject/Help/*.hhc 129 | DocProject/Help/*.hhk 130 | DocProject/Help/*.hhp 131 | DocProject/Help/Html2 132 | DocProject/Help/html 133 | 134 | # Click-Once directory 135 | publish/ 136 | 137 | # Publish Web Output 138 | *.[Pp]ublish.xml 139 | *.azurePubxml 140 | # TODO: Comment the next line if you want to checkin your web deploy settings 141 | # but database connection strings (with potential passwords) will be unencrypted 142 | *.pubxml 143 | *.publishproj 144 | 145 | # NuGet Packages 146 | *.nupkg 147 | # The packages folder can be ignored because of Package Restore 148 | **/packages/* 149 | # except build/, which is used as an MSBuild target. 150 | !**/packages/build/ 151 | # Uncomment if necessary however generally it will be regenerated when needed 152 | #!**/packages/repositories.config 153 | # NuGet v3's project.json files produces more ignoreable files 154 | *.nuget.props 155 | *.nuget.targets 156 | 157 | # Microsoft Azure Build Output 158 | csx/ 159 | *.build.csdef 160 | 161 | # Microsoft Azure Emulator 162 | ecf/ 163 | rcf/ 164 | 165 | # Microsoft Azure ApplicationInsights config file 166 | ApplicationInsights.config 167 | 168 | # Windows Store app package directory 169 | AppPackages/ 170 | BundleArtifacts/ 171 | 172 | # Visual Studio cache files 173 | # files ending in .cache can be ignored 174 | *.[Cc]ache 175 | # but keep track of directories ending in .cache 176 | !*.[Cc]ache/ 177 | 178 | # Others 179 | ClientBin/ 180 | ~$* 181 | *~ 182 | *.dbmdl 183 | *.dbproj.schemaview 184 | *.pfx 185 | *.publishsettings 186 | node_modules/ 187 | orleans.codegen.cs 188 | 189 | # RIA/Silverlight projects 190 | Generated_Code/ 191 | 192 | # Backup & report files from converting an old project file 193 | # to a newer Visual Studio version. Backup files are not needed, 194 | # because we have git ;-) 195 | _UpgradeReport_Files/ 196 | Backup*/ 197 | UpgradeLog*.XML 198 | UpgradeLog*.htm 199 | 200 | # SQL Server files 201 | *.mdf 202 | *.ldf 203 | 204 | # Business Intelligence projects 205 | *.rdl.data 206 | *.bim.layout 207 | *.bim_*.settings 208 | 209 | # Microsoft Fakes 210 | FakesAssemblies/ 211 | 212 | # GhostDoc plugin setting file 213 | *.GhostDoc.xml 214 | 215 | # Node.js Tools for Visual Studio 216 | .ntvs_analysis.dat 217 | 218 | # Visual Studio 6 build log 219 | *.plg 220 | 221 | # Visual Studio 6 workspace options file 222 | *.opt 223 | 224 | # Visual Studio LightSwitch build output 225 | **/*.HTMLClient/GeneratedArtifacts 226 | **/*.DesktopClient/GeneratedArtifacts 227 | **/*.DesktopClient/ModelManifest.xml 228 | **/*.Server/GeneratedArtifacts 229 | **/*.Server/ModelManifest.xml 230 | _Pvt_Extensions 231 | 232 | # Paket dependency manager 233 | .paket/paket.exe 234 | 235 | # FAKE - F# Make 236 | .fake/ 237 | -------------------------------------------------------------------------------- /EPPlus-Sample/Program.cs: -------------------------------------------------------------------------------- 1 | using OfficeOpenXml; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Drawing; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using OfficeOpenXml.Style; 10 | 11 | namespace EPPlus_Sample 12 | { 13 | class Program 14 | { 15 | static readonly FakeDatabase Database = new FakeDatabase(); 16 | static void Main(string[] args) 17 | { 18 | 19 | if (System.IO.File.Exists("prueba.xlsx")) 20 | { 21 | System.IO.File.Delete("prueba.xlsx"); 22 | } 23 | 24 | FileInfo prueba = new FileInfo("prueba.xlsx"); 25 | 26 | using (ExcelPackage excel = new ExcelPackage(prueba)) 27 | { 28 | 29 | AddTeachers(excel.Workbook); 30 | 31 | AddLectures(excel.Workbook); 32 | 33 | AddSummary(excel.Workbook); 34 | 35 | HighlightCells(excel.Workbook); 36 | 37 | AddConditionalFormatting(excel.Workbook); 38 | 39 | excel.Save(); 40 | } 41 | 42 | 43 | 44 | FileInfo uploaded = new FileInfo("teachers.xlsx"); 45 | 46 | using (ExcelPackage excel = new ExcelPackage(uploaded)) 47 | { 48 | var teacherWorksheet = excel.Workbook.Worksheets.Single(ws => ws.Name == "Maestros"); 49 | var cells = teacherWorksheet.Cells; 50 | int rowCount = cells["A:A"].Count(); 51 | 52 | for (int i = 1; i <= rowCount; i++) 53 | { 54 | Console.WriteLine( 55 | cells["A" + i].Value.ToString() + "\t" + 56 | cells["B" + i].Value.ToString() + "\t" + 57 | cells["C" + i].Value.ToString() + "\t" + 58 | cells["D" + i].Value.ToString() + "\t" 59 | ); 60 | } 61 | 62 | 63 | } 64 | 65 | 66 | Console.Read(); 67 | } 68 | 69 | private static void AddConditionalFormatting(ExcelWorkbook wb) 70 | { 71 | var teacherWorksheet = wb.Worksheets.Single(ws => ws.Name == "Maestros"); 72 | 73 | 74 | var lectureLevelCells = teacherWorksheet.Cells["E:E"].Skip(1); 75 | var ageCellsStringAddress = "$E$2:$E$31"; 76 | var ageCellsAddress = new ExcelAddress(ageCellsStringAddress); 77 | 78 | var formatting = teacherWorksheet.ConditionalFormatting.AddTwoColorScale(ageCellsAddress); 79 | formatting.LowValue.Type = OfficeOpenXml.ConditionalFormatting.eExcelConditionalFormattingValueObjectType.Formula; 80 | formatting.HighValue.Type = OfficeOpenXml.ConditionalFormatting.eExcelConditionalFormattingValueObjectType.Formula; 81 | formatting.LowValue.Formula = "MIN(" + ageCellsAddress + ")"; 82 | formatting.LowValue.Color = Color.LightGreen; 83 | 84 | formatting.HighValue.Formula = "MAX(" + ageCellsAddress + ")"; 85 | formatting.HighValue.Color = Color.Green; 86 | } 87 | 88 | private static void AddSummary(ExcelWorkbook wb) 89 | { 90 | var teacherWorksheet = wb.Worksheets.Add("Resumen"); 91 | 92 | var titleCell = teacherWorksheet.Cells["A1:B1"]; 93 | titleCell.Merge = true; 94 | titleCell.Style.Font.Bold = true; 95 | titleCell.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center; 96 | titleCell.Value = "Resumen"; 97 | 98 | // Supported functions http://epplus.codeplex.com/wikipage?title=Supported%20Functions 99 | 100 | teacherWorksheet.Cells["A2:A4"].Style.Font.Bold = true; 101 | 102 | teacherWorksheet.Cells["A2"].Value = "Edad promedio"; 103 | teacherWorksheet.Cells["B2"].Formula = "AVERAGE(Maestros!E2:E" + (Database.Teachers.Count() + 1) + ")"; 104 | 105 | teacherWorksheet.Cells["A3"].Value = "Profesores sin email"; 106 | teacherWorksheet.Cells["B3"].Formula = "COUNTIF(Maestros!D2:D" + (Database.Teachers.Count() + 1) + ",\"\")"; 107 | } 108 | 109 | private static void HighlightCells(ExcelWorkbook wb) 110 | { 111 | var teacherWorksheet = wb.Worksheets.Single(ws => ws.Name == "Maestros"); 112 | 113 | var cellsWithYoungTeachers = from cell in teacherWorksheet.Cells["E:E"].Skip(1) 114 | where ((int)cell.Value) < 20 115 | select cell; 116 | 117 | foreach (var cell in cellsWithYoungTeachers) 118 | { 119 | cell.Style.Fill.PatternType = ExcelFillStyle.DarkDown; 120 | cell.Style.Fill.BackgroundColor.SetColor(Color.Indigo); 121 | cell.Style.Font.Color.SetColor(Color.Snow); 122 | } 123 | 124 | 125 | var lecturesWorksheet = wb.Worksheets 126 | .Single(ws => ws.Name == "Clases"); 127 | 128 | var willamsTeachersCells = from cell in lecturesWorksheet.Cells["D:D"].Skip(1) 129 | where ((string)cell.Value) == "advanced" 130 | select cell; 131 | 132 | foreach (var cell in willamsTeachersCells) 133 | { 134 | cell.Style.Border.BorderAround(ExcelBorderStyle.MediumDashDot, Color.Blue); 135 | } 136 | } 137 | 138 | public static void AddTeachers(ExcelWorkbook wb) 139 | { 140 | var teacherWorksheet = wb.Worksheets.Add("Maestros"); 141 | 142 | teacherWorksheet.Cells["A1"].Value = "ID"; 143 | teacherWorksheet.Cells["B1"].Value = "Nombre"; 144 | teacherWorksheet.Cells["C1"].Value = "Apellidos"; 145 | teacherWorksheet.Cells["D1"].Value = "Email"; 146 | teacherWorksheet.Cells["E1"].Value = "Edad"; 147 | 148 | teacherWorksheet.Cells["A1:E1"].Style.Font.Bold = true; 149 | 150 | int cell = 2; 151 | foreach (var teacher in Database.Teachers) 152 | { 153 | 154 | teacherWorksheet.Cells["A" + cell].Value = teacher.Id; 155 | teacherWorksheet.Cells["B" + cell].Value = teacher.GivenName; 156 | teacherWorksheet.Cells["C" + cell].Value = teacher.LastName; 157 | teacherWorksheet.Cells["D" + cell].Value = teacher.Email; 158 | teacherWorksheet.Cells["E" + cell].Value = teacher.Age; 159 | 160 | cell++; 161 | } 162 | } 163 | 164 | 165 | public static void AddLectures(ExcelWorkbook wb) 166 | { 167 | var worksheet = wb.Worksheets.Add("Clases"); 168 | 169 | worksheet.Cells["A1"].Value = "ID"; 170 | worksheet.Cells["B1"].Value = "Nombre"; 171 | worksheet.Cells["C1"].Value = "ID Maestro"; 172 | worksheet.Cells["D1"].Value = "Nivel"; 173 | 174 | worksheet.Cells["A1:D1"].Style.Font.Bold = true; 175 | 176 | var query = from t in Database.Teachers 177 | join c in Database.Lectures on t.Id equals c.TeacherId 178 | select new { c.Id, c.Name, c.TeacherId, Teacher = t.GivenName + " " + t.LastName, c.Level }; 179 | 180 | int cell = 2; 181 | foreach (var lectuire in query) 182 | { 183 | 184 | worksheet.Cells["A" + cell].Value = lectuire.Id; 185 | worksheet.Cells["B" + cell].Value = lectuire.Name; 186 | worksheet.Cells["C" + cell].Value = lectuire.TeacherId; 187 | worksheet.Cells["C" + cell].AddComment(lectuire.Teacher, "Antonio Feregrino"); 188 | worksheet.Cells["D" + cell].Value = lectuire.Level; 189 | 190 | cell++; 191 | } 192 | } 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /EPPlus-Sample/FakeDatabase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace EPPlus_Sample 8 | { 9 | public class FakeDatabase 10 | { 11 | private static readonly Lecture[] _lectures = 12 | { 13 | new Lecture {Id = 1, TeacherId = 10, Name = "JSON-RPC", Level = "intermediate"}, 14 | new Lecture {Id = 2, TeacherId = 3, Name = "Zenoss", Level = "advanced"}, 15 | new Lecture {Id = 3, TeacherId = 14, Name = "HDL Designer", Level = "basic"}, 16 | new Lecture {Id = 4, TeacherId = 26, Name = "Pianist", Level = "basic"}, 17 | new Lecture {Id = 5, TeacherId = 13, Name = "Java", Level = "intermediate"}, 18 | new Lecture {Id = 6, TeacherId = 14, Name = "NFPA 101", Level = "advanced"}, 19 | new Lecture {Id = 7, TeacherId = 29, Name = "TNS", Level = "advanced"}, 20 | new Lecture {Id = 8, TeacherId = 18, Name = "Gas Chromatography", Level = "advanced"}, 21 | new Lecture {Id = 9, TeacherId = 8, Name = "Whole Life", Level = "basic"}, 22 | new Lecture {Id = 10, TeacherId = 12, Name = "osCommerce", Level = "intermediate"}, 23 | new Lecture {Id = 11, TeacherId = 25, Name = "Turbines", Level = "advanced"}, 24 | new Lecture {Id = 12, TeacherId = 29, Name = "EBMS", Level = "basic"}, 25 | new Lecture {Id = 13, TeacherId = 28, Name = "RHIA", Level = "basic"}, 26 | new Lecture {Id = 14, TeacherId = 21, Name = "DBVisualizer", Level = "basic"}, 27 | new Lecture {Id = 15, TeacherId = 11, Name = "GSS", Level = "basic"}, 28 | new Lecture {Id = 16, TeacherId = 26, Name = "McKesson STAR", Level = "basic"}, 29 | new Lecture {Id = 17, TeacherId = 27, Name = "NRA", Level = "intermediate"}, 30 | new Lecture {Id = 18, TeacherId = 22, Name = "SSPS", Level = "basic"}, 31 | new Lecture {Id = 19, TeacherId = 8, Name = "Twitter API", Level = "basic"}, 32 | new Lecture {Id = 20, TeacherId = 25, Name = "FTTx", Level = "advanced"}, 33 | new Lecture {Id = 21, TeacherId = 6, Name = "Blog Marketing", Level = "intermediate"}, 34 | new Lecture {Id = 22, TeacherId = 28, Name = "FM", Level = "intermediate"}, 35 | new Lecture {Id = 23, TeacherId = 4, Name = "Global Business Development", Level = "intermediate"}, 36 | new Lecture {Id = 24, TeacherId = 12, Name = "Early Childhood Development", Level = "advanced"}, 37 | new Lecture {Id = 25, TeacherId = 8, Name = "VAS", Level = "advanced"}, 38 | new Lecture {Id = 26, TeacherId = 11, Name = "Theatre", Level = "basic"}, 39 | new Lecture {Id = 27, TeacherId = 24, Name = "OmniGraffle", Level = "advanced"}, 40 | new Lecture {Id = 28, TeacherId = 27, Name = "Video", Level = "intermediate"}, 41 | new Lecture {Id = 29, TeacherId = 14, Name = "CND", Level = "basic"}, 42 | new Lecture {Id = 30, TeacherId = 10, Name = "Legal Issues", Level = "advanced"}, 43 | new Lecture {Id = 31, TeacherId = 10, Name = "Fashion Blogging", Level = "intermediate"}, 44 | new Lecture {Id = 32, TeacherId = 8, Name = "LTACH", Level = "basic"}, 45 | new Lecture {Id = 33, TeacherId = 8, Name = "Education", Level = "intermediate"}, 46 | new Lecture {Id = 34, TeacherId = 1, Name = "Fashion Illustration", Level = "advanced"}, 47 | new Lecture {Id = 35, TeacherId = 24, Name = "Architectural Design", Level = "intermediate"}, 48 | new Lecture {Id = 36, TeacherId = 9, Name = "Workshop Facilitation", Level = "intermediate"}, 49 | new Lecture {Id = 37, TeacherId = 23, Name = "PPDS", Level = "intermediate"}, 50 | new Lecture {Id = 38, TeacherId = 29, Name = "Corporate FP&A", Level = "intermediate"}, 51 | new Lecture {Id = 39, TeacherId = 19, Name = "Bylaws", Level = "basic"}, 52 | new Lecture {Id = 40, TeacherId = 25, Name = "Win CVS", Level = "advanced"}, 53 | new Lecture {Id = 41, TeacherId = 11, Name = "Program Evaluation", Level = "advanced"}, 54 | new Lecture {Id = 42, TeacherId = 4, Name = "TGI", Level = "intermediate"}, 55 | new Lecture {Id = 43, TeacherId = 9, Name = "Corporate Tax", Level = "basic"}, 56 | new Lecture {Id = 44, TeacherId = 23, Name = "SEO", Level = "basic"}, 57 | new Lecture {Id = 45, TeacherId = 2, Name = "Strategic HR", Level = "advanced"}, 58 | new Lecture {Id = 46, TeacherId = 12, Name = "Lesson Planning", Level = "basic"}, 59 | new Lecture {Id = 47, TeacherId = 24, Name = "Insurance", Level = "advanced"}, 60 | new Lecture {Id = 48, TeacherId = 0, Name = "NVR", Level = "intermediate"}, 61 | new Lecture {Id = 49, TeacherId = 26, Name = "Volunteer Recruiting", Level = "basic"}, 62 | new Lecture {Id = 50, TeacherId = 5, Name = "Efficent", Level = "intermediate"}, 63 | new Lecture {Id = 51, TeacherId = 23, Name = "CPCU", Level = "advanced"}, 64 | new Lecture {Id = 52, TeacherId = 21, Name = "FFA", Level = "advanced"}, 65 | new Lecture {Id = 53, TeacherId = 6, Name = "SSADM", Level = "advanced"}, 66 | new Lecture {Id = 54, TeacherId = 9, Name = "Data Entry", Level = "basic"}, 67 | new Lecture {Id = 55, TeacherId = 28, Name = "PET-CT", Level = "intermediate"}, 68 | new Lecture {Id = 56, TeacherId = 27, Name = "GI", Level = "advanced"}, 69 | new Lecture {Id = 57, TeacherId = 28, Name = "Global Management", Level = "intermediate"}, 70 | new Lecture {Id = 58, TeacherId = 22, Name = "Validation", Level = "advanced"}, 71 | new Lecture {Id = 59, TeacherId = 7, Name = "Aviation", Level = "advanced"}, 72 | new Lecture {Id = 60, TeacherId = 7, Name = "Running", Level = "basic"}, 73 | new Lecture {Id = 61, TeacherId = 7, Name = "FDA", Level = "advanced"}, 74 | new Lecture {Id = 62, TeacherId = 8, Name = "RTL Coding", Level = "advanced"}, 75 | new Lecture {Id = 63, TeacherId = 24, Name = "DLX", Level = "advanced"}, 76 | new Lecture {Id = 64, TeacherId = 29, Name = "Military Training", Level = "intermediate"}, 77 | new Lecture {Id = 65, TeacherId = 8, Name = "NCFM Certified", Level = "advanced"}, 78 | new Lecture {Id = 66, TeacherId = 28, Name = "Music Education", Level = "intermediate"}, 79 | new Lecture {Id = 67, TeacherId = 15, Name = "Karaoke", Level = "basic"}, 80 | new Lecture {Id = 68, TeacherId = 0, Name = "Ffmpeg", Level = "basic"}, 81 | new Lecture {Id = 69, TeacherId = 0, Name = "Benefits Administration", Level = "advanced"}, 82 | new Lecture {Id = 70, TeacherId = 8, Name = "Electronics", Level = "basic"}, 83 | new Lecture {Id = 71, TeacherId = 26, Name = "Grants", Level = "advanced"}, 84 | new Lecture {Id = 72, TeacherId = 16, Name = "Inspection", Level = "intermediate"}, 85 | new Lecture {Id = 73, TeacherId = 6, Name = "Social Media Marketing", Level = "basic"}, 86 | new Lecture {Id = 74, TeacherId = 18, Name = "E-commerce", Level = "advanced"}, 87 | new Lecture {Id = 75, TeacherId = 26, Name = "TL1", Level = "intermediate"}, 88 | new Lecture {Id = 76, TeacherId = 5, Name = "PMC", Level = "basic"}, 89 | new Lecture {Id = 77, TeacherId = 11, Name = "FTL", Level = "advanced"}, 90 | new Lecture {Id = 78, TeacherId = 9, Name = "VLSI CAD", Level = "advanced"}, 91 | new Lecture {Id = 79, TeacherId = 14, Name = "TSYS", Level = "advanced"}, 92 | new Lecture {Id = 80, TeacherId = 3, Name = "Usability Testing", Level = "intermediate"}, 93 | new Lecture {Id = 81, TeacherId = 7, Name = "DVB-C", Level = "basic"}, 94 | new Lecture {Id = 82, TeacherId = 21, Name = "Sketching", Level = "basic"}, 95 | new Lecture {Id = 83, TeacherId = 3, Name = "ABR", Level = "advanced"}, 96 | new Lecture {Id = 84, TeacherId = 7, Name = "RDMA", Level = "intermediate"}, 97 | new Lecture {Id = 85, TeacherId = 17, Name = "Geological Mapping", Level = "basic"}, 98 | new Lecture {Id = 86, TeacherId = 23, Name = "Game Design", Level = "advanced"}, 99 | new Lecture {Id = 87, TeacherId = 18, Name = "GPS Units", Level = "basic"}, 100 | new Lecture {Id = 88, TeacherId = 19, Name = "Store Operations", Level = "intermediate"}, 101 | new Lecture {Id = 89, TeacherId = 16, Name = "RSLinx", Level = "advanced"}, 102 | new Lecture {Id = 90, TeacherId = 23, Name = "AU", Level = "advanced"}, 103 | new Lecture {Id = 91, TeacherId = 7, Name = "Purchase Management", Level = "intermediate"}, 104 | new Lecture {Id = 92, TeacherId = 8, Name = "NHPA", Level = "advanced"}, 105 | new Lecture {Id = 93, TeacherId = 8, Name = "Failure Analysis", Level = "intermediate"}, 106 | new Lecture {Id = 94, TeacherId = 19, Name = "Molecular Biology", Level = "advanced"}, 107 | new Lecture {Id = 95, TeacherId = 8, Name = "Biotechnology", Level = "advanced"}, 108 | new Lecture {Id = 96, TeacherId = 9, Name = "PVR", Level = "basic"}, 109 | new Lecture {Id = 97, TeacherId = 27, Name = "Swift", Level = "intermediate"}, 110 | new Lecture {Id = 98, TeacherId = 4, Name = "Yii", Level = "advanced"}, 111 | new Lecture {Id = 99, TeacherId = 15, Name = "Structural Dynamics", Level = "advanced"}, 112 | new Lecture {Id = 100, TeacherId = 23, Name = "LabVIEW", Level = "basic"}, 113 | new Lecture {Id = 101, TeacherId = 11, Name = "Oil & Gas", Level = "advanced"}, 114 | new Lecture {Id = 102, TeacherId = 2, Name = "Ice Cream", Level = "advanced"}, 115 | new Lecture {Id = 103, TeacherId = 26, Name = "Electrical Engineering", Level = "intermediate"}, 116 | new Lecture {Id = 104, TeacherId = 16, Name = "Rugs", Level = "basic"}, 117 | new Lecture {Id = 105, TeacherId = 26, Name = "Private Banking", Level = "intermediate"}, 118 | new Lecture {Id = 106, TeacherId = 14, Name = "CGI scripts", Level = "basic"}, 119 | new Lecture {Id = 107, TeacherId = 27, Name = "Legal Issues", Level = "advanced"}, 120 | new Lecture {Id = 108, TeacherId = 20, Name = "XACT", Level = "advanced"}, 121 | new Lecture {Id = 109, TeacherId = 25, Name = "eZ Publish", Level = "intermediate"}, 122 | new Lecture {Id = 110, TeacherId = 17, Name = "Geophysics", Level = "intermediate"}, 123 | new Lecture {Id = 111, TeacherId = 8, Name = "HCPCS", Level = "advanced"}, 124 | new Lecture {Id = 112, TeacherId = 28, Name = "Forecasting", Level = "advanced"}, 125 | new Lecture {Id = 113, TeacherId = 27, Name = "IRB", Level = "advanced"}, 126 | new Lecture {Id = 114, TeacherId = 11, Name = "People Management", Level = "basic"}, 127 | new Lecture {Id = 115, TeacherId = 5, Name = "Utility Regulation", Level = "advanced"}, 128 | new Lecture {Id = 116, TeacherId = 18, Name = "Nursing Management", Level = "advanced"}, 129 | new Lecture {Id = 117, TeacherId = 12, Name = "Global Business Development", Level = "advanced"}, 130 | new Lecture {Id = 118, TeacherId = 17, Name = "SQR", Level = "intermediate"}, 131 | new Lecture {Id = 119, TeacherId = 16, Name = "SMTP", Level = "basic"} 132 | }; 133 | 134 | private static readonly Teacher[] _teachers = 135 | { 136 | new Teacher {Id = 1, GivenName = "Janet", LastName = "Nelson", Age = 41, Email = "dnelson0@ft.com"}, 137 | new Teacher {Id = 2, GivenName = "Martha", LastName = "Brooks", Age = 42, Email = "mbrooks1@msu.edu"}, 138 | new Teacher 139 | { 140 | Id = 3, 141 | GivenName = "Janice", 142 | LastName = "Franklin", 143 | Age = 44, 144 | Email = "jfranklin2@cornell.edu" 145 | }, 146 | new Teacher {Id = 4, GivenName = "Martha", LastName = "Burke", Age = 26, Email = ""}, 147 | new Teacher 148 | { 149 | Id = 5, 150 | GivenName = "Virginia", 151 | LastName = "Williams", 152 | Age = 50, 153 | Email = "vwilliams4@wikispaces.com" 154 | }, 155 | new Teacher {Id = 6, GivenName = "Jonathan", LastName = "Graham", Age = 44, Email = ""}, 156 | new Teacher {Id = 7, GivenName = "Helen", LastName = "Snyder", Age = 41, Email = "hsnyder6@tuttocitta.it"}, 157 | new Teacher {Id = 8, GivenName = "George", LastName = "Jackson", Age = 21, Email = "gjackson7@apple.com"}, 158 | new Teacher {Id = 9, GivenName = "Carol", LastName = "Frazier", Age = 38, Email = "cfrazier8@taobao.com"}, 159 | new Teacher {Id = 10, GivenName = "Janet", LastName = "Little", Age = 38, Email = ""}, 160 | new Teacher {Id = 11, GivenName = "Frank", LastName = "Hunt", Age = 24, Email = ""}, 161 | new Teacher {Id = 12, GivenName = "Carl", LastName = "Foster", Age = 36, Email = "cfosterb@harvard.edu"}, 162 | new Teacher {Id = 13, GivenName = "Margaret", LastName = "Burton", Age = 77, Email = ""}, 163 | new Teacher {Id = 14, GivenName = "Carol", LastName = "James", Age = 30, Email = "cjamesd@com.com"}, 164 | new Teacher {Id = 15, GivenName = "Shawn", LastName = "Hanson", Age = 40, Email = "shansone@linkedin.com"}, 165 | new Teacher {Id = 16, GivenName = "Eugene", LastName = "Stevens", Age = 18, Email = "estevensf@g.co"}, 166 | new Teacher {Id = 17, GivenName = "Maria", LastName = "Myers", Age = 23, Email = "mmyersg@prnewswire.com"}, 167 | new Teacher {Id = 18, GivenName = "Terry", LastName = "Williams", Age = 26, Email = "tlawrenceh@wiley.com"}, 168 | new Teacher {Id = 19, GivenName = "Phyllis", LastName = "Burns", Age = 33, Email = "pburnsi@umn.edu"}, 169 | new Teacher 170 | { 171 | Id = 20, 172 | GivenName = "Emily", 173 | LastName = "Robertson", 174 | Age = 35, 175 | Email = "erobertsonj@oracle.com" 176 | }, 177 | new Teacher 178 | { 179 | Id = 21, 180 | GivenName = "Janet", 181 | LastName = "Gordon", 182 | Age = 45, 183 | Email = "cgordonk@barnesandnoble.com" 184 | }, 185 | new Teacher 186 | { 187 | Id = 22, 188 | GivenName = "Linda", 189 | LastName = "Ramirez", 190 | Age = 24, 191 | Email = "lramirezl@bravesites.com" 192 | }, 193 | new Teacher {Id = 23, GivenName = "Lillian", LastName = "Lynch", Age = 39, Email = "llynchm@thetimes.co.uk"}, 194 | new Teacher {Id = 24, GivenName = "Christopher", LastName = "Jackson", Age = 54, Email = ""}, 195 | new Teacher {Id = 25, GivenName = "Laura", LastName = "Williams", Age = 67, Email = ""}, 196 | new Teacher {Id = 26, GivenName = "William", LastName = "Allen", Age = 16, Email = "wallenp@army.mil"}, 197 | new Teacher {Id = 27, GivenName = "Henry", LastName = "Arnold", Age = 33, Email = "harnoldq@exblog.jp"}, 198 | new Teacher {Id = 28, GivenName = "Nancy", LastName = "Peters", Age = 39, Email = "npetersr@engadget.com"}, 199 | new Teacher {Id = 29, GivenName = "Janet", LastName = "Torres", Age = 50, Email = "storress@npr.org"}, 200 | new Teacher 201 | { 202 | Id = 30, 203 | GivenName = "Ruth", 204 | LastName = "Williams", 205 | Age = 26, 206 | Email = "rbishopt@ezinearticles.com" 207 | } 208 | }; 209 | 210 | public Lecture[] Lectures 211 | { 212 | get { return _lectures; } 213 | } 214 | 215 | public Teacher[] Teachers 216 | { 217 | get { return _teachers; } 218 | } 219 | } 220 | } --------------------------------------------------------------------------------