├── .gitattributes ├── .gitignore ├── CSharp ├── Exercises.md └── Solutions │ ├── ExerciseCoffee │ ├── ExerciseCoffee.sln │ └── Exercise_02 │ │ ├── App.config │ │ ├── ExerciseCoffee.csproj │ │ ├── Program.cs │ │ └── Properties │ │ └── AssemblyInfo.cs │ ├── ExerciseComplex │ ├── .gitattributes │ ├── .gitignore │ ├── ExerciseComplex.sln │ └── Exercise_01 │ │ ├── App.config │ │ ├── ExerciseComplex.csproj │ │ ├── Program.cs │ │ └── Properties │ │ └── AssemblyInfo.cs │ ├── ExerciseFraction │ ├── ExerciseFraction.sln │ └── ExerciseFraction │ │ ├── App.config │ │ ├── ExerciseFraction.csproj │ │ ├── Program.cs │ │ └── Properties │ │ └── AssemblyInfo.cs │ ├── ExerciseLINQ │ ├── ExerciseLINQ.sln │ └── ExerciseLINQ │ │ ├── App.config │ │ ├── ExerciseLINQ.csproj │ │ ├── Program.cs │ │ └── Properties │ │ └── AssemblyInfo.cs │ ├── ExerciseLibrary │ ├── ExerciseLibrary.sln │ └── ExerciseLibrary │ │ ├── App.config │ │ ├── Author.cs │ │ ├── Book.cs │ │ ├── ExerciseLibrary.csproj │ │ ├── Librarian.cs │ │ ├── Library.cs │ │ ├── Program.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ └── User.cs │ ├── ExerciseMobile │ ├── Mobile.sln │ └── Mobile │ │ ├── App.config │ │ ├── Battery.cs │ │ ├── Call.cs │ │ ├── Device.cs │ │ ├── Mobile.csproj │ │ ├── Program.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── Screen.cs │ │ └── Usage.cs │ ├── ExerciseMobile_SolutionByNikos │ ├── Mobile.sln │ └── Mobile │ │ ├── App.config │ │ ├── DeviceInfo │ │ ├── Battery.cs │ │ ├── KnownDevices.cs │ │ ├── Manufacturers.cs │ │ ├── MobileDevice.cs │ │ └── Screen.cs │ │ ├── DeviceUsageInfo │ │ ├── Call.cs │ │ └── DeviceUsage.cs │ │ ├── Mobile.csproj │ │ ├── Program.cs │ │ └── Properties │ │ └── AssemblyInfo.cs │ ├── ExerciseSubsequence │ ├── ExerciseSubsequence.sln │ └── ExerciseSubsequence │ │ ├── App.config │ │ ├── ExerciseSubsequence.csproj │ │ ├── Program.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ └── Utilities.cs │ ├── ExerciseUniversity │ ├── Exercise_University.sln │ └── Exercise_University │ │ ├── App.config │ │ ├── Course.cs │ │ ├── Exercise_University.csproj │ │ ├── Program.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── Student.cs │ │ └── University.cs │ ├── ExerciseUtilities │ ├── ExerciseUtilities.sln │ └── Exercise_03 │ │ ├── App.config │ │ ├── Complex.cs │ │ ├── ExerciseUtilities.csproj │ │ ├── Fraction.cs │ │ ├── Program.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ └── Utilities.cs │ └── ExerciseZoo │ ├── ExerciseZoo.sln │ └── Exercise_05 │ ├── App.config │ ├── ExerciseZoo.csproj │ ├── Program.cs │ └── Properties │ └── AssemblyInfo.cs ├── DesignPatterns ├── Exercises.md └── Solutions │ ├── Exercise1 │ ├── Exercise1.sln │ └── Exercise1 │ │ ├── App.config │ │ ├── Course.cs │ │ ├── Exercise1.csproj │ │ ├── Instructor.cs │ │ ├── Organizer.cs │ │ ├── Program.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── StakeHolder.cs │ │ ├── Student.cs │ │ └── packages.config │ └── Exercise2 │ ├── Exercise2.sln │ └── Exercise2 │ ├── App.config │ ├── Exercise2.csproj │ ├── FileUtilitiy.cs │ ├── MetricSet.cs │ ├── Program.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── RegexAnalyzer.cs │ ├── SourceCodeAnalyzer.cs │ ├── SourceCodeAnalyzerFacade.cs │ ├── SourceCodeAnalyzerFactory.cs │ └── StringAnalyzer.cs ├── HTML-CSS-Razor ├── Exercises.md └── Solutions │ ├── PersonalWebsiteCSS │ ├── PersonalWebsiteCSS.sln │ └── web │ │ ├── Blog.html │ │ ├── Contact.html │ │ ├── Home.html │ │ ├── Web.Debug.config │ │ ├── Web.config │ │ ├── css │ │ └── style.css │ │ ├── img │ │ ├── bali-indonesia-tours-1.jpg │ │ ├── bali-indonesia-tours-2.jpg │ │ ├── bali-indonesia-tours-3.jpg │ │ ├── link-source-ordering-1.jpg │ │ └── personal-image.jpg │ │ └── packages.config │ ├── PersonalWebsiteHTML │ ├── PersonalWebsiteHTML.sln │ └── web │ │ ├── Blog.html │ │ ├── Contact.html │ │ ├── Home.html │ │ ├── Web.Debug.config │ │ ├── Web.config │ │ ├── img │ │ ├── bali-indonesia-tours-1.jpg │ │ ├── bali-indonesia-tours-2.jpg │ │ ├── bali-indonesia-tours-3.jpg │ │ ├── link-source-ordering-1.jpg │ │ └── personal-image.jpg │ │ └── packages.config │ └── PersonalWebsiteRazor │ ├── App_Code │ ├── Blog.cs │ ├── Categories.cs │ └── Posts.cs │ ├── Blog.cshtml │ ├── Blog.html │ ├── Contact.html │ ├── Empty.cshtml │ ├── Home.cshtml │ ├── Home.html │ ├── SQL_INIT.sql │ ├── Shared │ ├── _Footer.cshtml │ ├── _Header.cshtml │ ├── _Layout.cshtml │ ├── css │ │ └── style.css │ └── img │ │ ├── bali-indonesia-tours-1.jpg │ │ ├── bali-indonesia-tours-2.jpg │ │ ├── bali-indonesia-tours-3.jpg │ │ ├── link-source-ordering-1.jpg │ │ └── personal-image.jpg │ ├── Web.Debug.config │ ├── Web.config │ └── packages.config ├── HTML5Boilerplate ├── css │ ├── bootstrap-theme.css │ ├── bootstrap-theme.css.map │ ├── bootstrap-theme.min.css │ ├── bootstrap.css │ ├── bootstrap.css.map │ ├── bootstrap.min.css │ └── main.css ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff ├── index.html └── js │ ├── main.js │ └── vendor │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-1.11.2.min.js │ ├── modernizr-2.8.3.min.js │ └── npm.js ├── JavaScript ├── ClickEventDemo │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── main.css │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ ├── index.html │ └── js │ │ ├── main.js │ │ └── vendor │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── jquery-1.11.2.min.js │ │ ├── modernizr-2.8.3.min.js │ │ └── npm.js ├── ES6Demo │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── main.css │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ ├── index.html │ └── js │ │ ├── main.js │ │ ├── math.js │ │ └── vendor │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── jquery-1.11.2.min.js │ │ ├── modernizr-2.8.3.min.js │ │ └── npm.js ├── Exercises_01 │ ├── css │ │ └── main.css │ ├── index.html │ └── js │ │ └── main.js └── ProductCartDemo │ ├── css │ ├── bootstrap-theme.css │ ├── bootstrap-theme.css.map │ ├── bootstrap-theme.min.css │ ├── bootstrap.css │ ├── bootstrap.css.map │ ├── bootstrap.min.css │ └── main.css │ ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff │ ├── index.html │ └── js │ ├── main.js │ └── vendor │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-1.11.2.min.js │ ├── modernizr-2.8.3.min.js │ └── npm.js ├── MVC ├── Exercises.md └── Solutions │ ├── Basketball │ ├── Basketball.sln │ └── Basketball │ │ ├── App_Start │ │ ├── BundleConfig.cs │ │ ├── FilterConfig.cs │ │ └── RouteConfig.cs │ │ ├── ApplicationInsights.config │ │ ├── Basketball.csproj │ │ ├── Content │ │ ├── Site.css │ │ ├── bootstrap.css │ │ └── bootstrap.min.css │ │ ├── Controllers │ │ └── HomeController.cs │ │ ├── Global.asax │ │ ├── Global.asax.cs │ │ ├── Migrations │ │ ├── 201705251421390_init.Designer.cs │ │ ├── 201705251421390_init.cs │ │ ├── 201705251421390_init.resx │ │ └── Configuration.cs │ │ ├── Models │ │ ├── BaseViewModel.cs │ │ ├── IndexViewModel.cs │ │ ├── JoinRequest.cs │ │ ├── MyContext.cs │ │ ├── Team.cs │ │ ├── User.cs │ │ └── ViewRequestsViewModel.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── Scripts │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── jquery-1.10.2.intellisense.js │ │ ├── jquery-1.10.2.js │ │ ├── jquery-1.10.2.min.js │ │ ├── jquery-1.10.2.min.map │ │ ├── jquery.validate-vsdoc.js │ │ ├── jquery.validate.js │ │ ├── jquery.validate.min.js │ │ ├── jquery.validate.unobtrusive.js │ │ ├── jquery.validate.unobtrusive.min.js │ │ ├── modernizr-2.6.2.js │ │ ├── respond.js │ │ └── respond.min.js │ │ ├── Views │ │ ├── Home │ │ │ ├── CreateTeam.cshtml │ │ │ ├── Index.cshtml │ │ │ ├── Login.cshtml │ │ │ ├── Signup.cshtml │ │ │ └── ViewRequests.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ └── _Layout.cshtml │ │ ├── Web.config │ │ └── _ViewStart.cshtml │ │ ├── Web.Debug.config │ │ ├── Web.Release.config │ │ ├── Web.config │ │ ├── favicon.ico │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ │ └── packages.config │ ├── MVC_1 │ ├── MVC_1.sln │ └── MVC_1 │ │ ├── App_Start │ │ ├── BundleConfig.cs │ │ ├── FilterConfig.cs │ │ └── RouteConfig.cs │ │ ├── ApplicationInsights.config │ │ ├── Content │ │ ├── Site.css │ │ ├── bootstrap.css │ │ └── bootstrap.min.css │ │ ├── Controllers │ │ ├── HomeController.cs │ │ └── ProductsController.cs │ │ ├── Global.asax │ │ ├── Global.asax.cs │ │ ├── MVC_1.csproj │ │ ├── Migrations │ │ ├── 201705221343105_Init.Designer.cs │ │ ├── 201705221343105_Init.cs │ │ ├── 201705221343105_Init.resx │ │ ├── 201705241329590_Added Category.Designer.cs │ │ ├── 201705241329590_Added Category.cs │ │ ├── 201705241329590_Added Category.resx │ │ └── Configuration.cs │ │ ├── Models │ │ ├── Category.cs │ │ ├── MyModel.cs │ │ └── Product.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── Scripts │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── jquery-1.10.2.intellisense.js │ │ ├── jquery-1.10.2.js │ │ ├── jquery-1.10.2.min.js │ │ ├── jquery-1.10.2.min.map │ │ ├── jquery.validate-vsdoc.js │ │ ├── jquery.validate.js │ │ ├── jquery.validate.min.js │ │ ├── jquery.validate.unobtrusive.js │ │ ├── jquery.validate.unobtrusive.min.js │ │ ├── modernizr-2.6.2.js │ │ ├── respond.js │ │ └── respond.min.js │ │ ├── Views │ │ ├── Home │ │ │ ├── About.cshtml │ │ │ ├── Contact.cshtml │ │ │ └── Index.cshtml │ │ ├── Products │ │ │ ├── Create.cshtml │ │ │ ├── Detail.cshtml │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ └── _Layout.cshtml │ │ ├── Web.config │ │ └── _ViewStart.cshtml │ │ ├── Web.Debug.config │ │ ├── Web.Release.config │ │ ├── Web.config │ │ ├── favicon.ico │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ │ └── packages.config │ └── TodoApp │ ├── TodoApp.sln │ └── TodoApp │ ├── App_Start │ ├── BundleConfig.cs │ ├── FilterConfig.cs │ └── RouteConfig.cs │ ├── ApplicationInsights.config │ ├── Content │ └── Site.css │ ├── Controllers │ └── HomeController.cs │ ├── Global.asax │ ├── Global.asax.cs │ ├── Migrations │ ├── 201706191041416_init.Designer.cs │ ├── 201706191041416_init.cs │ ├── 201706191041416_init.resx │ ├── 201706211226253_removed-description.Designer.cs │ ├── 201706211226253_removed-description.cs │ ├── 201706211226253_removed-description.resx │ └── Configuration.cs │ ├── Models │ ├── MyContext.cs │ ├── Task.cs │ └── User.cs │ ├── Properties │ ├── AssemblyInfo.cs │ └── PublishProfiles │ │ └── TodoApp20170621041438 - Web Deploy.pubxml │ ├── Scripts │ └── modernizr-2.8.3.js │ ├── TodoApp.csproj │ ├── ViewModels │ ├── LoginViewModel.cs │ └── RegisterViewModel.cs │ ├── Views │ ├── Home │ │ ├── Index.cshtml │ │ ├── Login.cshtml │ │ └── Register.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _Anonymous.cshtml │ │ └── _Layout.cshtml │ ├── Web.config │ └── _ViewStart.cshtml │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ ├── favicon.ico │ └── packages.config ├── Project Skroutz ├── Skroutz.md └── Skroutz │ ├── Skroutz.sln │ └── Skroutz │ ├── App_Start │ └── RouteConfig.cs │ ├── Content │ ├── Site.css │ ├── bootstrap.css │ └── bootstrap.min.css │ ├── Controllers │ ├── AttributeKeysController.cs │ ├── AttributeValuesController.cs │ ├── CategoriesController.cs │ ├── HomeController.cs │ ├── InventoriesController.cs │ ├── ProductsController.cs │ └── StoresController.cs │ ├── DAL │ └── SkroutzContext.cs │ ├── Global.asax │ ├── Global.asax.cs │ ├── Migrations │ ├── 201611221633191_init.Designer.cs │ ├── 201611221633191_init.cs │ ├── 201611221633191_init.resx │ ├── 201611251245086_update.Designer.cs │ ├── 201611251245086_update.cs │ ├── 201611251245086_update.resx │ ├── 201611281200226_update1.Designer.cs │ ├── 201611281200226_update1.cs │ ├── 201611281200226_update1.resx │ ├── 201611281235048_update2.Designer.cs │ ├── 201611281235048_update2.cs │ ├── 201611281235048_update2.resx │ ├── 201611281542536_display.Designer.cs │ ├── 201611281542536_display.cs │ ├── 201611281542536_display.resx │ └── Configuration.cs │ ├── Models │ ├── AttributeKey.cs │ ├── AttributeValue.cs │ ├── Category.cs │ ├── Inventory.cs │ ├── Product.cs │ └── Store.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── Scripts │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-1.10.2.intellisense.js │ ├── jquery-1.10.2.js │ ├── jquery-1.10.2.min.js │ ├── jquery-1.10.2.min.map │ ├── jquery.validate-vsdoc.js │ ├── jquery.validate.js │ ├── jquery.validate.min.js │ ├── jquery.validate.unobtrusive.js │ ├── jquery.validate.unobtrusive.min.js │ └── modernizr-2.6.2.js │ ├── Skroutz.csproj │ ├── Views │ ├── AttributeKeys │ │ ├── Create.cshtml │ │ ├── Delete.cshtml │ │ ├── Details.cshtml │ │ ├── Edit.cshtml │ │ └── Index.cshtml │ ├── AttributeValues │ │ ├── Create.cshtml │ │ ├── Delete.cshtml │ │ ├── Details.cshtml │ │ ├── Edit.cshtml │ │ └── Index.cshtml │ ├── Categories │ │ ├── Create.cshtml │ │ ├── Delete.cshtml │ │ ├── Details.cshtml │ │ ├── Edit.cshtml │ │ └── Index.cshtml │ ├── Home │ │ └── Index.cshtml │ ├── Inventories │ │ ├── Create.cshtml │ │ ├── Delete.cshtml │ │ ├── Details.cshtml │ │ ├── Edit.cshtml │ │ └── Index.cshtml │ ├── Products │ │ ├── Create.cshtml │ │ ├── Delete.cshtml │ │ ├── Details.cshtml │ │ ├── Edit.cshtml │ │ └── Index.cshtml │ ├── Shared │ │ └── _Layout.cshtml │ ├── Stores │ │ ├── Create.cshtml │ │ ├── Delete.cshtml │ │ ├── Details.cshtml │ │ ├── Edit.cshtml │ │ └── Index.cshtml │ ├── _ViewStart.cshtml │ └── web.config │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff │ └── packages.config ├── README.md ├── SQL-Entity ├── Exercises.md └── Solutions │ ├── ExerciseAdvancedQueries.sql │ ├── ExerciseHaving.sql │ ├── ExerciseInsertUpdateDelete.sql │ ├── ExerciseJoins.sql │ ├── ExerciseLibrary.sql │ └── ExerciseSimpleQueries.sql ├── __Demos ├── CSharp Demos │ ├── Demos │ │ ├── Demo1 │ │ │ ├── App.config │ │ │ ├── Demo1.csproj │ │ │ ├── Program.cs │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ ├── Demo10 │ │ │ ├── App.config │ │ │ ├── Demo10.csproj │ │ │ ├── Dice.cs │ │ │ ├── MemoryLeak.cs │ │ │ ├── Program.cs │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ ├── Demo11 │ │ │ ├── App.config │ │ │ ├── Class.cs │ │ │ ├── Demo11.csproj │ │ │ ├── Program.cs │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ ├── Demo2 │ │ │ ├── App.config │ │ │ ├── Demo2.csproj │ │ │ ├── Program.cs │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ ├── Demo3 │ │ │ ├── App.config │ │ │ ├── Demo3.csproj │ │ │ ├── Dice.cs │ │ │ ├── Program.cs │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ ├── Demo4 │ │ │ ├── App.config │ │ │ ├── Demo4.csproj │ │ │ ├── Dice.cs │ │ │ ├── Program.cs │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ ├── Demo5 │ │ │ ├── App.config │ │ │ ├── Demo5.csproj │ │ │ ├── Dice.cs │ │ │ ├── Program.cs │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ ├── Demo6 │ │ │ ├── App.config │ │ │ ├── Demo6.csproj │ │ │ ├── Program.cs │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ ├── Demo7 │ │ │ ├── App.config │ │ │ ├── Demo7.csproj │ │ │ ├── Program.cs │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ ├── Demo8 │ │ │ ├── App.config │ │ │ ├── Demo8.csproj │ │ │ ├── Dice.cs │ │ │ ├── Program.cs │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ ├── Demo9 │ │ │ ├── App.config │ │ │ ├── Commander.cs │ │ │ ├── Demo9.csproj │ │ │ ├── Dice.cs │ │ │ ├── IDice.cs │ │ │ ├── Program.cs │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ ├── Demos.sln │ │ ├── Demos │ │ │ ├── App.config │ │ │ ├── Demos.csproj │ │ │ ├── Program.cs │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ ├── SolDemo3_1 │ │ │ ├── App.config │ │ │ ├── Dice.cs │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ └── SolDemo3_1.csproj │ │ ├── SolDemo3_2 │ │ │ ├── App.config │ │ │ ├── Dice.cs │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ └── SolDemo3_2.csproj │ │ ├── SolDemo3_3 │ │ │ ├── App.config │ │ │ ├── Dice.cs │ │ │ ├── DoubleDice.cs │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ └── SolDemo3_3.csproj │ │ └── SolDemo3_4 │ │ │ ├── App.config │ │ │ ├── FortuneTeller.cs │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ │ └── SolDemo3_4.csproj │ └── Exercises.txt ├── DemoADONET │ ├── adonet.sln │ └── adonet │ │ ├── App.config │ │ ├── Program.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ └── adonet.csproj └── RazorDemo │ ├── App_Code │ ├── Model.cs │ └── Model │ │ ├── Categories.cs │ │ ├── CustomerDemographics.cs │ │ ├── Customers.cs │ │ ├── Employees.cs │ │ ├── Order_Details.cs │ │ ├── Orders.cs │ │ ├── Products.cs │ │ ├── Region.cs │ │ ├── Shippers.cs │ │ ├── Suppliers.cs │ │ └── Territories.cs │ ├── Content1.cshtml │ ├── Content2.cshtml │ ├── Content3.cshtml │ ├── Employees.cshtml │ ├── Index.cshtml │ ├── IsPostForm.cshtml │ ├── Shared │ ├── _Database.cshtml │ ├── _Footer.cshtml │ ├── _Header.cshtml │ ├── _Header1.cshtml │ ├── _Layout1.cshtml │ ├── _Layout2.cshtml │ ├── _Layout3.cshtml │ └── _List.cshtml │ ├── Styles │ └── Site.css │ ├── Web.Debug.config │ ├── Web.config │ └── packages.config └── northwind.sql /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseCoffee/ExerciseCoffee.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26403.7 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExerciseCoffee", "Exercise_02\ExerciseCoffee.csproj", "{F2DAC855-7236-4386-B522-0D99E9611776}" 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 | {F2DAC855-7236-4386-B522-0D99E9611776}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {F2DAC855-7236-4386-B522-0D99E9611776}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {F2DAC855-7236-4386-B522-0D99E9611776}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {F2DAC855-7236-4386-B522-0D99E9611776}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseCoffee/Exercise_02/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseComplex/ExerciseComplex.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26403.7 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExerciseComplex", "Exercise_01\ExerciseComplex.csproj", "{18C96DAE-8B44-4AF1-BE0D-770C9F7CAB67}" 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 | {18C96DAE-8B44-4AF1-BE0D-770C9F7CAB67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {18C96DAE-8B44-4AF1-BE0D-770C9F7CAB67}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {18C96DAE-8B44-4AF1-BE0D-770C9F7CAB67}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {18C96DAE-8B44-4AF1-BE0D-770C9F7CAB67}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseComplex/Exercise_01/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseFraction/ExerciseFraction.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExerciseFraction", "ExerciseFraction\ExerciseFraction.csproj", "{4385E4B2-CB10-4230-BA31-CFBE1B402F50}" 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 | {4385E4B2-CB10-4230-BA31-CFBE1B402F50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {4385E4B2-CB10-4230-BA31-CFBE1B402F50}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {4385E4B2-CB10-4230-BA31-CFBE1B402F50}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {4385E4B2-CB10-4230-BA31-CFBE1B402F50}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseFraction/ExerciseFraction/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseLINQ/ExerciseLINQ.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExerciseLINQ", "ExerciseLINQ\ExerciseLINQ.csproj", "{0F611A1B-F3D8-4802-9110-820E26659670}" 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 | {0F611A1B-F3D8-4802-9110-820E26659670}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {0F611A1B-F3D8-4802-9110-820E26659670}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {0F611A1B-F3D8-4802-9110-820E26659670}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {0F611A1B-F3D8-4802-9110-820E26659670}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseLINQ/ExerciseLINQ/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseLibrary/ExerciseLibrary.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExerciseLibrary", "ExerciseLibrary\ExerciseLibrary.csproj", "{ECF013F2-C849-42BF-955D-6AC8564CBBFF}" 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 | {ECF013F2-C849-42BF-955D-6AC8564CBBFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {ECF013F2-C849-42BF-955D-6AC8564CBBFF}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {ECF013F2-C849-42BF-955D-6AC8564CBBFF}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {ECF013F2-C849-42BF-955D-6AC8564CBBFF}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseLibrary/ExerciseLibrary/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseLibrary/ExerciseLibrary/Author.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 ExerciseLibrary 8 | { 9 | class Author 10 | { 11 | public string Name { get; private set; } 12 | 13 | public Author(string name) 14 | { 15 | this.Name = name; 16 | } 17 | 18 | public override string ToString() 19 | { 20 | return Name; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseLibrary/ExerciseLibrary/Book.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 ExerciseLibrary 8 | { 9 | class Book 10 | { 11 | public static int _ID = 0; 12 | 13 | public string Title { get; private set; } 14 | public Author Author { get; private set; } 15 | public int ID { get; private set; } 16 | 17 | public Book(string title, Author author) 18 | { 19 | this.Title = title; 20 | this.Author = author; 21 | this.ID = ++_ID; 22 | } 23 | 24 | public override string ToString() 25 | { 26 | return $"{this.Title} by {this.Author}"; 27 | } 28 | 29 | public override bool Equals(object obj) 30 | { 31 | if (!(obj is Book)) { 32 | return false; 33 | } 34 | return Equals(obj as Book); 35 | } 36 | 37 | public bool Equals(Book other) 38 | { 39 | if (this.ID == other.ID) { 40 | return true; 41 | } 42 | else { 43 | return false; 44 | } 45 | } 46 | 47 | public static bool operator ==(Book book1, Book book2) 48 | { 49 | return book1.Equals(book2); 50 | } 51 | 52 | public static bool operator !=(Book book1, Book book2) 53 | { 54 | return !book1.Equals(book2); 55 | } 56 | 57 | public override int GetHashCode() 58 | { 59 | return ID.GetHashCode(); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseLibrary/ExerciseLibrary/Librarian.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 ExerciseLibrary 8 | { 9 | class Librarian 10 | { 11 | public string Name { get; set; } 12 | public Library ManagedLibrary { get; private set; } 13 | 14 | public Librarian (string name, Library library) 15 | { 16 | Name = name; 17 | ManagedLibrary = library; 18 | } 19 | 20 | public void AddUser(User user) 21 | { 22 | ManagedLibrary.AddUser(user); 23 | } 24 | 25 | public bool RentBook(User user, Book book, out string reply) 26 | { 27 | if (ManagedLibrary.IsAuthorizedUser(user)) { 28 | if(ManagedLibrary.RentBook(book)) { 29 | reply = "Book rented successfully! Take care of your book."; 30 | return true; 31 | } 32 | reply = "No copy available!"; 33 | return false; 34 | } 35 | reply = "You are not authorized to rent books from this library!"; 36 | return false ; 37 | } 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseLibrary/ExerciseLibrary/User.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 ExerciseLibrary 8 | { 9 | class User 10 | { 11 | public static int _ID = 0; 12 | 13 | public string Name { get; private set; } 14 | public int ID { get; private set; } 15 | 16 | public User(string name) 17 | { 18 | this.Name = name; 19 | this.ID = ++_ID; 20 | } 21 | 22 | public override string ToString() 23 | { 24 | return $"{this.Name}"; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseMobile/Mobile.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mobile", "GSM\Mobile.csproj", "{A1BB9591-03CB-4F1D-998E-BDB176EF897C}" 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 | {A1BB9591-03CB-4F1D-998E-BDB176EF897C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {A1BB9591-03CB-4F1D-998E-BDB176EF897C}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {A1BB9591-03CB-4F1D-998E-BDB176EF897C}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {A1BB9591-03CB-4F1D-998E-BDB176EF897C}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseMobile/Mobile/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseMobile/Mobile/Battery.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 Mobile 8 | { 9 | enum BatteryType 10 | { 11 | LithiumIon, 12 | LithiumPolymer, 13 | NickelCadmium, 14 | NickelMetalHybride, 15 | NewLithiumTechnology 16 | } 17 | 18 | class Battery 19 | { 20 | //private fields 21 | private BatteryType type; 22 | private int capacity; 23 | 24 | //public Properties 25 | public BatteryType Type 26 | { 27 | get { return type; } 28 | private set { type = value; } 29 | } 30 | public int Capacity 31 | { 32 | get { return capacity; } 33 | private set 34 | { 35 | if (value > 0 && value <= Int32.MaxValue) 36 | { 37 | capacity = value; 38 | } 39 | } 40 | } 41 | 42 | //Constructor 43 | public Battery(BatteryType type, int capacity) 44 | { 45 | Type = type; 46 | Capacity = capacity; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseMobile/Mobile/Call.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 Mobile 8 | { 9 | enum CallType 10 | { 11 | Incoming, 12 | Outgoing 13 | } 14 | 15 | class Call 16 | { 17 | private DateTime startTime; 18 | private DateTime endTime; 19 | private CallType type; 20 | 21 | public DateTime StartTime { 22 | get 23 | { 24 | return startTime; 25 | } 26 | } 27 | 28 | public DateTime EndTime 29 | { 30 | get 31 | { 32 | return endTime; 33 | } 34 | } 35 | 36 | public double Duration 37 | { 38 | get 39 | { 40 | TimeSpan span = endTime - startTime; 41 | return span.Seconds; 42 | } 43 | } 44 | 45 | public CallType Type 46 | { 47 | get 48 | { 49 | return type; 50 | } 51 | } 52 | 53 | public Call(CallType type) 54 | { 55 | this.startTime = DateTime.Now; 56 | this.type = type; 57 | } 58 | 59 | public void End() 60 | { 61 | this.endTime = DateTime.UtcNow; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseMobile/Mobile/Program.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 Mobile 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | Screen screen1 = new Screen(ScreenResolution._1920x1080(), 7); 14 | Battery battery1 = new Battery(BatteryType.LithiumIon, 8000); 15 | Device device1 = new Device( 16 | "Asus", 17 | "Zenfone 2", 18 | 250, 19 | new Screen(ScreenResolution._1920x1080(), 7), 20 | battery1 21 | ); 22 | 23 | Device device2 = Device.GetKnownModel(KnownModels.iPhone7); 24 | Console.WriteLine(device2.BasePrice); 25 | //device2.BasePrice = 100; 26 | 27 | device1.Usage.NewCall(CallType.Incoming); 28 | Console.WriteLine("Call Started..."); 29 | System.Threading.Thread.Sleep(5000); 30 | device1.Usage.EndCall(); 31 | Console.WriteLine("Call Ended"); 32 | Console.WriteLine(); 33 | 34 | device1.Usage.NewCall(CallType.Outgoing); 35 | Console.WriteLine("Call Started..."); 36 | System.Threading.Thread.Sleep(10000); 37 | device1.Usage.EndCall(); 38 | Console.WriteLine("Call Ended"); 39 | 40 | Console.WriteLine(device1.Usage); 41 | Console.ReadKey(); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseMobile/Mobile/Screen.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 Mobile 8 | { 9 | //Declare struct Resolution 10 | public struct ScreenResolution 11 | { 12 | public int Width { get; private set; } 13 | public int Height { get; private set; } 14 | 15 | //Constructor 16 | public ScreenResolution(int width, int height) 17 | { 18 | Width = width; 19 | Height = height; 20 | } 21 | 22 | //static methods for creating common resolutions 23 | public static ScreenResolution _1920x1080() 24 | { 25 | return new ScreenResolution(1920, 1080); 26 | } 27 | public static ScreenResolution _1280x720() 28 | { 29 | return new ScreenResolution(1280, 720); 30 | } 31 | public static ScreenResolution _1900x1200() 32 | { 33 | return new ScreenResolution(1900, 1200); 34 | } 35 | } 36 | 37 | class Screen 38 | { 39 | public ScreenResolution Resolution { get; private set; } 40 | public double DiagonalInches { get; private set; } 41 | 42 | //Constructor 43 | public Screen(ScreenResolution resolution, double diagonal) { 44 | Resolution = resolution; 45 | DiagonalInches = diagonal; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseMobile/Mobile/Usage.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 Mobile 8 | { 9 | class Usage 10 | { 11 | private double batteryPercentage; 12 | private List history; 13 | 14 | public List History 15 | { 16 | get 17 | { 18 | return history; 19 | } 20 | } 21 | 22 | public Usage( ) 23 | { 24 | batteryPercentage = 100; 25 | history = new List(); 26 | } 27 | 28 | public void NewCall(CallType type) 29 | { 30 | history.Add(new Call(type)); 31 | } 32 | 33 | public void EndCall() 34 | { 35 | history[history.Count - 1].End(); 36 | } 37 | 38 | public override string ToString() 39 | { 40 | string result = ""; 41 | result += "Battery: " + batteryPercentage + "%\n"; 42 | result += "Call History:\n"; 43 | foreach (Call call in history) { 44 | result += String.Format("Start: {0} | Duration {1} seconds\n", call.StartTime.ToString("MM/dd/yyyy HH:mm:ss"), call.Duration); 45 | } 46 | return result; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseMobile_SolutionByNikos/Mobile.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mobile", "Mobile\Mobile.csproj", "{1E0173B7-E06C-4AAD-8F5B-5893EB16FC37}" 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 | {1E0173B7-E06C-4AAD-8F5B-5893EB16FC37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {1E0173B7-E06C-4AAD-8F5B-5893EB16FC37}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {1E0173B7-E06C-4AAD-8F5B-5893EB16FC37}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {1E0173B7-E06C-4AAD-8F5B-5893EB16FC37}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseMobile_SolutionByNikos/Mobile/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseMobile_SolutionByNikos/Mobile/DeviceInfo/Battery.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mobile.DeviceInfo 4 | { 5 | public enum BatteryTypes 6 | { 7 | LithiumIon, 8 | LithiumPolymer, 9 | NickelCadmium, 10 | NickelMetalHydride 11 | } 12 | 13 | class Battery : IComparable 14 | { 15 | public BatteryTypes BatteryType { get; private set; } 16 | public int BatteryCapacity { get; private set; } 17 | public string ManufacturerName { get; private set; } 18 | 19 | public Battery(BatteryTypes batteryType, int batteryCapacity, string manufacturerName) 20 | { 21 | BatteryType = batteryType; 22 | BatteryCapacity = batteryCapacity; 23 | ManufacturerName = manufacturerName; 24 | } 25 | 26 | public override string ToString() 27 | { 28 | return $"Battery Type {BatteryType}: Manufactured by {ManufacturerName} - Capacity {BatteryCapacity} mAh."; 29 | } 30 | 31 | public int CompareTo(Battery other) 32 | { 33 | 34 | if (ManufacturerName != other.ManufacturerName) 35 | return ManufacturerName.Length - other.ManufacturerName.Length; 36 | 37 | return (int) BatteryType - (int) other.BatteryType; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseMobile_SolutionByNikos/Mobile/DeviceInfo/KnownDevices.cs: -------------------------------------------------------------------------------- 1 | namespace Mobile.DeviceInfo 2 | { 3 | public enum KnownDevices 4 | { 5 | AppleIPhone6, 6 | AppleIPhone7, 7 | SamsungGalaxyA3, 8 | SamsungGalaxyA5, 9 | LgGoogleNexus5X, 10 | MicrosoftLumia950, 11 | TurboXTheIrreplaceable2 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseMobile_SolutionByNikos/Mobile/DeviceInfo/Manufacturers.cs: -------------------------------------------------------------------------------- 1 | namespace Mobile.DeviceInfo 2 | { 3 | public enum Manufacturers 4 | { 5 | Samsung, 6 | Apple, 7 | LG, 8 | Nokia, 9 | Microsoft, 10 | BlackBerry, 11 | TurboX 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseMobile_SolutionByNikos/Mobile/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mobile.DeviceInfo; 3 | using Mobile.DeviceUsageInfo; 4 | 5 | namespace Mobile 6 | { 7 | class Program 8 | { 9 | static void Main(string[] args) 10 | { 11 | MobileDevice Device = MobileDevice.GetKnownDevice(KnownDevices.SamsungGalaxyA5); 12 | Device.SetPhoneNumber(6973453703); 13 | Call NewCall = new Call(Device.PhoneNumber, 6987761688); 14 | 15 | Device.AddToCallHistory(NewCall, true); 16 | 17 | Console.ReadKey(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseSubsequence/ExerciseSubsequence.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExerciseSubsequence", "ExerciseSubsequence\ExerciseSubsequence.csproj", "{16BFCBF1-7DC0-461B-8801-B4B05E841595}" 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 | {16BFCBF1-7DC0-461B-8801-B4B05E841595}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {16BFCBF1-7DC0-461B-8801-B4B05E841595}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {16BFCBF1-7DC0-461B-8801-B4B05E841595}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {16BFCBF1-7DC0-461B-8801-B4B05E841595}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseSubsequence/ExerciseSubsequence/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseSubsequence/ExerciseSubsequence/Program.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 ExerciseSubsequence 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | List list = new List() { 5, 10, 10, 4, 4, 4, 2, 3, 6, 6, 6, 6 }; 14 | 15 | List sequence = Utilities.Subsequence(list); 16 | sequence.ForEach(x => Console.Write(x + " ")); 17 | 18 | List sequence1 = list.Subsequence(); 19 | sequence1.ForEach(x => Console.Write(x + " ")); 20 | 21 | List sequence2 = Utilities.SubLINQ(list); 22 | sequence2.ForEach(x => Console.Write(x + " ")); 23 | 24 | Console.WriteLine(); 25 | Console.ReadKey(); 26 | } 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseUniversity/Exercise_University.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26403.7 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exercise_University", "Exercise_University\Exercise_University.csproj", "{A43F8D09-A9EA-472E-B2A7-DD13F11F7578}" 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 | {A43F8D09-A9EA-472E-B2A7-DD13F11F7578}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {A43F8D09-A9EA-472E-B2A7-DD13F11F7578}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {A43F8D09-A9EA-472E-B2A7-DD13F11F7578}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {A43F8D09-A9EA-472E-B2A7-DD13F11F7578}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseUniversity/Exercise_University/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseUniversity/Exercise_University/Course.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 Exercise_University 8 | { 9 | class Course 10 | { 11 | public string Name { get; private set; } 12 | public int Ects { get; private set; } 13 | 14 | public Course(string name, int ects) 15 | { 16 | Name = name; 17 | Ects = ects; 18 | } 19 | 20 | public override string ToString() 21 | { 22 | return Name; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseUniversity/Exercise_University/Student.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 Exercise_University 8 | { 9 | class Student 10 | { 11 | public string Name { get; private set; } 12 | public double Mark { get; set; } 13 | 14 | public Student(string name) 15 | { 16 | Name = name; 17 | } 18 | 19 | 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseUtilities/ExerciseUtilities.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26403.7 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExerciseUtilities", "Exercise_03\ExerciseUtilities.csproj", "{507A588F-7246-42B5-A1C5-76728FD4FF9F}" 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 | {507A588F-7246-42B5-A1C5-76728FD4FF9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {507A588F-7246-42B5-A1C5-76728FD4FF9F}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {507A588F-7246-42B5-A1C5-76728FD4FF9F}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {507A588F-7246-42B5-A1C5-76728FD4FF9F}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseUtilities/Exercise_03/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseZoo/ExerciseZoo.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26403.7 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExerciseZoo", "Exercise_05\ExerciseZoo.csproj", "{50CABEF6-EF1B-42DC-9D78-71A2943D7220}" 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 | {50CABEF6-EF1B-42DC-9D78-71A2943D7220}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {50CABEF6-EF1B-42DC-9D78-71A2943D7220}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {50CABEF6-EF1B-42DC-9D78-71A2943D7220}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {50CABEF6-EF1B-42DC-9D78-71A2943D7220}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /CSharp/Solutions/ExerciseZoo/Exercise_05/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPatterns/Exercises.md: -------------------------------------------------------------------------------- 1 | # Design Patterns 2 | 3 | ## Exercise 1 4 | ### Observer Pattern 5 | 6 | In the context of bootcamp course, there is a course, students, instructors, and organizers. The course has a start time and end time. If any of the timing changes, the stakeholders have to be notified. Implement a program that notifies the stakeholders whenever the time changes for the course. 7 | 8 | ## Exercise 2 9 | ### Strategy, Factory & Facade Patterns 10 | 11 | Write a program to compute following metrics for C# code: 12 | * Lines of code 13 | * Number of classes 14 | * Number of methods 15 | 16 | 1. Provide two ways to implement the same functionality: By using string comparison and by Regular Expressions. Pay attention to your design. *(hint: implement strategy and factory paterns)* 17 | 2. Extend the above program and implement a segregated interface to compute all the supported metrics. Write all the computed metrics to a CSV file. *(hint: use Facade pattern)* 18 | -------------------------------------------------------------------------------- /DesignPatterns/Solutions/Exercise1/Exercise1.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26403.7 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exercise1", "Exercise1\Exercise1.csproj", "{FC5A8FD8-8E0A-44A3-8EB1-53B3775EEF1B}" 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 | {FC5A8FD8-8E0A-44A3-8EB1-53B3775EEF1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {FC5A8FD8-8E0A-44A3-8EB1-53B3775EEF1B}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {FC5A8FD8-8E0A-44A3-8EB1-53B3775EEF1B}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {FC5A8FD8-8E0A-44A3-8EB1-53B3775EEF1B}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /DesignPatterns/Solutions/Exercise1/Exercise1/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPatterns/Solutions/Exercise1/Exercise1/Instructor.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 Exercise1 8 | { 9 | class Instructor : StakeHolder 10 | { 11 | public Instructor(string name) : base(name) 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DesignPatterns/Solutions/Exercise1/Exercise1/Organizer.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 Exercise1 8 | { 9 | class Organizer : StakeHolder 10 | { 11 | public Organizer(string name) : base(name) 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DesignPatterns/Solutions/Exercise1/Exercise1/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reactive.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Exercise1 9 | { 10 | class Program 11 | { 12 | static void Main(string[] args) 13 | { 14 | Course course1 = new Course("C# Basics", DateTime.Now, DateTime.Now.AddMonths(1)); 15 | Student student = new Student("Bill"); 16 | Instructor instructor = new Instructor("John"); 17 | Organizer organizer = new Organizer("Mary"); 18 | 19 | course1.Subscribe(student); 20 | course1.Subscribe(instructor); 21 | 22 | course1.EndTime = DateTime.Now.AddMonths(1); 23 | 24 | Console.WriteLine("---"); 25 | 26 | course1.Unsubsribe(student); 27 | course1.EndTime = DateTime.Now.AddMonths(1); 28 | 29 | Console.ReadKey(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /DesignPatterns/Solutions/Exercise1/Exercise1/StakeHolder.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 Exercise1 8 | { 9 | class StakeHolder : IObserver 10 | { 11 | public string Name { get; set; } 12 | 13 | public StakeHolder(string name) 14 | { 15 | Name = name; 16 | } 17 | 18 | public void OnNext(Course value) 19 | { 20 | Console.WriteLine(Name + " notified that course " + value.Name + " changed time"); 21 | } 22 | 23 | public void OnError(Exception error) 24 | { 25 | throw new NotImplementedException(); 26 | } 27 | 28 | public void OnCompleted() 29 | { 30 | throw new NotImplementedException(); 31 | } 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DesignPatterns/Solutions/Exercise1/Exercise1/Student.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 Exercise1 8 | { 9 | class Student : StakeHolder 10 | { 11 | public Student(string name) : base(name) 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DesignPatterns/Solutions/Exercise1/Exercise1/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DesignPatterns/Solutions/Exercise2/Exercise2.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26403.7 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exercise2", "Exercise2\Exercise2.csproj", "{EC170B50-BF84-46BE-8DBA-8AA37948CB68}" 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 | {EC170B50-BF84-46BE-8DBA-8AA37948CB68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {EC170B50-BF84-46BE-8DBA-8AA37948CB68}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {EC170B50-BF84-46BE-8DBA-8AA37948CB68}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {EC170B50-BF84-46BE-8DBA-8AA37948CB68}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /DesignPatterns/Solutions/Exercise2/Exercise2/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DesignPatterns/Solutions/Exercise2/Exercise2/FileUtilitiy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Exercise2 9 | { 10 | static class FileUtilitiy 11 | { 12 | public static string ReadFile(string filepath) 13 | { 14 | return File.ReadAllText(filepath); 15 | } 16 | 17 | public static void WriteFile(string filepath, string data) 18 | { 19 | File.WriteAllText(filepath, data); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DesignPatterns/Solutions/Exercise2/Exercise2/MetricSet.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 Exercise2 8 | { 9 | class MetricSet 10 | { 11 | public int LinesOfCode { get; set; } 12 | public int NumberOfClasses { get; set; } 13 | public int NumberOfMethods { get; set; } 14 | 15 | public override string ToString() 16 | { 17 | return LinesOfCode + "," + NumberOfClasses + "," + NumberOfMethods; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DesignPatterns/Solutions/Exercise2/Exercise2/Program.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 Exercise2 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | SourceCodeAnalyzerFacade facade = new SourceCodeAnalyzerFacade(); 14 | facade.AnalyzeSourceCode("SourceCodeAnalyzer.cs", "StringMethodResults.txt", AnalyzerMethod.String); 15 | facade.AnalyzeSourceCode("SourceCodeAnalyzer.cs", "RegexMethodResults.txt", AnalyzerMethod.Regex); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /DesignPatterns/Solutions/Exercise2/Exercise2/RegexAnalyzer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Exercise2 9 | { 10 | class RegexAnalyzer : SourceCodeAnalyzer 11 | { 12 | public RegexAnalyzer(string sourceCode) : base(sourceCode) 13 | { 14 | } 15 | 16 | public override int CalculateLinesOfCode() 17 | { 18 | return Metrics.LinesOfCode = Regex.Matches(SourceCode, "\n").Count; 19 | } 20 | 21 | public override int CalculateNumberOfClasses() 22 | { 23 | return Metrics.NumberOfClasses= Regex.Matches(SourceCode, @"\s+class\s+").Count; 24 | } 25 | 26 | public override int CalculateNumberOfMethods() 27 | { 28 | return Metrics.NumberOfMethods = Regex.Matches(Regex.Replace(SourceCode, @"[\s\n]+", ""), @"\(\w*\){").Count; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /DesignPatterns/Solutions/Exercise2/Exercise2/SourceCodeAnalyzer.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 Exercise2 8 | { 9 | abstract class SourceCodeAnalyzer 10 | { 11 | public MetricSet Metrics { get; protected set; } 12 | public string SourceCode { get; protected set; } 13 | 14 | public SourceCodeAnalyzer(string sourceCode) 15 | { 16 | SourceCode = sourceCode; 17 | Metrics = new MetricSet(); 18 | } 19 | 20 | public abstract int CalculateLinesOfCode(); 21 | public abstract int CalculateNumberOfClasses(); 22 | public abstract int CalculateNumberOfMethods(); 23 | 24 | public void CalculateAll() 25 | { 26 | CalculateLinesOfCode(); 27 | CalculateNumberOfClasses(); 28 | CalculateNumberOfMethods(); 29 | } 30 | 31 | public string GetMetricsInCSV() 32 | { 33 | return Metrics.ToString(); 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DesignPatterns/Solutions/Exercise2/Exercise2/SourceCodeAnalyzerFacade.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 Exercise2 8 | { 9 | class SourceCodeAnalyzerFacade 10 | { 11 | public void AnalyzeSourceCode(string inputFilepath, string outputFilepath, AnalyzerMethod method) 12 | { 13 | string sourceCode = FileUtilitiy.ReadFile(inputFilepath); 14 | SourceCodeAnalyzer analyzer = new SourceCodeAnalyzerFactory().CreateSourceCodeAnalyzer(method, sourceCode); 15 | analyzer.CalculateAll(); 16 | FileUtilitiy.WriteFile(outputFilepath, analyzer.GetMetricsInCSV()); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DesignPatterns/Solutions/Exercise2/Exercise2/SourceCodeAnalyzerFactory.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 Exercise2 8 | { 9 | public enum AnalyzerMethod { String, Regex } 10 | 11 | class SourceCodeAnalyzerFactory 12 | { 13 | public SourceCodeAnalyzer CreateSourceCodeAnalyzer(AnalyzerMethod method, string source) 14 | { 15 | switch(method) 16 | { 17 | case AnalyzerMethod.String: 18 | return new StringAnalyzer(source); 19 | case AnalyzerMethod.Regex: 20 | return new RegexAnalyzer(source); 21 | default: 22 | return new StringAnalyzer(source); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteCSS/web/Contact.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Contact - PW 5 | 6 | 7 | 8 | 9 | 19 |
20 |

I am available for hiring. Get in touch now!

21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 |
© 2016 Copyright of Vyron Vasileiadis
31 | 32 | 33 | -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteCSS/web/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteCSS/web/img/bali-indonesia-tours-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML-CSS-Razor/Solutions/PersonalWebsiteCSS/web/img/bali-indonesia-tours-1.jpg -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteCSS/web/img/bali-indonesia-tours-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML-CSS-Razor/Solutions/PersonalWebsiteCSS/web/img/bali-indonesia-tours-2.jpg -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteCSS/web/img/bali-indonesia-tours-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML-CSS-Razor/Solutions/PersonalWebsiteCSS/web/img/bali-indonesia-tours-3.jpg -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteCSS/web/img/link-source-ordering-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML-CSS-Razor/Solutions/PersonalWebsiteCSS/web/img/link-source-ordering-1.jpg -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteCSS/web/img/personal-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML-CSS-Razor/Solutions/PersonalWebsiteCSS/web/img/personal-image.jpg -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteCSS/web/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteHTML/web/Contact.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Contact - PW 5 | 6 | 7 | 8 | 9 | 19 |
20 |

I am available for hiring. Get in touch now!

21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 |
© 2016 Copyright of Vyron Vasileiadis
31 | 32 | 33 | -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteHTML/web/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteHTML/web/img/bali-indonesia-tours-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML-CSS-Razor/Solutions/PersonalWebsiteHTML/web/img/bali-indonesia-tours-1.jpg -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteHTML/web/img/bali-indonesia-tours-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML-CSS-Razor/Solutions/PersonalWebsiteHTML/web/img/bali-indonesia-tours-2.jpg -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteHTML/web/img/bali-indonesia-tours-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML-CSS-Razor/Solutions/PersonalWebsiteHTML/web/img/bali-indonesia-tours-3.jpg -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteHTML/web/img/link-source-ordering-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML-CSS-Razor/Solutions/PersonalWebsiteHTML/web/img/link-source-ordering-1.jpg -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteHTML/web/img/personal-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML-CSS-Razor/Solutions/PersonalWebsiteHTML/web/img/personal-image.jpg -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteHTML/web/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/App_Code/Blog.cs: -------------------------------------------------------------------------------- 1 | namespace Model 2 | { 3 | using System; 4 | using System.Data.Entity; 5 | using System.ComponentModel.DataAnnotations.Schema; 6 | using System.Linq; 7 | 8 | public partial class Blog : DbContext 9 | { 10 | public Blog() 11 | : base("name=Blog1") 12 | { 13 | } 14 | 15 | public virtual DbSet Categories { get; set; } 16 | public virtual DbSet Posts { get; set; } 17 | 18 | protected override void OnModelCreating(DbModelBuilder modelBuilder) 19 | { 20 | modelBuilder.Entity() 21 | .Property(e => e.Name) 22 | .IsUnicode(false); 23 | 24 | modelBuilder.Entity() 25 | .HasMany(e => e.Posts) 26 | .WithOptional(e => e.Categories) 27 | .HasForeignKey(e => e.CategoryId); 28 | 29 | modelBuilder.Entity() 30 | .Property(e => e.Title) 31 | .IsUnicode(false); 32 | 33 | modelBuilder.Entity() 34 | .Property(e => e.Content) 35 | .IsUnicode(false); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/App_Code/Categories.cs: -------------------------------------------------------------------------------- 1 | namespace Model 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel.DataAnnotations; 6 | using System.ComponentModel.DataAnnotations.Schema; 7 | using System.Data.Entity.Spatial; 8 | 9 | public partial class Categories 10 | { 11 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] 12 | public Categories() 13 | { 14 | Posts = new HashSet(); 15 | } 16 | 17 | public int Id { get; set; } 18 | 19 | [StringLength(50)] 20 | public string Name { get; set; } 21 | 22 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] 23 | public virtual ICollection Posts { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/App_Code/Posts.cs: -------------------------------------------------------------------------------- 1 | namespace Model 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel.DataAnnotations; 6 | using System.ComponentModel.DataAnnotations.Schema; 7 | using System.Data.Entity.Spatial; 8 | 9 | public partial class Posts 10 | { 11 | public int Id { get; set; } 12 | 13 | [StringLength(100)] 14 | public string Title { get; set; } 15 | 16 | public string Content { get; set; } 17 | 18 | public int? CategoryId { get; set; } 19 | 20 | public DateTime? PostedOn { get; set; } 21 | 22 | public virtual Categories Categories { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/Contact.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Contact - PW 5 | 6 | 7 | 8 | 9 | 19 |
20 |

I am available for hiring. Get in touch now!

21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 |
© 2016 Copyright of Vyron Vasileiadis
31 | 32 | 33 | -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/Empty.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | 3 | } -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/SQL_INIT.sql: -------------------------------------------------------------------------------- 1 | create database Blog; 2 | go 3 | use Blog; 4 | go 5 | create table Categories 6 | ( 7 | Id int Identity(1,1) PRIMARY KEY, 8 | Name varchar(50) 9 | ); 10 | go 11 | create table Posts 12 | ( 13 | Id int IDENTITY(1,1) PRIMARY KEY, 14 | Title varchar(100), 15 | Content varchar(max), 16 | CategoryId int FOREIGN KEY REFERENCES Categories(Id), 17 | PostedOn DateTime 18 | ); 19 | go 20 | -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/Shared/_Footer.cshtml: -------------------------------------------------------------------------------- 1 | 
© 2016 Copyright of Vyron Vasileiadis
-------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/Shared/_Header.cshtml: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | @Page.Title - PW 5 | 6 | 7 | 8 | 9 | 10 | @RenderPage("~/Shared/_Header.cshtml") 11 |
12 | @RenderBody() 13 |
14 | @RenderPage("~/Shared/_Footer.cshtml") 15 | 16 | 17 | -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/Shared/img/bali-indonesia-tours-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/Shared/img/bali-indonesia-tours-1.jpg -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/Shared/img/bali-indonesia-tours-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/Shared/img/bali-indonesia-tours-2.jpg -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/Shared/img/bali-indonesia-tours-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/Shared/img/bali-indonesia-tours-3.jpg -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/Shared/img/link-source-ordering-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/Shared/img/link-source-ordering-1.jpg -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/Shared/img/personal-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/Shared/img/personal-image.jpg -------------------------------------------------------------------------------- /HTML-CSS-Razor/Solutions/PersonalWebsiteRazor/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HTML5Boilerplate/css/main.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* ========================================================================== 4 | Author's custom styles 5 | ========================================================================== */ 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /HTML5Boilerplate/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML5Boilerplate/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /HTML5Boilerplate/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML5Boilerplate/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /HTML5Boilerplate/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/HTML5Boilerplate/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /HTML5Boilerplate/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 |
26 |
27 | 28 |
29 |
30 |

© 2nd AFDEmp Coding Bootcamp

31 |
32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /HTML5Boilerplate/js/main.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /HTML5Boilerplate/js/vendor/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /JavaScript/ClickEventDemo/css/main.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* ========================================================================== 4 | Author's custom styles 5 | ========================================================================== */ 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /JavaScript/ClickEventDemo/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/JavaScript/ClickEventDemo/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /JavaScript/ClickEventDemo/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/JavaScript/ClickEventDemo/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /JavaScript/ClickEventDemo/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/JavaScript/ClickEventDemo/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /JavaScript/ClickEventDemo/js/vendor/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /JavaScript/ES6Demo/css/main.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* ========================================================================== 4 | Author's custom styles 5 | ========================================================================== */ 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /JavaScript/ES6Demo/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/JavaScript/ES6Demo/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /JavaScript/ES6Demo/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/JavaScript/ES6Demo/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /JavaScript/ES6Demo/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/JavaScript/ES6Demo/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /JavaScript/ES6Demo/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 |
26 |
27 | 28 |
29 |
30 |

© 2nd AFDEmp Coding Bootcamp

31 |
32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /JavaScript/ES6Demo/js/main.js: -------------------------------------------------------------------------------- 1 | /* 2 | Need transpiler (babel or webpack) to work 3 | */ 4 | //import * as math from 'math.js' 5 | //import { pi, sum } from './math.js'; 6 | 7 | class Product { 8 | constructor(name) { 9 | this.name = name; 10 | } 11 | 12 | capitalize() { return this.name.toUpperCase() }; 13 | } 14 | 15 | window.onload = _ => { 16 | console.log("Loop with var"); 17 | console.log(i); 18 | console.log("Starting loop"); 19 | for (var i = 0; i < 10; i++) { 20 | console.log(i); 21 | } 22 | console.log("Ending loop"); 23 | console.log(i); 24 | 25 | 26 | console.log("Loop with let"); 27 | //this produces error 28 | //console.log(x); 29 | console.log("Starting loop"); 30 | for (let x = 0; x < 10; x++) { 31 | console.log(x); 32 | } 33 | console.log("Ending loop"); 34 | //this produces error too 35 | //console.log(x); 36 | 37 | 38 | //constant declaration 39 | const version = '1.1.1'; 40 | 41 | /* 42 | Need transpiler (babel or webpack) to work 43 | */ 44 | //let f = sum(pi, 5); 45 | //console.log(f); 46 | 47 | let p = new Product('cpu'); 48 | console.log(p.capitalize()); 49 | } 50 | -------------------------------------------------------------------------------- /JavaScript/ES6Demo/js/math.js: -------------------------------------------------------------------------------- 1 | //public const 2 | export const pi = 3.14; 3 | 4 | //public function 5 | export let sum = (a, b) => a + b; 6 | 7 | //private function 8 | let sum2 = function (a, b) { return a + b; } 9 | -------------------------------------------------------------------------------- /JavaScript/ES6Demo/js/vendor/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /JavaScript/Exercises_01/css/main.css: -------------------------------------------------------------------------------- 1 | /* CSS RESET*/ 2 | 3 | * { 4 | box-sizing: border-box; 5 | margin: 0; 6 | padding: 0; 7 | } 8 | 9 | html { 10 | box-sizing: border-box; 11 | } 12 | 13 | *, *:before, *:after { 14 | box-sizing: inherit; 15 | } 16 | -------------------------------------------------------------------------------- /JavaScript/Exercises_01/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 |
17 | 18 |
19 |
20 |

© 2nd AFDEmp Coding Bootcamp

21 |
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /JavaScript/ProductCartDemo/css/main.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* ========================================================================== 4 | Author's custom styles 5 | ========================================================================== */ 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /JavaScript/ProductCartDemo/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/JavaScript/ProductCartDemo/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /JavaScript/ProductCartDemo/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/JavaScript/ProductCartDemo/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /JavaScript/ProductCartDemo/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/JavaScript/ProductCartDemo/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /JavaScript/ProductCartDemo/js/vendor/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /MVC/Exercises.md: -------------------------------------------------------------------------------- 1 | # MVC 2 | 3 | 4 | ## Exercise MVC\_1 5 | 6 | 1. Create a page (Index) which displays a table of products. Each product has name, description and price. The table displays products' name and price, and a link to each product's details which is another page (Detail) displaying all info. 7 | 2. Add a page with a form to create a new product. 8 | 3. Add a button next to every product in Index's table which deletes the product. 9 | 4. Add another table to database: Category. Also, update the Product (every product belongs to a category) 10 | 5. Update all pages to comply with this change. 11 | 12 | ## Exercise Basketball 13 | 14 | We will create a website to manage Bootcamp's 3on3 tournament. 15 | 16 | **Registration Phase:** The user must be logged in to use the website. He gives just a name and email during signup. After logging in he is presented with the list of existing teams. The user can either create a new team or request to join an existing one. Only the creator of each team can accept or decline the offers. Each user can only join one team. -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26403.7 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Basketball", "Basketball\Basketball.csproj", "{6CE82C43-7C77-4454-8D89-924B54025E39}" 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 | {6CE82C43-7C77-4454-8D89-924B54025E39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {6CE82C43-7C77-4454-8D89-924B54025E39}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {6CE82C43-7C77-4454-8D89-924B54025E39}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {6CE82C43-7C77-4454-8D89-924B54025E39}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace Basketball 5 | { 6 | public class BundleConfig 7 | { 8 | // For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 12 | "~/Scripts/jquery-{version}.js")); 13 | 14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( 15 | "~/Scripts/jquery.validate*")); 16 | 17 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 18 | // ready for production, use the build tool at https://modernizr.com to pick only the tests you need. 19 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 20 | "~/Scripts/modernizr-*")); 21 | 22 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 23 | "~/Scripts/bootstrap.js", 24 | "~/Scripts/respond.js")); 25 | 26 | bundles.Add(new StyleBundle("~/Content/css").Include( 27 | "~/Content/bootstrap.css", 28 | "~/Content/site.css")); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace Basketball 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace Basketball 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapMvcAttributeRoutes(); 17 | 18 | routes.MapRoute( 19 | name: "Default", 20 | url: "{controller}/{action}/{id}", 21 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 22 | ); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Override the default bootstrap behavior where horizontal description lists 13 | will truncate terms that are too long to fit in the left column 14 | */ 15 | .dl-horizontal dt { 16 | white-space: normal; 17 | } 18 | 19 | /* Set width on the form input elements since they're 100% wide by default */ 20 | input, 21 | select, 22 | textarea { 23 | max-width: 280px; 24 | } 25 | 26 | /*CUSTOM CODE*/ 27 | .teams-container { 28 | display: flex; 29 | flex-direction: column; 30 | } 31 | 32 | .teams-members-list { 33 | display: flex; 34 | align-content: flex-start; 35 | } 36 | -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Basketball.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Optimization; 7 | using System.Web.Routing; 8 | 9 | namespace Basketball 10 | { 11 | public class MvcApplication : System.Web.HttpApplication 12 | { 13 | protected void Application_Start() 14 | { 15 | AreaRegistration.RegisterAllAreas(); 16 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 17 | RouteConfig.RegisterRoutes(RouteTable.Routes); 18 | BundleConfig.RegisterBundles(BundleTable.Bundles); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/Migrations/201705251421390_init.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Basketball.Migrations 3 | { 4 | using System.CodeDom.Compiler; 5 | using System.Data.Entity.Migrations; 6 | using System.Data.Entity.Migrations.Infrastructure; 7 | using System.Resources; 8 | 9 | [GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")] 10 | public sealed partial class init : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(init)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201705251421390_init"; } 17 | } 18 | 19 | string IMigrationMetadata.Source 20 | { 21 | get { return null; } 22 | } 23 | 24 | string IMigrationMetadata.Target 25 | { 26 | get { return Resources.GetString("Target"); } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/Migrations/Configuration.cs: -------------------------------------------------------------------------------- 1 | namespace Basketball.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity; 5 | using System.Data.Entity.Migrations; 6 | using System.Linq; 7 | 8 | internal sealed class Configuration : DbMigrationsConfiguration 9 | { 10 | public Configuration() 11 | { 12 | AutomaticMigrationsEnabled = false; 13 | } 14 | 15 | protected override void Seed(Basketball.Models.MyContext context) 16 | { 17 | // This method will be called after migrating to the latest version. 18 | 19 | // You can use the DbSet.AddOrUpdate() helper extension method 20 | // to avoid creating duplicate seed data. E.g. 21 | // 22 | // context.People.AddOrUpdate( 23 | // p => p.FullName, 24 | // new Person { FullName = "Andrew Peters" }, 25 | // new Person { FullName = "Brice Lambson" }, 26 | // new Person { FullName = "Rowan Miller" } 27 | // ); 28 | // 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/Models/BaseViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace Basketball.Models 7 | { 8 | public class BaseViewModel 9 | { 10 | public User User { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/Models/IndexViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace Basketball.Models 7 | { 8 | public class IndexViewModel : BaseViewModel 9 | { 10 | public List Teams { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/Models/JoinRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.ComponentModel.DataAnnotations; 6 | using System.ComponentModel.DataAnnotations.Schema; 7 | 8 | namespace Basketball.Models 9 | { 10 | public class JoinRequest 11 | { 12 | public int Id { get; set; } 13 | 14 | [ForeignKey("User")] 15 | public string UserName { get; set; } 16 | public User User { get; set; } 17 | 18 | [ForeignKey("Team")] 19 | public string TeamName { get; set; } 20 | public Team Team { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/Models/Team.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.ComponentModel.DataAnnotations.Schema; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | namespace Basketball.Models 9 | { 10 | public class Team 11 | { 12 | public Team() 13 | { 14 | Members = new List(); 15 | } 16 | [Key] 17 | [DatabaseGenerated(DatabaseGeneratedOption.None)] 18 | public string Name { get; set; } 19 | 20 | [ForeignKey("Creator")] 21 | public string CreatorEmail { get; set; } 22 | public User Creator { get; set; } 23 | 24 | public virtual ICollection Members { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/Models/User.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.ComponentModel.DataAnnotations.Schema; 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | namespace Basketball.Models 9 | { 10 | public class User 11 | { 12 | [Key] 13 | [DatabaseGenerated(DatabaseGeneratedOption.None)] 14 | [Required(ErrorMessage = "Email is required")] 15 | [DataType(DataType.EmailAddress)] 16 | [EmailAddress] 17 | public string Email { get; set; } 18 | [Required(ErrorMessage = "Name is required")] 19 | public string Name { get; set; } 20 | [Required(ErrorMessage = "Password is required")] 21 | [DataType(DataType.Password)] 22 | public string Password { get; set; } 23 | 24 | public string TeamName { get; set; } 25 | public Team Team { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/Models/ViewRequestsViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace Basketball.Models 7 | { 8 | public class ViewRequestsViewModel : BaseViewModel 9 | { 10 | public List Requests { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/Views/Home/CreateTeam.cshtml: -------------------------------------------------------------------------------- 1 | @model Basketball.Models.Team 2 | 3 | @using (Html.BeginForm()) 4 | { 5 | @Html.AntiForgeryToken() 6 | 7 |
8 |

Create team

9 |
10 | 11 |
12 | @Html.LabelFor(model => model.Name, "Name", htmlAttributes: new { @class = "control-label col-md-2" }) 13 |
14 | @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } }) 15 | @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" }) 16 |
17 |
18 | 19 | @Html.HiddenFor(model => model.CreatorEmail) 20 | 21 |
22 |
23 | 24 |
25 |
26 |
27 | } -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model Basketball.Models.IndexViewModel 2 | 3 |

List of teams

4 |
5 | @foreach (var team in Model.Teams) 6 | { 7 |
8 |
@Html.DisplayFor(x => team.Name)
9 |
Members
10 |
11 | @foreach (var member in team.Members) 12 | { 13 |
14 |

15 | @Html.DisplayFor(x => member.Name) 16 |

17 |
18 | } 19 |
20 | @if (Model.User.Team == null) 21 | { 22 | @Html.ActionLink("Request to join", "JoinRequest", new { userEmail = Model.User.Email, teamName = team.Name}, null) 23 | } 24 |
25 | } 26 |
27 | -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/Views/Home/ViewRequests.cshtml: -------------------------------------------------------------------------------- 1 | @model Basketball.Models.ViewRequestsViewModel 2 | 3 | -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Error 6 | 7 | 8 |
9 |

Error.

10 |

An error occurred while processing your request.

11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/MVC/Solutions/Basketball/Basketball/favicon.ico -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/MVC/Solutions/Basketball/Basketball/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/MVC/Solutions/Basketball/Basketball/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /MVC/Solutions/Basketball/Basketball/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/MVC/Solutions/Basketball/Basketball/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26403.7 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MVC_1", "MVC_1\MVC_1.csproj", "{64BA0645-083C-4AAC-BF28-1B0689C0C0F1}" 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 | {64BA0645-083C-4AAC-BF28-1B0689C0C0F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {64BA0645-083C-4AAC-BF28-1B0689C0C0F1}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {64BA0645-083C-4AAC-BF28-1B0689C0C0F1}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {64BA0645-083C-4AAC-BF28-1B0689C0C0F1}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace MVC_1 5 | { 6 | public class BundleConfig 7 | { 8 | // For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 12 | "~/Scripts/jquery-{version}.js")); 13 | 14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( 15 | "~/Scripts/jquery.validate*")); 16 | 17 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 18 | // ready for production, use the build tool at https://modernizr.com to pick only the tests you need. 19 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 20 | "~/Scripts/modernizr-*")); 21 | 22 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 23 | "~/Scripts/bootstrap.js", 24 | "~/Scripts/respond.js")); 25 | 26 | bundles.Add(new StyleBundle("~/Content/css").Include( 27 | "~/Content/bootstrap.css", 28 | "~/Content/site.css")); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace MVC_1 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace MVC_1 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Override the default bootstrap behavior where horizontal description lists 13 | will truncate terms that are too long to fit in the left column 14 | */ 15 | .dl-horizontal dt { 16 | white-space: normal; 17 | } 18 | 19 | /* Set width on the form input elements since they're 100% wide by default */ 20 | input, 21 | select, 22 | textarea { 23 | max-width: 280px; 24 | } 25 | -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace MVC_1.Controllers 8 | { 9 | public class HomeController : Controller 10 | { 11 | public ActionResult Index() 12 | { 13 | return View(); 14 | } 15 | 16 | public ActionResult About(int? id) 17 | { 18 | ViewBag.Message = "Your application description page."; 19 | ViewBag.UserId = id; 20 | 21 | return View(); 22 | } 23 | 24 | public ActionResult Contact() 25 | { 26 | ViewBag.Message = "Your contact page."; 27 | 28 | return View(); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="MVC_1.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Optimization; 7 | using System.Web.Routing; 8 | 9 | namespace MVC_1 10 | { 11 | public class MvcApplication : System.Web.HttpApplication 12 | { 13 | protected void Application_Start() 14 | { 15 | AreaRegistration.RegisterAllAreas(); 16 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 17 | RouteConfig.RegisterRoutes(RouteTable.Routes); 18 | BundleConfig.RegisterBundles(BundleTable.Bundles); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Migrations/201705221343105_Init.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace MVC_1.Migrations 3 | { 4 | using System.CodeDom.Compiler; 5 | using System.Data.Entity.Migrations; 6 | using System.Data.Entity.Migrations.Infrastructure; 7 | using System.Resources; 8 | 9 | [GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")] 10 | public sealed partial class Init : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(Init)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201705221343105_Init"; } 17 | } 18 | 19 | string IMigrationMetadata.Source 20 | { 21 | get { return null; } 22 | } 23 | 24 | string IMigrationMetadata.Target 25 | { 26 | get { return Resources.GetString("Target"); } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Migrations/201705221343105_Init.cs: -------------------------------------------------------------------------------- 1 | namespace MVC_1.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity.Migrations; 5 | 6 | public partial class Init : DbMigration 7 | { 8 | public override void Up() 9 | { 10 | CreateTable( 11 | "dbo.Products", 12 | c => new 13 | { 14 | Id = c.Int(nullable: false, identity: true), 15 | Name = c.String(), 16 | Description = c.String(), 17 | Price = c.Decimal(nullable: false, precision: 18, scale: 2), 18 | }) 19 | .PrimaryKey(t => t.Id); 20 | 21 | } 22 | 23 | public override void Down() 24 | { 25 | DropTable("dbo.Products"); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Migrations/201705241329590_Added Category.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace MVC_1.Migrations 3 | { 4 | using System.CodeDom.Compiler; 5 | using System.Data.Entity.Migrations; 6 | using System.Data.Entity.Migrations.Infrastructure; 7 | using System.Resources; 8 | 9 | [GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")] 10 | public sealed partial class AddedCategory : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(AddedCategory)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201705241329590_Added Category"; } 17 | } 18 | 19 | string IMigrationMetadata.Source 20 | { 21 | get { return null; } 22 | } 23 | 24 | string IMigrationMetadata.Target 25 | { 26 | get { return Resources.GetString("Target"); } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Migrations/201705241329590_Added Category.cs: -------------------------------------------------------------------------------- 1 | namespace MVC_1.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity.Migrations; 5 | 6 | public partial class AddedCategory : DbMigration 7 | { 8 | public override void Up() 9 | { 10 | CreateTable( 11 | "dbo.Categories", 12 | c => new 13 | { 14 | Id = c.Int(nullable: false, identity: true), 15 | Name = c.String(), 16 | }) 17 | .PrimaryKey(t => t.Id); 18 | 19 | AddColumn("dbo.Products", "CategoryId", c => c.Int(nullable: false)); 20 | CreateIndex("dbo.Products", "CategoryId"); 21 | AddForeignKey("dbo.Products", "CategoryId", "dbo.Categories", "Id", cascadeDelete: true); 22 | } 23 | 24 | public override void Down() 25 | { 26 | DropForeignKey("dbo.Products", "CategoryId", "dbo.Categories"); 27 | DropIndex("dbo.Products", new[] { "CategoryId" }); 28 | DropColumn("dbo.Products", "CategoryId"); 29 | DropTable("dbo.Categories"); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Models/Category.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace MVC_1.Models 7 | { 8 | public class Category 9 | { 10 | public int Id { get; set; } 11 | public string Name { get; set; } 12 | 13 | public virtual ICollection Products { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Models/MyModel.cs: -------------------------------------------------------------------------------- 1 | namespace MVC_1.Models 2 | { 3 | using System; 4 | using System.Data.Entity; 5 | using System.Linq; 6 | 7 | public class MyModel : DbContext 8 | { 9 | // Your context has been configured to use a 'MyModel' connection string from your application's 10 | // configuration file (App.config or Web.config). By default, this connection string targets the 11 | // 'MVC_1.Models.MyModel' database on your LocalDb instance. 12 | // 13 | // If you wish to target a different database and/or database provider, modify the 'MyModel' 14 | // connection string in the application configuration file. 15 | public MyModel() 16 | : base("name=MyModel") 17 | { 18 | } 19 | 20 | // Add a DbSet for each entity type that you want to include in your model. For more information 21 | // on configuring and using a Code First model, see http://go.microsoft.com/fwlink/?LinkId=390109. 22 | 23 | public virtual DbSet Products { get; set; } 24 | public virtual DbSet Categories { get; set; } 25 | } 26 | 27 | //public class MyEntity 28 | //{ 29 | // public int Id { get; set; } 30 | // public string Name { get; set; } 31 | //} 32 | } -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Models/Product.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.ComponentModel.DataAnnotations; 6 | using System.ComponentModel.DataAnnotations.Schema; 7 | 8 | namespace MVC_1.Models 9 | { 10 | public class Product 11 | { 12 | public int Id { get; set; } 13 | public string Name { get; set; } 14 | public string Description { get; set; } 15 | public decimal Price { get; set; } 16 | 17 | [ForeignKey("Category")] 18 | public int CategoryId { get; set; } 19 | public virtual Category Category { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "About"; 3 | } 4 |

@ViewBag.Title

5 |

@ViewBag.Message

6 | 7 |

@ViewBag.UserID

8 | 9 |

Use this area to provide additional information.

10 | -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Contact"; 3 | } 4 |

@ViewBag.Title.

5 |

@ViewBag.Message

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
-------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Views/Products/Detail.cshtml: -------------------------------------------------------------------------------- 1 | @model MVC_1.Models.Product 2 | 3 |

@Html.DisplayFor(x => x.Name)

4 |

@Html.DisplayFor(x => x.Price)

5 |
@Html.DisplayFor(x => x.Category.Name)
6 |

@Html.DisplayFor(x => x.Description)

-------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Views/Products/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | 4 | 5 | 8 | 11 | 14 | 15 | 16 | 17 | 18 | @foreach (var item in Model) 19 | { 20 | 21 | 24 | 27 | 30 | 33 | 36 | 37 | } 38 |
6 | @Html.DisplayNameFor(model => model.Name) 7 | 9 | @Html.DisplayNameFor(model => model.Price) 10 | 12 | @Html.DisplayNameFor(model => model.Category.Name) 13 |
22 | @Html.DisplayFor(modelItem => item.Name) 23 | 25 | @Html.DisplayFor(modelItem => item.Price) 26 | 28 | @Html.DisplayFor(modelItem => item.Category.Name) 29 | 31 | @Html.ActionLink("View Details", "Detail", new { id = item.Id }) 32 | 34 | @Html.ActionLink("Delete", "Delete", new { id = item.Id }) 35 |
39 | -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Error 6 | 7 | 8 |
9 |

Error.

10 |

An error occurred while processing your request.

11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/MVC/Solutions/MVC_1/MVC_1/favicon.ico -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/MVC/Solutions/MVC_1/MVC_1/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/MVC/Solutions/MVC_1/MVC_1/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /MVC/Solutions/MVC_1/MVC_1/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/MVC/Solutions/MVC_1/MVC_1/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26403.7 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TodoApp", "TodoApp\TodoApp.csproj", "{CF43D19F-A122-4D99-83BA-890464F8251B}" 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 | {CF43D19F-A122-4D99-83BA-890464F8251B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {CF43D19F-A122-4D99-83BA-890464F8251B}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {CF43D19F-A122-4D99-83BA-890464F8251B}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {CF43D19F-A122-4D99-83BA-890464F8251B}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace TodoApp 5 | { 6 | public class BundleConfig 7 | { 8 | // For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | bundles.Add(new StyleBundle("~/Content/css").Include( 12 | "~/Content/Site.css")); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace TodoApp 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace TodoApp 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="TodoApp.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Http; 6 | using System.Web.Mvc; 7 | using System.Web.Optimization; 8 | using System.Web.Routing; 9 | 10 | namespace TodoApp 11 | { 12 | public class MvcApplication : System.Web.HttpApplication 13 | { 14 | protected void Application_Start() 15 | { 16 | AreaRegistration.RegisterAllAreas(); 17 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 18 | RouteConfig.RegisterRoutes(RouteTable.Routes); 19 | BundleConfig.RegisterBundles(BundleTable.Bundles); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/Migrations/201706191041416_init.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace TodoApp.Migrations 3 | { 4 | using System.CodeDom.Compiler; 5 | using System.Data.Entity.Migrations; 6 | using System.Data.Entity.Migrations.Infrastructure; 7 | using System.Resources; 8 | 9 | [GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")] 10 | public sealed partial class init : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(init)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201706191041416_init"; } 17 | } 18 | 19 | string IMigrationMetadata.Source 20 | { 21 | get { return null; } 22 | } 23 | 24 | string IMigrationMetadata.Target 25 | { 26 | get { return Resources.GetString("Target"); } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/Migrations/201706211226253_removed-description.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace TodoApp.Migrations 3 | { 4 | using System.CodeDom.Compiler; 5 | using System.Data.Entity.Migrations; 6 | using System.Data.Entity.Migrations.Infrastructure; 7 | using System.Resources; 8 | 9 | [GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")] 10 | public sealed partial class removeddescription : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(removeddescription)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201706211226253_removed-description"; } 17 | } 18 | 19 | string IMigrationMetadata.Source 20 | { 21 | get { return null; } 22 | } 23 | 24 | string IMigrationMetadata.Target 25 | { 26 | get { return Resources.GetString("Target"); } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/Migrations/201706211226253_removed-description.cs: -------------------------------------------------------------------------------- 1 | namespace TodoApp.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity.Migrations; 5 | 6 | public partial class removeddescription : DbMigration 7 | { 8 | public override void Up() 9 | { 10 | DropColumn("dbo.Tasks", "Description"); 11 | } 12 | 13 | public override void Down() 14 | { 15 | AddColumn("dbo.Tasks", "Description", c => c.String()); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/Migrations/Configuration.cs: -------------------------------------------------------------------------------- 1 | namespace TodoApp.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity; 5 | using System.Data.Entity.Migrations; 6 | using System.Linq; 7 | 8 | using TodoApp.Models; 9 | 10 | internal sealed class Configuration : DbMigrationsConfiguration 11 | { 12 | public Configuration() 13 | { 14 | AutomaticMigrationsEnabled = false; 15 | } 16 | 17 | protected override void Seed(TodoApp.Models.MyContext context) 18 | { 19 | 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/Models/MyContext.cs: -------------------------------------------------------------------------------- 1 | namespace TodoApp.Models 2 | { 3 | using System; 4 | using System.Data.Entity; 5 | using System.Linq; 6 | 7 | public class MyContext : DbContext 8 | { 9 | public MyContext() 10 | : base("name=MyContext") 11 | { 12 | } 13 | 14 | public virtual DbSet Users { get; set; } 15 | public virtual DbSet Tasks { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/Models/Task.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | using System.ComponentModel.DataAnnotations; 7 | using System.ComponentModel.DataAnnotations.Schema; 8 | 9 | 10 | namespace TodoApp.Models 11 | { 12 | public class Task 13 | { 14 | public int Id { get; set; } 15 | public string Title { get; set; } 16 | public bool IsCompleted { get; set; } 17 | 18 | [ForeignKey("User")] 19 | public string UserEmail { get; set; } 20 | public User User { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/Models/User.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | using System.ComponentModel.DataAnnotations; 7 | using System.ComponentModel.DataAnnotations.Schema; 8 | 9 | namespace TodoApp.Models 10 | { 11 | public class User 12 | { 13 | [Key] 14 | [DatabaseGenerated(DatabaseGeneratedOption.None)] 15 | public string Email { get; set; } 16 | 17 | public string Name { get; set; } 18 | public string Surname { get; set; } 19 | 20 | public string Salt { get; set; } 21 | public string HashedPasswordAndSalt { get; set; } 22 | 23 | public ICollection Tasks { get; set; } 24 | 25 | public User() 26 | { 27 | Tasks = new List(); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/ViewModels/LoginViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | namespace TodoApp.ViewModels 9 | { 10 | public class LoginViewModel 11 | { 12 | [DataType(DataType.EmailAddress)] 13 | [EmailAddress] 14 | public string Email { get; set; } 15 | 16 | [DataType(DataType.Password)] 17 | public string Password { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/ViewModels/RegisterViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | namespace TodoApp.ViewModels 9 | { 10 | public class RegisterViewModel 11 | { 12 | [DataType(DataType.Text)] 13 | public string Name { get; set; } 14 | 15 | [DataType(DataType.Text)] 16 | public string Surname { get; set; } 17 | 18 | [DataType(DataType.EmailAddress)] 19 | [EmailAddress] 20 | public string Email { get; set; } 21 | 22 | [DataType(DataType.Password)] 23 | public string Password { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Error 6 | 7 | 8 |
9 |

Error.

10 |

An error occurred while processing your request.

11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/Views/Shared/_Anonymous.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewBag.Title - todos tutorial 7 | @Styles.Render("~/Content/css") 8 | 9 | 10 |
11 | @RenderBody() 12 |
13 | @RenderSection("scripts", required: false) 14 | 15 | 16 | -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewBag.Title - todos tutorial 7 | @Styles.Render("~/Content/css") 8 | 9 | 10 | 15 |
16 | @RenderBody() 17 |
18 |
19 |

© 2nd AFDEmp Coding Bootcamp

20 |
21 | @RenderSection("scripts", required: false) 22 | 23 | 24 | -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /MVC/Solutions/TodoApp/TodoApp/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/MVC/Solutions/TodoApp/TodoApp/favicon.ico -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Skroutz", "Skroutz\Skroutz.csproj", "{03F5F571-EB22-4FBC-ABBC-E228E598F227}" 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 | {03F5F571-EB22-4FBC-ABBC-E228E598F227}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {03F5F571-EB22-4FBC-ABBC-E228E598F227}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {03F5F571-EB22-4FBC-ABBC-E228E598F227}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {03F5F571-EB22-4FBC-ABBC-E228E598F227}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace Skroutz 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapMvcAttributeRoutes(); 17 | 18 | routes.MapRoute( 19 | name: "Default", 20 | url: "{controller}/{action}/{id}", 21 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 22 | ); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Set width on the form input elements since they're 100% wide by default */ 13 | input, 14 | select, 15 | textarea { 16 | max-width: 280px; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace Skroutz.Controllers 8 | { 9 | public class HomeController : Controller 10 | { 11 | // GET: Home 12 | public ActionResult Index() 13 | { 14 | return View(); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Skroutz.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace Skroutz 9 | { 10 | public class MvcApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | AreaRegistration.RegisterAllAreas(); 15 | RouteConfig.RegisterRoutes(RouteTable.Routes); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Migrations/201611221633191_init.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Skroutz.Migrations 3 | { 4 | using System.CodeDom.Compiler; 5 | using System.Data.Entity.Migrations; 6 | using System.Data.Entity.Migrations.Infrastructure; 7 | using System.Resources; 8 | 9 | [GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")] 10 | public sealed partial class init : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(init)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201611221633191_init"; } 17 | } 18 | 19 | string IMigrationMetadata.Source 20 | { 21 | get { return null; } 22 | } 23 | 24 | string IMigrationMetadata.Target 25 | { 26 | get { return Resources.GetString("Target"); } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Migrations/201611251245086_update.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Skroutz.Migrations 3 | { 4 | using System.CodeDom.Compiler; 5 | using System.Data.Entity.Migrations; 6 | using System.Data.Entity.Migrations.Infrastructure; 7 | using System.Resources; 8 | 9 | [GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")] 10 | public sealed partial class update : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(update)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201611251245086_update"; } 17 | } 18 | 19 | string IMigrationMetadata.Source 20 | { 21 | get { return null; } 22 | } 23 | 24 | string IMigrationMetadata.Target 25 | { 26 | get { return Resources.GetString("Target"); } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Migrations/201611281200226_update1.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Skroutz.Migrations 3 | { 4 | using System.CodeDom.Compiler; 5 | using System.Data.Entity.Migrations; 6 | using System.Data.Entity.Migrations.Infrastructure; 7 | using System.Resources; 8 | 9 | [GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")] 10 | public sealed partial class update1 : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(update1)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201611281200226_update1"; } 17 | } 18 | 19 | string IMigrationMetadata.Source 20 | { 21 | get { return null; } 22 | } 23 | 24 | string IMigrationMetadata.Target 25 | { 26 | get { return Resources.GetString("Target"); } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Migrations/201611281235048_update2.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Skroutz.Migrations 3 | { 4 | using System.CodeDom.Compiler; 5 | using System.Data.Entity.Migrations; 6 | using System.Data.Entity.Migrations.Infrastructure; 7 | using System.Resources; 8 | 9 | [GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")] 10 | public sealed partial class update2 : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(update2)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201611281235048_update2"; } 17 | } 18 | 19 | string IMigrationMetadata.Source 20 | { 21 | get { return null; } 22 | } 23 | 24 | string IMigrationMetadata.Target 25 | { 26 | get { return Resources.GetString("Target"); } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Migrations/201611281235048_update2.cs: -------------------------------------------------------------------------------- 1 | namespace Skroutz.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity.Migrations; 5 | 6 | public partial class update2 : DbMigration 7 | { 8 | public override void Up() 9 | { 10 | RenameTable(name: "dbo.Attributes", newName: "AttributeValues"); 11 | } 12 | 13 | public override void Down() 14 | { 15 | RenameTable(name: "dbo.AttributeValues", newName: "Attributes"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Migrations/201611281542536_display.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Skroutz.Migrations 3 | { 4 | using System.CodeDom.Compiler; 5 | using System.Data.Entity.Migrations; 6 | using System.Data.Entity.Migrations.Infrastructure; 7 | using System.Resources; 8 | 9 | [GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")] 10 | public sealed partial class display : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(display)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201611281542536_display"; } 17 | } 18 | 19 | string IMigrationMetadata.Source 20 | { 21 | get { return null; } 22 | } 23 | 24 | string IMigrationMetadata.Target 25 | { 26 | get { return Resources.GetString("Target"); } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Migrations/201611281542536_display.cs: -------------------------------------------------------------------------------- 1 | namespace Skroutz.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity.Migrations; 5 | 6 | public partial class display : DbMigration 7 | { 8 | public override void Up() 9 | { 10 | } 11 | 12 | public override void Down() 13 | { 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Migrations/Configuration.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/Project Skroutz/Skroutz/Skroutz/Migrations/Configuration.cs -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Models/AttributeKey.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.ComponentModel.DataAnnotations; 6 | 7 | namespace Skroutz.Models 8 | { 9 | public enum AttributeDataType 10 | { 11 | Integer, 12 | String, 13 | Boolean 14 | } 15 | public class AttributeKey 16 | { 17 | public int Id { get; set; } 18 | [Display(Name="Name")] 19 | public string Name { get; set; } 20 | [Display(Name="Measurement Unit")] 21 | public string MeasurementUnit { get; set; } 22 | [Display(Name="Data Type")] 23 | public AttributeDataType DataType { get; set; } 24 | [Display(Name="Category")] 25 | public int CategoryId { get; set; } 26 | public virtual Category Category { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Models/AttributeValue.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | using System.ComponentModel.DataAnnotations; 7 | using System.ComponentModel.DataAnnotations.Schema; 8 | 9 | namespace Skroutz.Models 10 | { 11 | public class AttributeValue 12 | { 13 | [Key] 14 | [Column(Order = 1)] 15 | [ForeignKey("Product")] 16 | [DatabaseGenerated(DatabaseGeneratedOption.None)] 17 | [Display(Name = "Product")] 18 | public int ProductId { get; set; } 19 | public virtual Product Product { get; set; } 20 | [Key] 21 | [Column(Order = 2)] 22 | [ForeignKey("AttributeKey")] 23 | [DatabaseGenerated(DatabaseGeneratedOption.None)] 24 | [Display(Name = "Attribute")] 25 | public int AttributeKeyId { get; set; } 26 | public virtual AttributeKey AttributeKey { get; set; } 27 | public string Value { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Models/Category.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.ComponentModel.DataAnnotations; 6 | 7 | namespace Skroutz.Models 8 | { 9 | public class Category 10 | { 11 | public int Id { get; set; } 12 | public string Name { get; set; } 13 | [Display(Name = "Parent Category")] 14 | public int? ParentId { get; set; } 15 | public virtual Category Parent { get; set; } 16 | public virtual ICollection Children { get; set; } 17 | public virtual ICollection Products { get; set; } 18 | public virtual ICollection Attributes { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Models/Inventory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.ComponentModel.DataAnnotations; 6 | using System.ComponentModel.DataAnnotations.Schema; 7 | using System.Web.UI; 8 | 9 | namespace Skroutz.Models 10 | { 11 | public class Inventory 12 | { 13 | [Key] 14 | [Column(Order = 1)] 15 | [ForeignKey("Product")] 16 | [DatabaseGenerated(DatabaseGeneratedOption.None)] 17 | [Display(Name = "Product")] 18 | public int ProductId { get; set; } 19 | public virtual Product Product { get; set; } 20 | [Key] 21 | [Column(Order = 2)] 22 | [ForeignKey("Store")] 23 | [DatabaseGenerated(DatabaseGeneratedOption.None)] 24 | [Display(Name = "Store")] 25 | public int StoreId { get; set; } 26 | public virtual Store Store { get; set; } 27 | public decimal Price { get; set; } 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Models/Product.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.ComponentModel.DataAnnotations; 6 | 7 | namespace Skroutz.Models 8 | { 9 | public class Product 10 | { 11 | public int Id { get; set; } 12 | public string Name { get; set; } 13 | [Display(Name = "Category")] 14 | public int CategoryId { get; set; } 15 | public virtual Category Category { get; set; } 16 | public virtual ICollection Inventory { get; set; } 17 | public virtual ICollection Attributes { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Models/Store.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | using System.ComponentModel.DataAnnotations; 7 | 8 | namespace Skroutz.Models 9 | { 10 | public class Store 11 | { 12 | public int Id { get; set; } 13 | [Display(Name = "Store")] 14 | public string Name { get; set; } 15 | public string Web { get; set; } 16 | public string Headquarters { get; set; } 17 | public string Phone { get; set; } 18 | public virtual ICollection Inventory { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Views/AttributeKeys/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model Skroutz.Models.AttributeKey 2 | 3 | @{ 4 | ViewBag.Title = "Details"; 5 | } 6 | 7 |

Details

8 | 9 |
10 |

AttributeKey

11 |
12 |
13 |
14 | @Html.DisplayNameFor(model => model.Name) 15 |
16 | 17 |
18 | @Html.DisplayFor(model => model.Name) 19 |
20 | 21 |
22 | @Html.DisplayNameFor(model => model.MeasurementUnit) 23 |
24 | 25 |
26 | @Html.DisplayFor(model => model.MeasurementUnit) 27 |
28 | 29 |
30 | @Html.DisplayNameFor(model => model.DataType) 31 |
32 | 33 |
34 | @Html.DisplayFor(model => model.DataType) 35 |
36 | 37 |
38 | @Html.DisplayNameFor(model => model.CategoryId) 39 |
40 | 41 |
42 | @Html.DisplayFor(model => model.Category.Name) 43 |
44 |
45 |
46 |

47 | @Html.ActionLink("Edit", "Edit", new { id = Model.Id }) | 48 | @Html.ActionLink("Back to List", "Index") 49 |

50 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Views/AttributeValues/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model Skroutz.Models.AttributeValue 2 | 3 | @{ 4 | ViewBag.Title = "Delete"; 5 | } 6 | 7 |

Delete

8 | 9 |

Are you sure you want to delete this?

10 |
11 |

AttributeValue

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.AttributeKeyId) 16 |
17 | 18 |
19 | @Html.DisplayFor(model => model.AttributeKey.Name) 20 |
21 | 22 |
23 | @Html.DisplayNameFor(model => model.ProductId) 24 |
25 | 26 |
27 | @Html.DisplayFor(model => model.Product.Name) 28 |
29 | 30 |
31 | @Html.DisplayNameFor(model => model.Value) 32 |
33 | 34 |
35 | @Html.DisplayFor(model => model.Value) 36 |
37 | 38 |
39 | 40 | @using (Html.BeginForm()) { 41 | @Html.AntiForgeryToken() 42 | 43 |
44 | | 45 | @Html.ActionLink("Back to List", "Index") 46 |
47 | } 48 |
49 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Views/AttributeValues/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model Skroutz.Models.AttributeValue 2 | 3 | @{ 4 | ViewBag.Title = "Details"; 5 | } 6 | 7 |

Details

8 | 9 |
10 |

AttributeValue

11 |
12 |
13 |
14 | @Html.DisplayNameFor(model => model.AttributeKeyId) 15 |
16 | 17 |
18 | @Html.DisplayFor(model => model.AttributeKey.Name) 19 |
20 | 21 |
22 | @Html.DisplayNameFor(model => model.ProductId) 23 |
24 | 25 |
26 | @Html.DisplayFor(model => model.Product.Name) 27 |
28 | 29 |
30 | @Html.DisplayNameFor(model => model.Value) 31 |
32 | 33 |
34 | @Html.DisplayFor(model => model.Value) 35 |
36 | 37 |
38 |
39 |

40 | @Html.ActionLink("Edit", "Edit", new { productId = Model.ProductId, atrributeKeyId = Model.AttributeKeyId }) | 41 | @Html.ActionLink("Back to List", "Index") 42 |

43 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Views/AttributeValues/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "Index"; 5 | } 6 | 7 |

Index

8 | 9 |

10 | @Html.ActionLink("Create New", "Create") 11 |

12 | 13 | 14 | 17 | 20 | 23 | 24 | 25 | 26 | @foreach (var item in Model) { 27 | 28 | 31 | 34 | 37 | 42 | 43 | } 44 | 45 |
15 | @Html.DisplayNameFor(model => model.ProductId) 16 | 18 | @Html.DisplayNameFor(model => model.AttributeKeyId) 19 | 21 | @Html.DisplayNameFor(model => model.Value) 22 |
29 | @Html.DisplayFor(modelItem => item.Product.Name) 30 | 32 | @Html.DisplayFor(modelItem => item.AttributeKey.Name) 33 | 35 | @Html.DisplayFor(modelItem => item.Value) 36 | 38 | @Html.ActionLink("Edit", "Edit", new { productId = item.ProductId, attributeKeyId = item.AttributeKeyId }) | 39 | @Html.ActionLink("Details", "Details", new { productId = item.ProductId, attributeKeyId = item.AttributeKeyId }) | 40 | @Html.ActionLink("Delete", "Delete", new { productId = item.ProductId, attributeKeyId = item.AttributeKeyId }) 41 |
46 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Views/Categories/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model Skroutz.Models.Category 2 | 3 | @{ 4 | ViewBag.Title = "Delete"; 5 | } 6 | 7 |

Delete

8 | 9 |

Are you sure you want to delete this?

10 |
11 |

Category

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.Name) 16 |
17 |
18 | @Html.DisplayFor(model => model.Name) 19 |
20 | 21 |
22 | @Html.DisplayNameFor(model => model.ParentId) 23 |
24 |
25 | @Html.DisplayFor(model => model.Parent.Name) 26 |
27 |
28 | 29 | @using (Html.BeginForm()) { 30 | @Html.AntiForgeryToken() 31 | 32 |
33 | | 34 | @Html.ActionLink("Back to List", "Index") 35 |
36 | } 37 |
38 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Views/Categories/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model Skroutz.Models.Category 2 | 3 | @{ 4 | ViewBag.Title = "Details"; 5 | } 6 | 7 |

Details

8 | 9 |
10 |

Category

11 |
12 |
13 |
14 | @Html.DisplayNameFor(model => model.Name) 15 |
16 |
17 | @Html.DisplayFor(model => model.Name) 18 |
19 | 20 |
21 | @Html.DisplayNameFor(model => model.ParentId) 22 |
23 |
24 | @Html.DisplayFor(model => model.Parent.Name) 25 |
26 |
27 |
28 |

29 | @Html.ActionLink("Edit", "Edit", new { id = Model.Id }) | 30 | @Html.ActionLink("Back to List", "Index") 31 |

32 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Views/Categories/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "Index"; 5 | } 6 | 7 |

Index

8 | 9 |

10 | @Html.ActionLink("Create New", "Create") 11 |

12 | 13 | 14 | 17 | 20 | 21 | 22 | 23 | @foreach (var item in Model) { 24 | 25 | 28 | 31 | 36 | 37 | } 38 | 39 |
15 | @Html.DisplayNameFor(model => model.Name) 16 | 18 | @Html.DisplayNameFor(model => model.ParentId) 19 |
26 | @Html.DisplayFor(modelItem => item.Name) 27 | 29 | @Html.DisplayFor(modelItem => item.Parent.Name) 30 | 32 | @Html.ActionLink("Edit", "Edit", new { id=item.Id }) | 33 | @Html.ActionLink("Details", "Details", new { id=item.Id }) | 34 | @Html.ActionLink("Delete", "Delete", new { id=item.Id }) 35 |
40 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Index"; 3 | } 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Views/Inventories/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model Skroutz.Models.Inventory 2 | 3 | @{ 4 | ViewBag.Title = "Delete"; 5 | } 6 | 7 |

Delete

8 | 9 |

Are you sure you want to delete this?

10 |
11 |

Inventory

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.ProductId) 16 |
17 | 18 |
19 | @Html.DisplayFor(model => model.Product.Name) 20 |
21 | 22 |
23 | @Html.DisplayNameFor(model => model.StoreId) 24 |
25 | 26 |
27 | @Html.DisplayFor(model => model.Store.Name) 28 |
29 | 30 |
31 | @Html.DisplayNameFor(model => model.Price) 32 |
33 | 34 |
35 | @Html.DisplayFor(model => model.Price) 36 |
37 | 38 |
39 | 40 | @using (Html.BeginForm()) { 41 | @Html.AntiForgeryToken() 42 | 43 |
44 | | 45 | @Html.ActionLink("Back to List", "Index") 46 |
47 | } 48 |
49 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Views/Inventories/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model Skroutz.Models.Inventory 2 | 3 | @{ 4 | ViewBag.Title = "Details"; 5 | } 6 | 7 |

Details

8 | 9 |
10 |

Inventory

11 |
12 |
13 |
14 | @Html.DisplayNameFor(model => model.ProductId) 15 |
16 | 17 |
18 | @Html.DisplayFor(model => model.Product.Name) 19 |
20 | 21 |
22 | @Html.DisplayNameFor(model => model.StoreId) 23 |
24 | 25 |
26 | @Html.DisplayFor(model => model.Store.Name) 27 |
28 | 29 |
30 | @Html.DisplayNameFor(model => model.Price) 31 |
32 | 33 |
34 | @Html.DisplayFor(model => model.Price) 35 |
36 | 37 |
38 |
39 |

40 | @Html.ActionLink("Edit", "Edit", new { productId = Model.ProductId, storeId = Model.StoreId }) | 41 | @Html.ActionLink("Back to List", "Index") 42 |

43 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Views/Inventories/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "Index"; 5 | } 6 | 7 |

Index

8 | 9 |

10 | @Html.ActionLink("Create New", "Create") 11 |

12 | 13 | 14 | 17 | 20 | 23 | 24 | 25 | 26 | @foreach (var item in Model) { 27 | 28 | 31 | 34 | 37 | 42 | 43 | } 44 | 45 |
15 | @Html.DisplayNameFor(model => model.ProductId) 16 | 18 | @Html.DisplayNameFor(model => model.StoreId) 19 | 21 | @Html.DisplayNameFor(model => model.Price) 22 |
29 | @Html.DisplayFor(modelItem => item.Product.Name) 30 | 32 | @Html.DisplayFor(modelItem => item.Store.Name) 33 | 35 | @Html.DisplayFor(modelItem => item.Price) 36 | 38 | @Html.ActionLink("Edit", "Edit", new { productId = item.ProductId, storeId = item.StoreId }) | 39 | @Html.ActionLink("Details", "Details", new { productId = item.ProductId, storeId = item.StoreId }) | 40 | @Html.ActionLink("Delete", "Delete", new { productId = item.ProductId, storeId = item.StoreId }) 41 |
46 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Views/Products/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model Skroutz.Models.Product 2 | 3 | @{ 4 | ViewBag.Title = "Delete"; 5 | } 6 | 7 |

Delete

8 | 9 |

Are you sure you want to delete this?

10 |
11 |

Product

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.Name) 16 |
17 |
18 | @Html.DisplayFor(model => model.Name) 19 |
20 |
21 | @Html.DisplayNameFor(model => model.Category.Name) 22 |
23 | 24 |
25 | @Html.DisplayFor(model => model.Category.Name) 26 |
27 |
28 | 29 | @using (Html.BeginForm()) { 30 | @Html.AntiForgeryToken() 31 | 32 |
33 | | 34 | @Html.ActionLink("Back to List", "Index") 35 |
36 | } 37 |
38 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Views/Products/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "Index"; 5 | } 6 | 7 |

Index

8 | 9 |

10 | @Html.ActionLink("Create New", "Create") 11 |

12 | 13 | 14 | 17 | 20 | 21 | 22 | 23 | @foreach (var item in Model) { 24 | 25 | 28 | 31 | 36 | 37 | } 38 | 39 |
15 | @Html.DisplayNameFor(model => model.Name) 16 | 18 | @Html.DisplayNameFor(model => model.Category) 19 |
26 | @Html.DisplayFor(modelItem => item.Name) 27 | 29 | @Html.DisplayFor(modelItem => item.Category.Name) 30 | 32 | @Html.ActionLink("Edit", "Edit", new { id=item.Id }) | 33 | @Html.ActionLink("Details", "Details", new { id=item.Id }) | 34 | @Html.ActionLink("Delete", "Delete", new { id=item.Id }) 35 |
40 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Views/Stores/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model Skroutz.Models.Store 2 | 3 | @{ 4 | ViewBag.Title = "Delete"; 5 | } 6 | 7 |

Delete

8 | 9 |

Are you sure you want to delete this?

10 |
11 |

Store

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.Name) 16 |
17 | 18 |
19 | @Html.DisplayFor(model => model.Name) 20 |
21 | 22 |
23 | @Html.DisplayNameFor(model => model.Web) 24 |
25 | 26 |
27 | @Html.DisplayFor(model => model.Web) 28 |
29 | 30 |
31 | @Html.DisplayNameFor(model => model.Headquarters) 32 |
33 | 34 |
35 | @Html.DisplayFor(model => model.Headquarters) 36 |
37 | 38 |
39 | @Html.DisplayNameFor(model => model.Phone) 40 |
41 | 42 |
43 | @Html.DisplayFor(model => model.Phone) 44 |
45 | 46 |
47 | 48 | @using (Html.BeginForm()) { 49 | @Html.AntiForgeryToken() 50 | 51 |
52 | | 53 | @Html.ActionLink("Back to List", "Index") 54 |
55 | } 56 |
57 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Views/Stores/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model Skroutz.Models.Store 2 | 3 | @{ 4 | ViewBag.Title = "Details"; 5 | } 6 | 7 |

Details

8 | 9 |
10 |

Store

11 |
12 |
13 |
14 | @Html.DisplayNameFor(model => model.Name) 15 |
16 | 17 |
18 | @Html.DisplayFor(model => model.Name) 19 |
20 | 21 |
22 | @Html.DisplayNameFor(model => model.Web) 23 |
24 | 25 |
26 | @Html.DisplayFor(model => model.Web) 27 |
28 | 29 |
30 | @Html.DisplayNameFor(model => model.Headquarters) 31 |
32 | 33 |
34 | @Html.DisplayFor(model => model.Headquarters) 35 |
36 | 37 |
38 | @Html.DisplayNameFor(model => model.Phone) 39 |
40 | 41 |
42 | @Html.DisplayFor(model => model.Phone) 43 |
44 | 45 |
46 |
47 |

48 | @Html.ActionLink("Edit", "Edit", new { id = Model.Id }) | 49 | @Html.ActionLink("Back to List", "Index") 50 |

51 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Views/Stores/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "Index"; 5 | } 6 | 7 |

Index

8 | 9 |

10 | @Html.ActionLink("Create New", "Create") 11 |

12 | 13 | 14 | 17 | 20 | 23 | 26 | 27 | 28 | 29 | @foreach (var item in Model) { 30 | 31 | 34 | 37 | 40 | 43 | 48 | 49 | } 50 | 51 |
15 | @Html.DisplayNameFor(model => model.Name) 16 | 18 | @Html.DisplayNameFor(model => model.Web) 19 | 21 | @Html.DisplayNameFor(model => model.Headquarters) 22 | 24 | @Html.DisplayNameFor(model => model.Phone) 25 |
32 | @Html.DisplayFor(modelItem => item.Name) 33 | 35 | @Html.DisplayFor(modelItem => item.Web) 36 | 38 | @Html.DisplayFor(modelItem => item.Headquarters) 39 | 41 | @Html.DisplayFor(modelItem => item.Phone) 42 | 44 | @Html.ActionLink("Edit", "Edit", new { id=item.Id }) | 45 | @Html.ActionLink("Details", "Details", new { id=item.Id }) | 46 | @Html.ActionLink("Delete", "Delete", new { id=item.Id }) 47 |
52 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/Project Skroutz/Skroutz/Skroutz/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/Project Skroutz/Skroutz/Skroutz/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/Project Skroutz/Skroutz/Skroutz/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Project Skroutz/Skroutz/Skroutz/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AFDEmp C# Exercises 2 | This repository provides the C# / ASP.NET Exercises and Solutions given to students of the first [Alliance for Digital Employability Coding Bootcamp](http://www.afdemp.org/) held in Athens, Greece. 3 | -------------------------------------------------------------------------------- /SQL-Entity/Solutions/ExerciseHaving.sql: -------------------------------------------------------------------------------- 1 | --1. Create a report that shows the order ids and the associated employee names for orders that shipped after the required date (37 rows) 2 | SELECT e.FirstName, e.LastName, o.OrderID 3 | FROM Employees e JOIN Orders o ON 4 | (e.EmployeeID = o.EmployeeID) 5 | WHERE o.RequiredDate < o.ShippedDate 6 | ORDER BY e.LastName, e.FirstName; 7 | 8 | -- 2. Create a report that shows the total quantity of products (from the Order_Details table) ordered. Only show records for products for which the quantity ordered is fewer than 200 (5 rows) 9 | SELECT p.ProductName, SUM(od.Quantity) AS TotalUnits 10 | FROM [Order Details] od JOIN Products p ON 11 | (p.ProductID = od.ProductID) 12 | GROUP BY p.ProductName 13 | HAVING SUM(Quantity) < 200; 14 | 15 | -- 3. Create a report that shows the total number of orders by Customer since December 31, 1996. The report should only return rows for which the total number of orders is greater than 15 (5 rows) 16 | SELECT c.CompanyName, COUNT(o.OrderID) AS NumOrders 17 | FROM Customers c JOIN Orders o ON 18 | (c.CustomerID = o.CustomerID) 19 | WHERE OrderDate > '1996-12-31' 20 | GROUP BY c.CompanyName 21 | HAVING COUNT(o.OrderID) > 15 22 | ORDER BY NumOrders DESC; 23 | -------------------------------------------------------------------------------- /SQL-Entity/Solutions/ExerciseSimpleQueries.sql: -------------------------------------------------------------------------------- 1 | /*1. Get all columns from the tables Customers, Orders and Suppliers */ 2 | select * from customers; 3 | select * from orders; 4 | select * from suppliers; 5 | 6 | /* 2. Get all Customers alphabetically, by Country and name */ 7 | select * from customers order by Country, ContactName; 8 | 9 | /* 3. Get all Orders by date */ 10 | select * from orders order by OrderDate; 11 | 12 | /* 4. Get the count of all Orders made during 1997 */ 13 | select count(*) from orders where OrderDate between '1997-01-01' and '1997-12-31 23:59:59' 14 | 15 | /* 5. Get the names of all the contact persons where the person is a manager, alphabetically */ 16 | select contactname from Customers where ContactTitle like '%Manager%' order by ContactName; 17 | 18 | /* 6. Get all orders placed on the 19th of May, 1997 */ 19 | select * from orders where OrderDate = '1997-05-19'; -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo1/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo10/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo10/Dice.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Demo10 7 | { 8 | public class Dice 9 | { 10 | public Random r { get; set; } 11 | public string Id { get; set; } 12 | public int Result { get; set; } 13 | public int Choice { get; set; } 14 | public bool Success { get; set; } 15 | 16 | public Dice() 17 | { 18 | r = new Random(); 19 | } 20 | public void Throw(int Number) 21 | { 22 | if (Number<0) 23 | throw new ArgumentException("SDFDSF SDF SD FSF D"); 24 | 25 | Choice = Number; 26 | Result = r.Next(1, 7); 27 | if (Number == Result) 28 | Success = true; 29 | else 30 | Success = false; 31 | } 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo10/MemoryLeak.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Demo10 9 | { 10 | public static class MemoryLeak 11 | { 12 | public static WeakReference Reference { get; private set; } 13 | 14 | public static void CheckObject(object ObjToCheck) 15 | { 16 | MemoryLeak.Reference = new WeakReference(ObjToCheck,false); 17 | } 18 | 19 | public static void IsItDead() 20 | { 21 | GC.Collect(); 22 | GC.WaitForPendingFinalizers(); 23 | GC.Collect(); 24 | 25 | if (MemoryLeak.Reference.IsAlive) 26 | Console.WriteLine("Still here "+GC.GetGeneration(Reference).ToString()+" "+GC.GetTotalMemory(false).ToString()); //Debug.WriteLine("Still here"); 27 | else 28 | Console.WriteLine("I 'm dead"); //Debug.WriteLine("I 'm dead"); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo11/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo2/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo3/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo3/Program.cs: -------------------------------------------------------------------------------- 1 | using Dicer; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace Demo3 8 | { 9 | /// 10 | /// Απλό demo προγράμματος με κλάση όπου επιλέγετε κάποιον αριθμό, ρίχνετε ένα ζάρι και 11 | /// βλέπετε αν τον βρήκατε και μετά κάνετε ακριβώς το ίδιο για ακόμη μία φορά. 12 | /// 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | Dice dice = new Dice(); 18 | for (int i = 0; i < 2; i++) 19 | { 20 | Console.Write("Give me a number between 1 and 6:"); 21 | string NumberStr = Console.ReadLine(); 22 | int Number = Int32.Parse(NumberStr); 23 | 24 | dice.Throw(Number); 25 | if (dice.Success) 26 | Console.WriteLine("You win"); 27 | else 28 | { 29 | Console.WriteLine($"You loose. The number was {dice.Choice.ToString()}"); 30 | } 31 | } 32 | Console.ReadKey(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo4/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo4/Dice.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Demo4 7 | { 8 | public class Dice 9 | { 10 | public static Random RandomGenerator { get; set; } 11 | public string Id { get; set; } 12 | public int Result { get; set; } 13 | public int Choice { get; set; } 14 | public bool Success { get; set; } 15 | 16 | public Dice() 17 | { 18 | RandomGenerator = new Random(); 19 | } 20 | public void Throw() 21 | { 22 | Result = RandomGenerator.Next(1, 7); 23 | } 24 | 25 | public void Check(int Number) 26 | { 27 | if (Number == Result) 28 | Success = true; 29 | else 30 | Success = false; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo4/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Demo4 7 | { 8 | public class Program 9 | { 10 | public static void Main(string[] args) 11 | { 12 | int n1=Int32.Parse(Console.ReadLine()); 13 | int n2 = Int32.Parse(Console.ReadLine()); 14 | 15 | Dice d = new Dice(); 16 | d.Choice = 5; 17 | ChangeDice(d); 18 | Console.WriteLine(d.Choice); 19 | Console.ReadKey(); 20 | } 21 | 22 | public static void ChangeDice(Dice a) 23 | { 24 | a = new Dice(); 25 | a.Choice = 6; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo5/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo5/Dice.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Demo5 7 | { 8 | public class Dice 9 | { 10 | public Random RandomGenerator { get; set; } 11 | public T Id { get; set; } 12 | public int Result { get; set; } 13 | public int Choice { get; set; } 14 | public bool Success { get; set; } 15 | 16 | public Dice() 17 | { 18 | RandomGenerator = new Random(); 19 | } 20 | public void Throw() 21 | { 22 | Result = RandomGenerator.Next(1, 7); 23 | } 24 | 25 | public void Check(int Number) 26 | { 27 | if (Number == Result) 28 | Success = true; 29 | else 30 | Success = false; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo6/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo7/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo8/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo9/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo9/Commander.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 Demo9 8 | { 9 | public interface ICommand 10 | { 11 | void Execute(); 12 | void Undo(); 13 | } 14 | 15 | public class SayHello : ICommand 16 | { 17 | public void Execute() 18 | { 19 | Console.WriteLine("Hello"); 20 | } 21 | 22 | public void Undo() 23 | { 24 | Console.WriteLine("No hello"); 25 | } 26 | } 27 | 28 | 29 | // Command pattern implementation 30 | public class Commander 31 | { 32 | public List Commands { get; set; } 33 | 34 | public Commander() 35 | { 36 | Commands = new List(); 37 | } 38 | 39 | public void AddCommand(ICommand c) 40 | { 41 | Commands.Add(c); 42 | } 43 | 44 | public void Execute() 45 | { 46 | foreach (ICommand c in Commands) 47 | c.Execute(); 48 | } 49 | 50 | public void Undo() 51 | { 52 | foreach (ICommand c in Commands) 53 | c.Undo(); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo9/IDice.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 Demo9 8 | { 9 | public interface IDice 10 | { 11 | void SetId(string Id); 12 | void Throw(int Number); 13 | bool GetResult(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demo9/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | //Interfaces and Abstract classes 8 | namespace Demo9 9 | { 10 | 11 | //Abstract classes and interfaces 12 | class Program 13 | { 14 | static void Main(string[] args) 15 | { 16 | Commander c= new Commander(); 17 | c.AddCommand(new Dice()); 18 | c.AddCommand(new SayHello()); 19 | c.Execute(); 20 | c.Undo(); 21 | 22 | IDice Dice1 = new Dice(); 23 | DiceAbstract Dice2 = new DiceFromAbstract(); 24 | 25 | using (Dice d=new Dice()) 26 | { 27 | 28 | } 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demos/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/Demos/Program.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 Demos 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/SolDemo3_1/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/SolDemo3_1/Dice.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace SolDemo3_1 7 | { 8 | public class Dice 9 | { 10 | private static Random _r { get; set; } 11 | public string Id { get; set; } 12 | private int _result { get; set; } 13 | private int _choice { get; set; } 14 | public bool _success { get; set; } 15 | 16 | public Dice() 17 | { 18 | if (Dice._r==null) 19 | Dice._r = new Random(); 20 | } 21 | public void Throw(int Number) 22 | { 23 | _choice = Number; 24 | _result = _r.Next(1, 7); 25 | if (Number == _result) 26 | _success = true; 27 | else 28 | _success = false; 29 | } 30 | public string GetResultMessage() 31 | { 32 | if (_success) 33 | return "You win"; 34 | else 35 | return $"You loose. The number was {_choice.ToString()}"; 36 | } 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/SolDemo3_1/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace SolDemo3_1 7 | { 8 | public class Program 9 | { 10 | public static void Main(string[] args) 11 | { 12 | Dice dice = new Dice(); 13 | for (int i = 0; i < 2; i++) 14 | { 15 | Console.Write("Give me a number between 1 and 6:"); 16 | string NumberStr = Console.ReadLine(); 17 | int Number = Int32.Parse(NumberStr); 18 | 19 | dice.Throw(Number); 20 | Console.WriteLine(dice.GetResultMessage()); 21 | } 22 | Console.ReadKey(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/SolDemo3_2/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/SolDemo3_2/Dice.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace SolDemo3_2 7 | { 8 | public class Dice 9 | { 10 | public bool Cheat { get; set; } 11 | public int MinValue { get; set; } 12 | public int MaxValue { get; set; } 13 | 14 | public Random r { get; set; } 15 | public string Id { get; set; } 16 | public int Result { get; set; } 17 | public int Choice { get; set; } 18 | public bool Success { get; set; } 19 | 20 | public Dice(int minValue,int maxValue) 21 | { 22 | r = new Random(); 23 | MinValue = minValue; 24 | MaxValue = maxValue; 25 | } 26 | public void Throw(int Number) 27 | { 28 | Choice = Number; 29 | if (Cheat==true) 30 | Result = r.Next(MinValue, MaxValue+2); 31 | else 32 | Result = r.Next(MinValue, MaxValue+1); 33 | 34 | if (Number == Result) 35 | Success = true; 36 | else 37 | { 38 | if ((Result == (MaxValue + 1)) && Cheat) 39 | Result = Choice == MaxValue ? 1 : Choice + 1; 40 | 41 | Success = false; 42 | } 43 | } 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/SolDemo3_2/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace SolDemo3_2 7 | { 8 | public class Program 9 | { 10 | public static void Main(string[] args) 11 | { 12 | Dice dice = new Dice(1,20); 13 | dice.Cheat = true; 14 | for (int i = 0; i < 2; i++) 15 | { 16 | Console.Write($"Give me a number between {dice.MinValue} and {dice.MaxValue}:"); 17 | string NumberStr = Console.ReadLine(); 18 | int Number = Int32.Parse(NumberStr); 19 | 20 | dice.Throw(Number); 21 | if (dice.Success) 22 | Console.WriteLine("You win"); 23 | else 24 | { 25 | Console.WriteLine($"You loose. The number was {dice.Choice.ToString()}"); 26 | } 27 | } 28 | Console.ReadKey(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/SolDemo3_3/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/SolDemo3_3/Dice.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace SolDemo3_3 7 | { 8 | public class Dice 9 | { 10 | public bool Cheat { get; set; } 11 | public int MinValue { get; set; } 12 | public int MaxValue { get; set; } 13 | 14 | public Random r { get; set; } 15 | public string Id { get; set; } 16 | public int Result { get; set; } 17 | public int Choice { get; set; } 18 | public bool Success { get; set; } 19 | 20 | public Dice(int minValue,int maxValue) 21 | { 22 | r = new Random(); 23 | MinValue = minValue; 24 | MaxValue = maxValue; 25 | } 26 | public void Throw(int Number) 27 | { 28 | Choice = Number; 29 | if (Cheat==true) 30 | Result = r.Next(MinValue, MaxValue+2); 31 | else 32 | Result = r.Next(MinValue, MaxValue+1); 33 | 34 | if (Number == Result) 35 | Success = true; 36 | else 37 | { 38 | if ((Result == (MaxValue + 1)) && Cheat) 39 | Result = Choice == MaxValue ? 1 : Choice + 1; 40 | 41 | Success = false; 42 | } 43 | } 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/SolDemo3_3/DoubleDice.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace SolDemo3_3 7 | { 8 | public class DoubleDice 9 | { 10 | public Dice Dice1 { get; set; } 11 | public Dice Dice2 { get; set; } 12 | 13 | public DoubleDice(Dice dice1,Dice dice2) 14 | { 15 | Dice1 = dice1; 16 | Dice2 = dice2; 17 | } 18 | 19 | public void Throw() 20 | { 21 | Dice1.Throw(2); 22 | Dice2.Throw(3); 23 | 24 | } 25 | public String GetResults() 26 | { 27 | return Dice1.Result.ToString() + " " + Dice2.Result.ToString(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/SolDemo3_3/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace SolDemo3_3 7 | { 8 | public class Program 9 | { 10 | public static void Main(string[] args) 11 | { 12 | DoubleDice dd = new DoubleDice(new Dice(1, 6), new Dice(1, 6)); 13 | while (Console.ReadKey().KeyChar != 'q') 14 | { 15 | dd.Throw(); 16 | Console.WriteLine(dd.GetResults()); 17 | } 18 | 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/SolDemo3_4/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/SolDemo3_4/FortuneTeller.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace SolDemo3_4 7 | { 8 | public class FortuneTeller 9 | { 10 | private Random r; 11 | 12 | private T item1; 13 | private T item2; 14 | private T item3; 15 | private T item4; 16 | 17 | public FortuneTeller() 18 | { 19 | r = new Random(); 20 | } 21 | 22 | public void SetItems(T item1,T item2,T item3,T item4) 23 | { 24 | this.item1 = item1; 25 | this.item2 = item2; 26 | this.item3 = item3; 27 | this.item4 = item4; 28 | 29 | this.r = new Random(); 30 | } 31 | 32 | public T GetAnswer() 33 | { 34 | int choice = r.Next(1, 5); 35 | switch (choice) 36 | { 37 | case 1: return item1; 38 | case 2: return item2; 39 | case 3: return item3; 40 | case 4: return item4; 41 | } 42 | 43 | return item1; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Demos/SolDemo3_4/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace SolDemo3_4 7 | { 8 | public class Program 9 | { 10 | public static void Main(string[] args) 11 | { 12 | FortuneTeller FT = new FortuneTeller(); 13 | FT.SetItems("Yes you will", "No", "Maybe", "I am sure if you try"); 14 | 15 | Console.WriteLine("Ask me whatever you want:"); 16 | Console.ReadLine(); 17 | Console.WriteLine(FT.GetAnswer()); 18 | 19 | FortuneTeller FT2 = new FortuneTeller(); 20 | FT2.SetItems(0,1,2,3); 21 | 22 | Console.WriteLine("Ask me a question that starts with how many"); 23 | Console.ReadLine(); 24 | Console.WriteLine(FT2.GetAnswer()); 25 | 26 | Console.ReadKey(); 27 | 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /__Demos/CSharp Demos/Exercises.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fedonman/afdemp-coding-bootcamp-csharp/3383ede4fa2053db90058879c800bd6b74510405/__Demos/CSharp Demos/Exercises.txt -------------------------------------------------------------------------------- /__Demos/DemoADONET/adonet.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "adonet", "adonet\adonet.csproj", "{EB3E7CF7-0C74-4FD5-81D5-EEFC4B401D31}" 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 | {EB3E7CF7-0C74-4FD5-81D5-EEFC4B401D31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {EB3E7CF7-0C74-4FD5-81D5-EEFC4B401D31}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {EB3E7CF7-0C74-4FD5-81D5-EEFC4B401D31}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {EB3E7CF7-0C74-4FD5-81D5-EEFC4B401D31}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /__Demos/DemoADONET/adonet/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /__Demos/RazorDemo/App_Code/Model/Categories.cs: -------------------------------------------------------------------------------- 1 | namespace Model 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel.DataAnnotations; 6 | using System.ComponentModel.DataAnnotations.Schema; 7 | using System.Data.Entity.Spatial; 8 | 9 | public partial class Categories 10 | { 11 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] 12 | public Categories() 13 | { 14 | Products = new HashSet(); 15 | } 16 | 17 | [Key] 18 | public int CategoryID { get; set; } 19 | 20 | [Required] 21 | [StringLength(15)] 22 | public string CategoryName { get; set; } 23 | 24 | [Column(TypeName = "ntext")] 25 | public string Description { get; set; } 26 | 27 | [Column(TypeName = "image")] 28 | public byte[] Picture { get; set; } 29 | 30 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] 31 | public virtual ICollection Products { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /__Demos/RazorDemo/App_Code/Model/CustomerDemographics.cs: -------------------------------------------------------------------------------- 1 | namespace Model 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel.DataAnnotations; 6 | using System.ComponentModel.DataAnnotations.Schema; 7 | using System.Data.Entity.Spatial; 8 | 9 | public partial class CustomerDemographics 10 | { 11 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] 12 | public CustomerDemographics() 13 | { 14 | Customers = new HashSet(); 15 | } 16 | 17 | [Key] 18 | [StringLength(10)] 19 | public string CustomerTypeID { get; set; } 20 | 21 | [Column(TypeName = "ntext")] 22 | public string CustomerDesc { get; set; } 23 | 24 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] 25 | public virtual ICollection Customers { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /__Demos/RazorDemo/App_Code/Model/Order_Details.cs: -------------------------------------------------------------------------------- 1 | namespace Model 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel.DataAnnotations; 6 | using System.ComponentModel.DataAnnotations.Schema; 7 | using System.Data.Entity.Spatial; 8 | 9 | [Table("Order Details")] 10 | public partial class Order_Details 11 | { 12 | [Key] 13 | [Column(Order = 0)] 14 | [DatabaseGenerated(DatabaseGeneratedOption.None)] 15 | public int OrderID { get; set; } 16 | 17 | [Key] 18 | [Column(Order = 1)] 19 | [DatabaseGenerated(DatabaseGeneratedOption.None)] 20 | public int ProductID { get; set; } 21 | 22 | [Column(TypeName = "money")] 23 | public decimal UnitPrice { get; set; } 24 | 25 | public short Quantity { get; set; } 26 | 27 | public float Discount { get; set; } 28 | 29 | public virtual Orders Orders { get; set; } 30 | 31 | public virtual Products Products { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /__Demos/RazorDemo/App_Code/Model/Region.cs: -------------------------------------------------------------------------------- 1 | namespace Model 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel.DataAnnotations; 6 | using System.ComponentModel.DataAnnotations.Schema; 7 | using System.Data.Entity.Spatial; 8 | 9 | [Table("Region")] 10 | public partial class Region 11 | { 12 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] 13 | public Region() 14 | { 15 | Territories = new HashSet(); 16 | } 17 | 18 | [DatabaseGenerated(DatabaseGeneratedOption.None)] 19 | public int RegionID { get; set; } 20 | 21 | [Required] 22 | [StringLength(50)] 23 | public string RegionDescription { get; set; } 24 | 25 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] 26 | public virtual ICollection Territories { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /__Demos/RazorDemo/App_Code/Model/Shippers.cs: -------------------------------------------------------------------------------- 1 | namespace Model 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel.DataAnnotations; 6 | using System.ComponentModel.DataAnnotations.Schema; 7 | using System.Data.Entity.Spatial; 8 | 9 | public partial class Shippers 10 | { 11 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] 12 | public Shippers() 13 | { 14 | Orders = new HashSet(); 15 | } 16 | 17 | [Key] 18 | public int ShipperID { get; set; } 19 | 20 | [Required] 21 | [StringLength(40)] 22 | public string CompanyName { get; set; } 23 | 24 | [StringLength(24)] 25 | public string Phone { get; set; } 26 | 27 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] 28 | public virtual ICollection Orders { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /__Demos/RazorDemo/App_Code/Model/Territories.cs: -------------------------------------------------------------------------------- 1 | namespace Model 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel.DataAnnotations; 6 | using System.ComponentModel.DataAnnotations.Schema; 7 | using System.Data.Entity.Spatial; 8 | 9 | public partial class Territories 10 | { 11 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] 12 | public Territories() 13 | { 14 | Employees = new HashSet(); 15 | } 16 | 17 | [Key] 18 | [StringLength(20)] 19 | public string TerritoryID { get; set; } 20 | 21 | [Required] 22 | [StringLength(50)] 23 | public string TerritoryDescription { get; set; } 24 | 25 | public int RegionID { get; set; } 26 | 27 | public virtual Region Region { get; set; } 28 | 29 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] 30 | public virtual ICollection Employees { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /__Demos/RazorDemo/Content1.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Shared/_Layout1.cshtml"; 3 | } 4 | 5 |

Structured Content

6 |

7 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, 8 | sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 9 | Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris 10 | nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in 11 | reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla 12 | pariatur. Excepteur sint occaecat cupidatat non proident, sunt in 13 | culpa qui officia deserunt mollit anim id est laborum. 14 |

-------------------------------------------------------------------------------- /__Demos/RazorDemo/Content2.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Shared/_Layout2.cshtml"; 3 | } 4 | 5 | @section header { 6 | 9 | } 10 | 11 | @section list1 { 12 |
    13 |
  • Lorem
  • 14 |
  • Ipsum
  • 15 |
  • Dolor
  • 16 |
  • Consecte
  • 17 |
  • Eiusmod
  • 18 |
  • Tempor
  • 19 |
  • Incididu
  • 20 |
21 | } 22 | 23 |

Multisection Content

24 |

25 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, 26 | sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 27 | Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris 28 | nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in 29 | reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla 30 | pariatur. Excepteur sint occaecat cupidatat non proident, sunt in 31 | culpa qui officia deserunt mollit anim id est laborum. 32 |

-------------------------------------------------------------------------------- /__Demos/RazorDemo/Content3.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Shared/_Layout3.cshtml"; 3 | 4 | PageData["Title"] = "Passing Data"; 5 | PageData["ShowList"] = true; 6 | 7 | if (IsPost) 8 | { 9 | if (Request.Form["list"] == "off") 10 | { 11 | PageData["ShowList"] = false; 12 | } 13 | } 14 | 15 | } 16 | 17 | @section header { 18 | 21 | } 22 | 23 |

@PageData["Title"]

24 |

25 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, 26 | sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 27 | Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris 28 | nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in 29 | reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla 30 | pariatur. Excepteur sint occaecat cupidatat non proident, sunt in 31 | culpa qui officia deserunt mollit anim id est laborum. 32 |

33 | 34 | @if (PageData["ShowList"] == true) 35 | { 36 |
37 | 38 | 39 |
40 | } 41 | else 42 | { 43 |
44 | 45 | 46 |
47 | } -------------------------------------------------------------------------------- /__Demos/RazorDemo/Employees.cshtml: -------------------------------------------------------------------------------- 1 | @using Model; 2 | @{ 3 | Layout = "~/Shared/_Database.cshtml"; 4 | Page.Title = "Employees"; 5 | 6 | var db = new Model(); 7 | WebGrid grid; 8 | 9 | if (@UrlData.Count == 1 && @UrlData[0].IsInt()) 10 | { 11 | int id = @UrlData[0].AsInt(); 12 | var employees = db.Employees.Where(x => x.EmployeeID == id); 13 | grid = new WebGrid(employees); 14 | } 15 | else 16 | { 17 | var employees = db.Employees; 18 | grid = new WebGrid(employees); 19 | } 20 | //var employees = db.Employees; 21 | //var grid = new WebGrid(employees); 22 | } 23 |
24 | @grid.GetHtml() 25 |
-------------------------------------------------------------------------------- /__Demos/RazorDemo/Index.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Main Page 5 | 6 | 7 | 8 | @RenderPage("~/Shared/_Header.cshtml") 9 | 10 |

Index Page Content

11 |

This is the content of the main page.

12 | 13 | @RenderPage("~/Shared/_Footer.cshtml") 14 | 15 | 16 | -------------------------------------------------------------------------------- /__Demos/RazorDemo/Shared/_Database.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | @Page.Title 5 | 6 | 7 | 8 |

@Page.Title

9 |
10 | @RenderBody() 11 |
12 | 15 | 16 | -------------------------------------------------------------------------------- /__Demos/RazorDemo/Shared/_Footer.cshtml: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /__Demos/RazorDemo/Shared/_Header.cshtml: -------------------------------------------------------------------------------- 1 | 
This is header text.
-------------------------------------------------------------------------------- /__Demos/RazorDemo/Shared/_Header1.cshtml: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /__Demos/RazorDemo/Shared/_Layout1.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Structured Content 5 | 6 | 7 | 8 | @RenderPage("~/Shared/_Header2.cshtml") 9 |
10 | @RenderBody() 11 |
12 | 15 | 16 | -------------------------------------------------------------------------------- /__Demos/RazorDemo/Shared/_Layout2.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Multisection Content 5 | 6 | 7 | 8 | 11 |
12 | @RenderSection("list") 13 |
14 |
15 | @RenderBody() 16 |
17 | 20 | 21 | -------------------------------------------------------------------------------- /__Demos/RazorDemo/Shared/_Layout3.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | @PageData["Title"] 5 | 6 | 7 | 8 | 11 | @if (PageData["ShowList"] == true) 12 | { 13 |
14 | @RenderPage("~/Shared/_List.cshtml") 15 |
16 | } 17 |
18 | @RenderBody() 19 |
20 | 23 | 24 | -------------------------------------------------------------------------------- /__Demos/RazorDemo/Shared/_List.cshtml: -------------------------------------------------------------------------------- 1 | 
    2 |
  • Lorem
  • 3 |
  • Ipsum
  • 4 |
  • Dolor
  • 5 |
  • Consecte
  • 6 |
  • Eiusmod
  • 7 |
  • Tempor
  • 8 |
  • Incididu
  • 9 |
-------------------------------------------------------------------------------- /__Demos/RazorDemo/Styles/Site.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | border-bottom: 3px solid #cc9900; 3 | font: 2.75em/1.75em Georgia, serif; 4 | color: #996600; 5 | } 6 | 7 | ul { 8 | list-style-type: none; 9 | } 10 | 11 | body { 12 | margin: 0; 13 | padding: 1em; 14 | background-color: #ffffff; 15 | font: 75%/1.75em "Trebuchet MS", Verdana, sans-serif; 16 | color: #006600; 17 | } 18 | 19 | #list { 20 | margin: 1em 0 7em -3em; 21 | padding: 1em 0 0 0; 22 | background-color: #ffffff; 23 | color: #996600; 24 | width: 25%; 25 | float: left; 26 | } 27 | 28 | #header, #footer { 29 | margin: 0; 30 | padding: 0; 31 | color: #996600; 32 | } -------------------------------------------------------------------------------- /__Demos/RazorDemo/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | --------------------------------------------------------------------------------