├── .gitattributes ├── .gitignore ├── .vscode └── settings.json ├── Blip.Data ├── App.config ├── Blip.Data.csproj ├── Context │ └── Context.cs ├── Customer │ └── CustomerRepository.cs ├── Geographies │ ├── CountriesRepository.cs │ └── RegionsRepository.cs ├── Metadata │ └── MetadataRepository.cs ├── Migrations │ ├── 201708222251192_InitialMigration.Designer.cs │ ├── 201708222251192_InitialMigration.cs │ ├── 201708222251192_InitialMigration.resx │ ├── 201709222256518_AddAddressEntities.Designer.cs │ ├── 201709222256518_AddAddressEntities.cs │ ├── 201709222256518_AddAddressEntities.resx │ ├── 201709232229196_AddAddressTypes.Designer.cs │ ├── 201709232229196_AddAddressTypes.cs │ ├── 201709232229196_AddAddressTypes.resx │ └── Configuration.cs ├── Properties │ └── AssemblyInfo.cs ├── Web.Debug.config ├── Web.Release.config └── packages.config ├── Blip.Entities ├── App.config ├── Blip.Entities.csproj ├── Customers.ViewModels │ ├── AddressTypeViewModel.cs │ ├── CustomerDisplayViewModel.cs │ ├── CustomerEditViewModel.cs │ ├── EmailAddressListViewModel.cs │ ├── EmailAddressViewModel.cs │ ├── PostalAddressEditViewModel.cs │ ├── PostalAddressListViewModel.cs │ └── PostalAddressViewModel.cs ├── Customers │ ├── Customer.cs │ ├── EmailAddress.cs │ └── PostalAddress.cs ├── Geographies │ ├── Country.cs │ └── Region.cs ├── Metadata │ └── AddressTypes.cs ├── Properties │ └── AssemblyInfo.cs ├── Web.Debug.config ├── Web.Release.config └── packages.config ├── Blip.Web ├── App_Start │ ├── BundleConfig.cs │ ├── FilterConfig.cs │ └── RouteConfig.cs ├── ApplicationInsights.config ├── Blip.Web.csproj ├── Content │ ├── Site.css │ ├── bootstrap-theme.css │ ├── bootstrap-theme.css.map │ ├── bootstrap-theme.min.css │ ├── bootstrap-theme.min.css.map │ ├── bootstrap.css │ ├── bootstrap.css.map │ ├── bootstrap.min.css │ └── bootstrap.min.css.map ├── Controllers │ ├── CustomerController.cs │ └── HomeController.cs ├── Global.asax ├── Global.asax.cs ├── Properties │ └── AssemblyInfo.cs ├── Scripts │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-3.4.1.intellisense.js │ ├── jquery-3.4.1.js │ ├── jquery-3.4.1.min.js │ ├── jquery-3.4.1.min.map │ ├── jquery-3.4.1.slim.js │ ├── jquery-3.4.1.slim.min.js │ ├── jquery-3.4.1.slim.min.map │ ├── jquery.unobtrusive-ajax.js │ ├── jquery.unobtrusive-ajax.min.js │ ├── jquery.validate-vsdoc.js │ ├── jquery.validate.js │ ├── jquery.validate.min.js │ ├── jquery.validate.unobtrusive.js │ ├── jquery.validate.unobtrusive.min.js │ ├── modernizr-2.8.3.js │ ├── respond.js │ ├── respond.matchmedia.addListener.js │ ├── respond.matchmedia.addListener.min.js │ └── respond.min.js ├── Views │ ├── Customer │ │ ├── AddressTypePartial.cshtml │ │ ├── Create.cshtml │ │ ├── CreateEmailAddressPartial.cshtml │ │ ├── CreatePostalAddressPartial.cshtml │ │ ├── Edit.cshtml │ │ ├── EditCustomerPartial.cshtml │ │ └── Index.cshtml │ ├── Home │ │ ├── About.cshtml │ │ ├── Contact.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 │ └── glyphicons-halflings-regular.woff2 └── packages.config ├── BlipAjax.sln ├── CONTRIBUTING.md ├── LICENSE └── Readme.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "localdb" 4 | ] 5 | } -------------------------------------------------------------------------------- /Blip.Data/App.config: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /Blip.Data/Blip.Data.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Debug 8 | AnyCPU 9 | 10 | 11 | 2.0 12 | {C8F46FA8-BEF3-4592-BD57-E5E9ECFCA1B9} 13 | {fae04ec0-301f-11d3-bf4b-00c04f79efbc} 14 | Library 15 | Properties 16 | Blip.Data 17 | Blip.Data 18 | v4.7.2 19 | true 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | true 32 | full 33 | false 34 | bin\ 35 | DEBUG;TRACE 36 | prompt 37 | 4 38 | 39 | 40 | true 41 | pdbonly 42 | true 43 | bin\ 44 | TRACE 45 | prompt 46 | 4 47 | 48 | 49 | 50 | ..\packages\EntityFramework.6.4.0\lib\net45\EntityFramework.dll 51 | 52 | 53 | ..\packages\EntityFramework.6.4.0\lib\net45\EntityFramework.SqlServer.dll 54 | 55 | 56 | ..\packages\Microsoft.AspNet.Identity.Core.2.2.3\lib\net45\Microsoft.AspNet.Identity.Core.dll 57 | 58 | 59 | ..\packages\Microsoft.AspNet.Identity.EntityFramework.2.2.3\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll 60 | 61 | 62 | ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll 63 | 64 | 65 | 66 | ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll 67 | True 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll 80 | 81 | 82 | ..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll 83 | 84 | 85 | ..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll 86 | 87 | 88 | ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll 89 | 90 | 91 | ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll 92 | 93 | 94 | ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | App.config 108 | 109 | 110 | App.config 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 201708222251192_InitialMigration.cs 125 | 126 | 127 | 128 | 201709222256518_AddAddressEntities.cs 129 | 130 | 131 | 132 | 201709232229196_AddAddressTypes.cs 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | {3a1ff2ca-e0aa-4e04-a082-b8fccd23f8f0} 143 | Blip.Entities 144 | 145 | 146 | 147 | 148 | 201708222251192_InitialMigration.cs 149 | 150 | 151 | 201709222256518_AddAddressEntities.cs 152 | 153 | 154 | 201709232229196_AddAddressTypes.cs 155 | 156 | 157 | 158 | 10.0 159 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 182 | -------------------------------------------------------------------------------- /Blip.Data/Context/Context.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Entity; 2 | using Blip.Entities.Customers; 3 | using Blip.Entities.Geographies; 4 | using Blip.Entities.Metadata; 5 | 6 | namespace Blip.Data 7 | { 8 | public class ApplicationDbContext : DbContext 9 | { 10 | public ApplicationDbContext() : base("ApplicationDbContext") 11 | { 12 | 13 | } 14 | public DbSet Countries { get; set; } 15 | public DbSet Customers { get; set; } 16 | public DbSet Regions { get; set; } 17 | public DbSet EmailAddresses { get; set; } 18 | public DbSet PostalAddresses { get; set; } 19 | public DbSet AddressTypes { get; set; } 20 | 21 | protected override void OnModelCreating(DbModelBuilder modelBuilder) 22 | { 23 | 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Blip.Data/Geographies/CountriesRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web.Mvc; 5 | using Blip.Data; 6 | 7 | namespace Blip.Data.Countries 8 | { 9 | public class CountriesRepository 10 | { 11 | public IEnumerable GetCountries() 12 | { 13 | using (var context = new ApplicationDbContext()) 14 | { 15 | List countries = context.Countries.AsNoTracking() 16 | .OrderBy(n => n.CountryNameEnglish) 17 | .Select(n => 18 | new SelectListItem 19 | { 20 | Value = n.Iso3.ToString(), 21 | Text = n.CountryNameEnglish 22 | }).ToList(); 23 | var countrytip = new SelectListItem() 24 | { 25 | Value = null, 26 | Text = "--- select country ---" 27 | }; 28 | countries.Insert(0, countrytip); 29 | return new SelectList(countries, "Value", "Text"); 30 | } 31 | } 32 | 33 | public string GetCountryNameEnglish(string iso3) 34 | { 35 | if(!String.IsNullOrWhiteSpace(iso3)) 36 | { 37 | using (var context = new ApplicationDbContext()) 38 | { 39 | var countryName = context.Countries.AsNoTracking() 40 | .Where(x => x.Iso3 == iso3) 41 | .SingleOrDefault(); 42 | if (countryName != null) 43 | { 44 | var countryNameEnglish = countryName.CountryNameEnglish.Trim(); 45 | return countryNameEnglish; 46 | } 47 | } 48 | } 49 | return null; 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /Blip.Data/Geographies/RegionsRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web.Mvc; 5 | 6 | namespace Blip.Data.Regions 7 | { 8 | public class RegionsRepository 9 | { 10 | public IEnumerable GetRegions() 11 | { 12 | List regions = new List() 13 | { 14 | new SelectListItem 15 | { 16 | Value = null, 17 | Text = " " 18 | } 19 | }; 20 | return regions; 21 | } 22 | 23 | public IEnumerable GetRegions(string iso3) 24 | { 25 | if (!String.IsNullOrWhiteSpace(iso3)) 26 | { 27 | using (var context = new ApplicationDbContext()) 28 | { 29 | IEnumerable regions = context.Regions.AsNoTracking() 30 | .OrderBy(n => n.RegionNameEnglish) 31 | .Where(n => n.Iso3 == iso3) 32 | .Select(n => 33 | new SelectListItem 34 | { 35 | Value = n.RegionCode, 36 | Text = n.RegionNameEnglish 37 | }).ToList(); 38 | return new SelectList(regions, "Value", "Text"); 39 | } 40 | } 41 | return null; 42 | } 43 | 44 | public string GetRegionNameEnglish(string regioncode) 45 | { 46 | if (!String.IsNullOrWhiteSpace(regioncode)) 47 | { 48 | using (var context = new ApplicationDbContext()) 49 | { 50 | var region = context.Regions.AsNoTracking() 51 | .Where(x => x.RegionCode == regioncode) 52 | .SingleOrDefault(); 53 | if (region != null) 54 | { 55 | var regionNameEnglish = region.RegionNameEnglish.Trim(); 56 | return regionNameEnglish; 57 | } 58 | } 59 | } 60 | return null; 61 | } 62 | 63 | } 64 | } -------------------------------------------------------------------------------- /Blip.Data/Metadata/MetadataRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Web.Mvc; 7 | using Blip.Data; 8 | 9 | namespace Blip.Data.Metadata 10 | { 11 | public class MetadataRepository 12 | { 13 | public IEnumerable GetAddressTypes() 14 | { 15 | using (var context = new ApplicationDbContext()) 16 | { 17 | List addresstypes = context.AddressTypes.AsNoTracking() 18 | .OrderBy(x => x.AddressTypeID) 19 | .Select(x => 20 | new SelectListItem 21 | { 22 | Value = x.AddressTypeID, 23 | Text = x.AddressTypeID 24 | }).ToList(); 25 | return new SelectList(addresstypes, "Value", "Text"); 26 | } 27 | } 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Blip.Data/Migrations/201708222251192_InitialMigration.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Blip.Entities.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.0-30225")] 10 | public sealed partial class InitialMigration : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(InitialMigration)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201708222251192_InitialMigration"; } 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 | -------------------------------------------------------------------------------- /Blip.Data/Migrations/201708222251192_InitialMigration.cs: -------------------------------------------------------------------------------- 1 | namespace Blip.Data.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity.Migrations; 5 | 6 | public partial class InitialMigration : DbMigration 7 | { 8 | public override void Up() 9 | { 10 | CreateTable( 11 | "dbo.Countries", 12 | c => new 13 | { 14 | Iso3 = c.String(nullable: false, maxLength: 3), 15 | CountryNameEnglish = c.String(nullable: false, maxLength: 50), 16 | }) 17 | .PrimaryKey(t => t.Iso3); 18 | 19 | CreateTable( 20 | "dbo.Customers", 21 | c => new 22 | { 23 | CustomerID = c.Guid(nullable: false), 24 | CustomerName = c.String(nullable: false, maxLength: 128), 25 | CountryIso3 = c.String(nullable: false, maxLength: 3), 26 | RegionCode = c.String(maxLength: 3), 27 | }) 28 | .PrimaryKey(t => t.CustomerID) 29 | .ForeignKey("dbo.Countries", t => t.CountryIso3, cascadeDelete: true) 30 | .ForeignKey("dbo.Regions", t => t.RegionCode) 31 | .Index(t => t.CountryIso3) 32 | .Index(t => t.RegionCode); 33 | 34 | CreateTable( 35 | "dbo.Regions", 36 | c => new 37 | { 38 | RegionCode = c.String(nullable: false, maxLength: 3), 39 | Iso3 = c.String(nullable: false, maxLength: 3), 40 | RegionNameEnglish = c.String(nullable: false), 41 | }) 42 | .PrimaryKey(t => t.RegionCode) 43 | .ForeignKey("dbo.Countries", t => t.Iso3, cascadeDelete: true) 44 | .Index(t => t.Iso3); 45 | 46 | } 47 | 48 | public override void Down() 49 | { 50 | DropForeignKey("dbo.Customers", "RegionCode", "dbo.Regions"); 51 | DropForeignKey("dbo.Regions", "Iso3", "dbo.Countries"); 52 | DropForeignKey("dbo.Customers", "CountryIso3", "dbo.Countries"); 53 | DropIndex("dbo.Regions", new[] { "Iso3" }); 54 | DropIndex("dbo.Customers", new[] { "RegionCode" }); 55 | DropIndex("dbo.Customers", new[] { "CountryIso3" }); 56 | DropTable("dbo.Regions"); 57 | DropTable("dbo.Customers"); 58 | DropTable("dbo.Countries"); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Blip.Data/Migrations/201708222251192_InitialMigration.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 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 122 | 123 | 124 | dbo 125 | 126 | -------------------------------------------------------------------------------- /Blip.Data/Migrations/201709222256518_AddAddressEntities.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Blip.Entities.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 AddAddressEntities : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(AddAddressEntities)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201709222256518_AddAddressEntities"; } 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 | -------------------------------------------------------------------------------- /Blip.Data/Migrations/201709222256518_AddAddressEntities.cs: -------------------------------------------------------------------------------- 1 | namespace Blip.Data.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity.Migrations; 5 | 6 | public partial class AddAddressEntities : DbMigration 7 | { 8 | public override void Up() 9 | { 10 | CreateTable( 11 | "dbo.EmailAddresses", 12 | c => new 13 | { 14 | Email = c.String(nullable: false, maxLength: 128), 15 | CustomerID = c.Guid(nullable: false), 16 | }) 17 | .PrimaryKey(t => t.Email) 18 | .ForeignKey("dbo.Customers", t => t.CustomerID, cascadeDelete: true) 19 | .Index(t => t.CustomerID); 20 | 21 | CreateTable( 22 | "dbo.PostalAddresses", 23 | c => new 24 | { 25 | PostalAddressID = c.Int(nullable: false, identity: true), 26 | CustomerID = c.Guid(nullable: false), 27 | Iso3 = c.String(maxLength: 3), 28 | StreetAddress1 = c.String(maxLength: 100), 29 | StreetAddress2 = c.String(maxLength: 100), 30 | City = c.String(maxLength: 50), 31 | RegionCode = c.String(maxLength: 3), 32 | PostalCode = c.String(maxLength: 10), 33 | }) 34 | .PrimaryKey(t => t.PostalAddressID) 35 | .ForeignKey("dbo.Countries", t => t.Iso3) 36 | .ForeignKey("dbo.Customers", t => t.CustomerID, cascadeDelete: true) 37 | .ForeignKey("dbo.Regions", t => t.RegionCode) 38 | .Index(t => t.CustomerID) 39 | .Index(t => t.Iso3) 40 | .Index(t => t.RegionCode); 41 | 42 | } 43 | 44 | public override void Down() 45 | { 46 | DropForeignKey("dbo.PostalAddresses", "RegionCode", "dbo.Regions"); 47 | DropForeignKey("dbo.PostalAddresses", "CustomerID", "dbo.Customers"); 48 | DropForeignKey("dbo.PostalAddresses", "Iso3", "dbo.Countries"); 49 | DropForeignKey("dbo.EmailAddresses", "CustomerID", "dbo.Customers"); 50 | DropIndex("dbo.PostalAddresses", new[] { "RegionCode" }); 51 | DropIndex("dbo.PostalAddresses", new[] { "Iso3" }); 52 | DropIndex("dbo.PostalAddresses", new[] { "CustomerID" }); 53 | DropIndex("dbo.EmailAddresses", new[] { "CustomerID" }); 54 | DropTable("dbo.PostalAddresses"); 55 | DropTable("dbo.EmailAddresses"); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Blip.Data/Migrations/201709222256518_AddAddressEntities.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 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 122 | 123 | 124 | dbo 125 | 126 | -------------------------------------------------------------------------------- /Blip.Data/Migrations/201709232229196_AddAddressTypes.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Blip.Entities.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 AddAddressTypes : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(AddAddressTypes)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201709232229196_AddAddressTypes"; } 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 | -------------------------------------------------------------------------------- /Blip.Data/Migrations/201709232229196_AddAddressTypes.cs: -------------------------------------------------------------------------------- 1 | namespace Blip.Entities.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity.Migrations; 5 | 6 | public partial class AddAddressTypes : DbMigration 7 | { 8 | public override void Up() 9 | { 10 | CreateTable( 11 | "dbo.AddressTypes", 12 | c => new 13 | { 14 | AddressTypeID = c.String(nullable: false, maxLength: 10), 15 | }) 16 | .PrimaryKey(t => t.AddressTypeID); 17 | } 18 | 19 | public override void Down() 20 | { 21 | DropTable("dbo.AddressTypes"); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Blip.Data/Migrations/201709232229196_AddAddressTypes.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 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 122 | 123 | 124 | dbo 125 | 126 | -------------------------------------------------------------------------------- /Blip.Data/Migrations/Configuration.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajsaulsberry/BlipAjax/0bb46f1f40bd57adfc484deb41933ac74bcf13f8/Blip.Data/Migrations/Configuration.cs -------------------------------------------------------------------------------- /Blip.Data/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Blip.Data")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Blip.Data")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("c8f46fa8-bef3-4592-bd57-e5e9ecfca1b9")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Blip.Data/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /Blip.Data/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /Blip.Data/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Blip.Entities/App.config: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /Blip.Entities/Blip.Entities.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Debug 7 | AnyCPU 8 | 9 | 10 | 2.0 11 | {3A1FF2CA-E0AA-4E04-A082-B8FCCD23F8F0} 12 | {fae04ec0-301f-11d3-bf4b-00c04f79efbc} 13 | Library 14 | Properties 15 | Blip.Entities 16 | Blip.Entities 17 | v4.7.2 18 | true 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | true 31 | full 32 | false 33 | bin\ 34 | DEBUG;TRACE 35 | prompt 36 | 4 37 | 38 | 39 | true 40 | pdbonly 41 | true 42 | bin\ 43 | TRACE 44 | prompt 45 | 4 46 | 47 | 48 | 49 | ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll 50 | 51 | 52 | 53 | ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll 54 | True 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll 67 | 68 | 69 | ..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll 70 | 71 | 72 | ..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll 73 | 74 | 75 | ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll 76 | 77 | 78 | ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll 79 | 80 | 81 | ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | App.config 95 | 96 | 97 | App.config 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 10.0 123 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 132 | 133 | 134 | 135 | 136 | 143 | -------------------------------------------------------------------------------- /Blip.Entities/Customers.ViewModels/AddressTypeViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.Web.Mvc; 4 | 5 | namespace Blip.Entities.Customers.ViewModels 6 | { 7 | public class AddressTypeViewModel 8 | { 9 | [StringLength(38)] 10 | public string CustomerID { get; set; } // Carries the value in POST action. 11 | 12 | [Display(Name = "Address Type")] 13 | public string SelectedAddressType { get; set; } 14 | public IEnumerable AddressTypes { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Blip.Entities/Customers.ViewModels/CustomerDisplayViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace Blip.Entities.Customers.ViewModels 5 | { 6 | public class CustomerDisplayViewModel 7 | { 8 | [Display(Name = "Customer Number")] 9 | public Guid CustomerID { get; set; } 10 | 11 | [Display(Name = "Customer Name")] 12 | public string CustomerName { get; set; } 13 | 14 | [Display(Name = "Country")] 15 | public string CountryName { get; set; } 16 | 17 | [Display(Name = "State / Province / Region")] 18 | public string RegionName { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /Blip.Entities/Customers.ViewModels/CustomerEditViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.Web.Mvc; 4 | 5 | namespace Blip.Entities.Customers.ViewModels 6 | { 7 | public class CustomerEditViewModel 8 | { 9 | [Display(Name = "Customer Number")] 10 | public string CustomerID { get; set; } 11 | 12 | [Required] 13 | [Display(Name = "Customer Name")] 14 | [StringLength(75)] 15 | public string CustomerName { get; set; } 16 | 17 | [Required] 18 | [Display(Name = "Country")] 19 | public string SelectedCountryIso3 { get; set; } 20 | public IEnumerable Countries { get; set; } 21 | 22 | [Required] 23 | [Display(Name = "State / Region")] 24 | public string SelectedRegionCode { get; set; } 25 | public IEnumerable Regions { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /Blip.Entities/Customers.ViewModels/EmailAddressListViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Blip.Entities.Customers.ViewModels 9 | { 10 | public class EmailAddressListViewModel 11 | { 12 | [StringLength(38)] 13 | public string CustomerID { get; set; } 14 | 15 | public ICollection EmailAddresses { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Blip.Entities/Customers.ViewModels/EmailAddressViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Blip.Entities.Customers.ViewModels 9 | { 10 | public class EmailAddressViewModel 11 | { 12 | [StringLength(38)] 13 | public string CustomerID { get; set; } 14 | 15 | [DataType(DataType.EmailAddress)] 16 | public string Email { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Blip.Entities/Customers.ViewModels/PostalAddressEditViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Web.Mvc; 8 | 9 | namespace Blip.Entities.Customers.ViewModels 10 | { 11 | public class PostalAddressEditViewModel 12 | { 13 | public int PostalAddressID { get; set; } 14 | 15 | public string CustomerID { get; set; } 16 | 17 | [Display(Name = "Address Line 1")] 18 | [StringLength(100)] 19 | public string StreetAddress1 { get; set; } 20 | 21 | [Display(Name = "Address Line 2")] 22 | [StringLength(100)] 23 | public string StreetAddress2 { get; set; } 24 | 25 | [Display(Name = "City / Town")] 26 | [StringLength(50)] 27 | public string City { get; set; } 28 | 29 | [Display(Name = "Zip / Postal Code")] 30 | [StringLength(10)] 31 | public string PostalCode { get; set; } 32 | 33 | [Required] 34 | [Display(Name = "Country")] 35 | public string SelectedCountryIso3 { get; set; } 36 | public IEnumerable Countries { get; set; } 37 | 38 | [Required] 39 | [Display(Name = "State / Region")] 40 | public string SelectedRegionCode { get; set; } 41 | public IEnumerable Regions { get; set; } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Blip.Entities/Customers.ViewModels/PostalAddressListViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Blip.Entities.Customers.ViewModels 9 | { 10 | public class PostalAddressListViewModel 11 | { 12 | [StringLength(38)] 13 | public string CustomerID { get; set; } 14 | 15 | public ICollection PostalAddresses { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Blip.Entities/Customers.ViewModels/PostalAddressViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Blip.Entities.Customers.ViewModels 9 | { 10 | public class PostalAddressViewModel 11 | { 12 | public int PostalAddressID { get; set; } 13 | 14 | public string CustomerID { get; set; } 15 | 16 | [Display(Name = "Address Line 1")] 17 | [StringLength(100)] 18 | public string StreetAddress1 { get; set; } 19 | 20 | [Display(Name = "Address Line 2")] 21 | [StringLength(100)] 22 | public string StreetAddress2 { get; set; } 23 | 24 | [Display(Name = "City / Town")] 25 | [StringLength(50)] 26 | public string City { get; set; } 27 | 28 | [Display(Name = "Zip / Postal Code")] 29 | [StringLength(10)] 30 | public string PostalCode { get; set; } 31 | 32 | [Display(Name = "State / Region")] 33 | public string RegionNameEnglish { get; set; } 34 | 35 | [Display(Name = "Country")] 36 | public string CountryNameEnglish { get; set; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Blip.Entities/Customers/Customer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | using Blip.Entities.Geographies; 5 | 6 | namespace Blip.Entities.Customers 7 | { 8 | public class Customer 9 | { 10 | [Key] 11 | [Column(Order = 1)] 12 | public Guid CustomerID { get; set; } 13 | 14 | [Required] 15 | [MaxLength(128)] 16 | public string CustomerName { get; set; } 17 | 18 | [Required] 19 | [MaxLength(3)] 20 | public string CountryIso3 { get; set; } 21 | 22 | [MaxLength(3)] 23 | public string RegionCode { get; set; } 24 | 25 | public virtual Country Country { get; set; } 26 | 27 | public virtual Region Region { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /Blip.Entities/Customers/EmailAddress.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Blip.Entities.Customers 9 | { 10 | public class EmailAddress 11 | { 12 | [Key] 13 | [Required] 14 | [MaxLength(128)] 15 | public string Email { get; set; } 16 | 17 | [Required] 18 | public Guid CustomerID { get; set; } 19 | 20 | public virtual Customer Customer { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Blip.Entities/Customers/PostalAddress.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Blip.Entities.Geographies; 8 | 9 | namespace Blip.Entities.Customers 10 | { 11 | public class PostalAddress 12 | { 13 | [Key] 14 | [Required] 15 | public int PostalAddressID { get; set; } 16 | 17 | [Required] 18 | public Guid CustomerID { get; set; } 19 | 20 | [MaxLength(3)] 21 | public string Iso3 { get; set; } 22 | 23 | [MaxLength(100)] 24 | public string StreetAddress1 { get; set; } 25 | 26 | [MaxLength(100)] 27 | public string StreetAddress2 { get; set; } 28 | 29 | [MaxLength(50)] 30 | public string City { get; set; } 31 | 32 | [MaxLength(3)] 33 | public string RegionCode { get; set; } 34 | 35 | [MaxLength(10)] 36 | public string PostalCode { get; set; } 37 | 38 | public virtual Customer Customer { get; set; } 39 | 40 | public virtual Country Country { get; set; } 41 | 42 | public virtual Region Region { get; set; } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Blip.Entities/Geographies/Country.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace Blip.Entities.Geographies 5 | { 6 | public class Country 7 | { 8 | [Key] 9 | [MaxLength(3)] 10 | public string Iso3 { get; set; } 11 | 12 | [Required] 13 | [MaxLength(50)] 14 | public string CountryNameEnglish { get; set; } 15 | 16 | public virtual IEnumerable Regions { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /Blip.Entities/Geographies/Region.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Blip.Entities.Geographies 4 | { 5 | public class Region 6 | { 7 | [Key] 8 | [MaxLength(3)] 9 | public string RegionCode { get; set; } 10 | 11 | [Required] 12 | [MaxLength(3)] 13 | public string Iso3 { get; set; } 14 | 15 | [Required] 16 | public string RegionNameEnglish { get; set; } 17 | 18 | public virtual Country Country { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /Blip.Entities/Metadata/AddressTypes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Blip.Entities.Metadata 9 | { 10 | public class AddressType 11 | { 12 | [Key] 13 | [Required] 14 | [MaxLength(10), MinLength(2)] 15 | public string AddressTypeID { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Blip.Entities/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Blip.Entities")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Blip.Entities")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("3a1ff2ca-e0aa-4e04-a082-b8fccd23f8f0")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Blip.Entities/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /Blip.Entities/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /Blip.Entities/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Blip.Web/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace BlipProjects 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 | // jqueryunobtrusive includes unobtrusive-ajax but not validate.unobtrusive. 18 | bundles.Add(new ScriptBundle("~/bundles/jqueryunobtrusive").Include( 19 | "~/Scripts/jquery.unobtrusive*")); 20 | 21 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 22 | // ready for production, use the build tool at https://modernizr.com to pick only the tests you need. 23 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 24 | "~/Scripts/modernizr-*")); 25 | 26 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 27 | "~/Scripts/bootstrap.js", 28 | "~/Scripts/respond.js")); 29 | 30 | bundles.Add(new StyleBundle("~/Content/css").Include( 31 | "~/Content/bootstrap.css", 32 | "~/Content/site.css")); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Blip.Web/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace BlipProjects 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Blip.Web/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 BlipProjects 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 | -------------------------------------------------------------------------------- /Blip.Web/ApplicationInsights.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | search|spider|crawl|Bot|Monitor|AlwaysOn 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 30 | core.windows.net 31 | core.chinacloudapi.cn 32 | core.cloudapi.de 33 | core.usgovcloudapi.net 34 | 35 | 36 | Microsoft.Azure.EventHubs 37 | Microsoft.Azure.ServiceBus 38 | 39 | 40 | 41 | 58 | 59 | 60 | 61 | 62 | 89 | 90 | 91 | 92 | 93 | 95 | 96 | 97 | 98 | 103 | Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.RequestDataHttpHandler 104 | System.Web.StaticFileHandler 105 | System.Web.Handlers.AssemblyResourceLoader 106 | System.Web.Optimization.BundleHandler 107 | System.Web.Script.Services.ScriptHandlerFactory 108 | System.Web.Handlers.TraceHandler 109 | System.Web.Services.Discovery.DiscoveryRequestHandler 110 | System.Web.HttpDebugHandler 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 5 124 | Event 125 | 126 | 127 | 5 128 | Event 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /Blip.Web/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 | -------------------------------------------------------------------------------- /Blip.Web/Controllers/CustomerController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Net; 4 | using System.Web.Mvc; 5 | using Blip.Data.Countries; 6 | using Blip.Data.Customers; 7 | using Blip.Data.Metadata; 8 | using Blip.Data.Regions; 9 | using Blip.Entities.Customers.ViewModels; 10 | 11 | namespace Blip.Web.Controllers 12 | { 13 | public class CustomerController : Controller 14 | { 15 | // GET: Customer 16 | public ActionResult Index() 17 | { 18 | var repo = new CustomersRepository(); 19 | var customerList = repo.GetCustomers(); 20 | return View(customerList); 21 | } 22 | 23 | [HttpGet] 24 | public ActionResult GetRegions(string iso3) 25 | { 26 | if (!string.IsNullOrWhiteSpace(iso3) && iso3.Length == 3) 27 | { 28 | var repo = new RegionsRepository(); 29 | 30 | IEnumerable regions = repo.GetRegions(iso3); 31 | return Json(regions, JsonRequestBehavior.AllowGet); 32 | } 33 | return null; 34 | } 35 | 36 | 37 | // GET: Customer/Details/5 38 | public ActionResult Details(int id) 39 | { 40 | return View(); 41 | } 42 | 43 | // GET: Customer/Create 44 | public ActionResult Create() 45 | { 46 | var repo = new CustomersRepository(); 47 | var customer = repo.CreateCustomer(); 48 | return View(customer); 49 | } 50 | 51 | // POST: Customer/Create 52 | [HttpPost] 53 | public ActionResult Create([Bind(Include = "CustomerID, CustomerName, SelectedCountryIso3, SelectedRegionCode")] CustomerEditViewModel model) 54 | { 55 | try 56 | { 57 | if (ModelState.IsValid) 58 | { 59 | var repo = new CustomersRepository(); 60 | bool saved = repo.SaveCustomer(model); 61 | if (saved) 62 | { 63 | return RedirectToAction("Index"); 64 | } 65 | } 66 | return View(); 67 | } 68 | catch 69 | { 70 | return View(); 71 | } 72 | } 73 | 74 | // GET: Customer/Edit/68f8202d-21cb-4090-a86c-0722bf588d1b 75 | public ActionResult Edit(string id) 76 | { 77 | if (!String.IsNullOrWhiteSpace(id)) 78 | { 79 | bool isGuid = Guid.TryParse(id, out Guid customerId); 80 | if (isGuid && customerId != Guid.Empty) 81 | { 82 | return View(); 83 | } 84 | } 85 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 86 | } 87 | 88 | [ChildActionOnly] 89 | public ActionResult EditCustomerPartial(string id) 90 | { 91 | if (!String.IsNullOrWhiteSpace(id)) 92 | { 93 | bool isGuid = Guid.TryParse(id, out Guid customerId); 94 | if (isGuid && customerId != Guid.Empty) 95 | { 96 | var repo = new CustomersRepository(); 97 | var model = repo.GetCustomer(customerId); 98 | return View(model); 99 | } 100 | } 101 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 102 | } 103 | 104 | [HttpPost] 105 | [ValidateAntiForgeryToken] 106 | public ActionResult EditCustomerPartial(CustomerEditViewModel model) 107 | { 108 | if(ModelState.IsValid) 109 | { 110 | var repo = new CustomersRepository(); 111 | bool saved = repo.SaveCustomer(model); 112 | if (saved) 113 | { 114 | bool isGuid = Guid.TryParse(model.CustomerID, out Guid customerId); 115 | if (isGuid) 116 | { 117 | var modelUpdate = repo.GetCustomer(customerId); 118 | return PartialView(modelUpdate); 119 | } 120 | } 121 | } 122 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 123 | } 124 | 125 | [ChildActionOnly] 126 | public ActionResult AddressTypePartial(string id) 127 | { 128 | if (!String.IsNullOrWhiteSpace(id)) 129 | { 130 | bool isGuid = Guid.TryParse(id, out Guid customerId); 131 | if (isGuid && customerId != Guid.Empty) 132 | { 133 | var repo = new MetadataRepository(); 134 | var model = new AddressTypeViewModel() 135 | { 136 | CustomerID = id, 137 | AddressTypes = repo.GetAddressTypes() 138 | }; 139 | return PartialView("AddressTypePartial", model); 140 | } 141 | } 142 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 143 | } 144 | 145 | [HttpPost] 146 | [ValidateAntiForgeryToken] 147 | public ActionResult AddressTypePartial(AddressTypeViewModel model) 148 | { 149 | if (ModelState.IsValid && !String.IsNullOrWhiteSpace(model.CustomerID)) 150 | { 151 | switch (model.SelectedAddressType) 152 | { 153 | case "Email": 154 | var emailAddressModel = new EmailAddressViewModel() 155 | { 156 | CustomerID = model.CustomerID 157 | }; 158 | return PartialView("CreateEmailAddressPartial", emailAddressModel); 159 | case "Postal": 160 | var postalAddressModel = new PostalAddressEditViewModel() 161 | { 162 | CustomerID = model.CustomerID 163 | }; 164 | var countriesRepo = new CountriesRepository(); 165 | postalAddressModel.Countries = countriesRepo.GetCountries(); 166 | var regionsRepo = new RegionsRepository(); 167 | postalAddressModel.Regions = regionsRepo.GetRegions(); 168 | return PartialView("CreatePostalAddressPartial", postalAddressModel); 169 | default: 170 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 171 | } 172 | } 173 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 174 | } 175 | 176 | [HttpPost] 177 | [ValidateAntiForgeryToken] 178 | public ActionResult CreateEmailAddressPartial(EmailAddressViewModel model) 179 | { 180 | if (ModelState.IsValid) 181 | { 182 | var repo = new CustomersRepository(); 183 | bool saved = repo.SaveEmailAddress(model); 184 | if (saved) 185 | { 186 | return RedirectToAction("Edit", new { id = model.CustomerID }); 187 | } 188 | } 189 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 190 | } 191 | 192 | [HttpPost] 193 | [ValidateAntiForgeryToken] 194 | public ActionResult CreatePostalAddressPartial(PostalAddressEditViewModel model) 195 | { 196 | if (ModelState.IsValid) 197 | { 198 | var repo = new CustomersRepository(); 199 | var updatedModel = repo.SavePostalAddress(model); 200 | if (updatedModel != null) 201 | { 202 | return RedirectToAction("Edit", new { id = model.CustomerID }); 203 | } 204 | } 205 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 206 | } 207 | 208 | // GET: Customer/Delete/5 209 | public ActionResult Delete(int id) 210 | { 211 | return View(); 212 | } 213 | 214 | // POST: Customer/Delete/5 215 | [HttpPost] 216 | public ActionResult Delete(int id, FormCollection collection) 217 | { 218 | try 219 | { 220 | // TODO: Add delete logic here 221 | 222 | return RedirectToAction("Index"); 223 | } 224 | catch 225 | { 226 | return View(); 227 | } 228 | } 229 | } 230 | 231 | } -------------------------------------------------------------------------------- /Blip.Web/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 BlipProjects.Controllers 8 | { 9 | public class HomeController : Controller 10 | { 11 | public ActionResult Index() 12 | { 13 | return View(); 14 | } 15 | 16 | public ActionResult About() 17 | { 18 | ViewBag.Message = "Your application description page."; 19 | 20 | return View(); 21 | } 22 | 23 | public ActionResult Contact() 24 | { 25 | ViewBag.Message = "Your contact page."; 26 | 27 | return View(); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Blip.Web/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="BlipProjects.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Blip.Web/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 BlipProjects 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 | -------------------------------------------------------------------------------- /Blip.Web/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("BlipProjects")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("BlipProjects")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("3e3496ee-1605-405a-b70a-d647b3ca9336")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Blip.Web/Scripts/jquery.unobtrusive-ajax.js: -------------------------------------------------------------------------------- 1 | // Unobtrusive Ajax support library for jQuery 2 | // Copyright (c) .NET Foundation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 4 | // @version v3.2.6 5 | // 6 | // Microsoft grants you the right to use these script files for the sole 7 | // purpose of either: (i) interacting through your browser with the Microsoft 8 | // website or online service, subject to the applicable licensing or use 9 | // terms; or (ii) using the files as included with a Microsoft product subject 10 | // to that product's license terms. Microsoft reserves all other rights to the 11 | // files not expressly granted by Microsoft, whether by implication, estoppel 12 | // or otherwise. Insofar as a script file is dual licensed under GPL, 13 | // Microsoft neither took the code under GPL nor distributes it thereunder but 14 | // under the terms set out in this paragraph. All notices and licenses 15 | // below are for informational purposes only. 16 | 17 | /*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */ 18 | /*global window: false, jQuery: false */ 19 | 20 | (function ($) { 21 | var data_click = "unobtrusiveAjaxClick", 22 | data_target = "unobtrusiveAjaxClickTarget", 23 | data_validation = "unobtrusiveValidation"; 24 | 25 | function getFunction(code, argNames) { 26 | var fn = window, parts = (code || "").split("."); 27 | while (fn && parts.length) { 28 | fn = fn[parts.shift()]; 29 | } 30 | if (typeof (fn) === "function") { 31 | return fn; 32 | } 33 | argNames.push(code); 34 | return Function.constructor.apply(null, argNames); 35 | } 36 | 37 | function isMethodProxySafe(method) { 38 | return method === "GET" || method === "POST"; 39 | } 40 | 41 | function asyncOnBeforeSend(xhr, method) { 42 | if (!isMethodProxySafe(method)) { 43 | xhr.setRequestHeader("X-HTTP-Method-Override", method); 44 | } 45 | } 46 | 47 | function asyncOnSuccess(element, data, contentType) { 48 | var mode; 49 | 50 | if (contentType.indexOf("application/x-javascript") !== -1) { // jQuery already executes JavaScript for us 51 | return; 52 | } 53 | 54 | mode = (element.getAttribute("data-ajax-mode") || "").toUpperCase(); 55 | $(element.getAttribute("data-ajax-update")).each(function (i, update) { 56 | var top; 57 | 58 | switch (mode) { 59 | case "BEFORE": 60 | $(update).prepend(data); 61 | break; 62 | case "AFTER": 63 | $(update).append(data); 64 | break; 65 | case "REPLACE-WITH": 66 | $(update).replaceWith(data); 67 | break; 68 | default: 69 | $(update).html(data); 70 | break; 71 | } 72 | }); 73 | } 74 | 75 | function asyncRequest(element, options) { 76 | var confirm, loading, method, duration; 77 | 78 | confirm = element.getAttribute("data-ajax-confirm"); 79 | if (confirm && !window.confirm(confirm)) { 80 | return; 81 | } 82 | 83 | loading = $(element.getAttribute("data-ajax-loading")); 84 | duration = parseInt(element.getAttribute("data-ajax-loading-duration"), 10) || 0; 85 | 86 | $.extend(options, { 87 | type: element.getAttribute("data-ajax-method") || undefined, 88 | url: element.getAttribute("data-ajax-url") || undefined, 89 | cache: (element.getAttribute("data-ajax-cache") || "").toLowerCase() === "true", 90 | beforeSend: function (xhr) { 91 | var result; 92 | asyncOnBeforeSend(xhr, method); 93 | result = getFunction(element.getAttribute("data-ajax-begin"), ["xhr"]).apply(element, arguments); 94 | if (result !== false) { 95 | loading.show(duration); 96 | } 97 | return result; 98 | }, 99 | complete: function () { 100 | loading.hide(duration); 101 | getFunction(element.getAttribute("data-ajax-complete"), ["xhr", "status"]).apply(element, arguments); 102 | }, 103 | success: function (data, status, xhr) { 104 | asyncOnSuccess(element, data, xhr.getResponseHeader("Content-Type") || "text/html"); 105 | getFunction(element.getAttribute("data-ajax-success"), ["data", "status", "xhr"]).apply(element, arguments); 106 | }, 107 | error: function () { 108 | getFunction(element.getAttribute("data-ajax-failure"), ["xhr", "status", "error"]).apply(element, arguments); 109 | } 110 | }); 111 | 112 | options.data.push({ name: "X-Requested-With", value: "XMLHttpRequest" }); 113 | 114 | method = options.type.toUpperCase(); 115 | if (!isMethodProxySafe(method)) { 116 | options.type = "POST"; 117 | options.data.push({ name: "X-HTTP-Method-Override", value: method }); 118 | } 119 | 120 | // change here: 121 | // Check for a Form POST with enctype=multipart/form-data 122 | // add the input file that were not previously included in the serializeArray() 123 | // set processData and contentType to false 124 | var $element = $(element); 125 | if ($element.is("form") && $element.attr("enctype") == "multipart/form-data") { 126 | var formdata = new FormData(); 127 | $.each(options.data, function (i, v) { 128 | formdata.append(v.name, v.value); 129 | }); 130 | $("input[type=file]", $element).each(function () { 131 | var file = this; 132 | $.each(file.files, function (n, v) { 133 | formdata.append(file.name, v); 134 | }); 135 | }); 136 | $.extend(options, { 137 | processData: false, 138 | contentType: false, 139 | data: formdata 140 | }); 141 | } 142 | // end change 143 | 144 | $.ajax(options); 145 | } 146 | 147 | function validate(form) { 148 | var validationInfo = $(form).data(data_validation); 149 | return !validationInfo || !validationInfo.validate || validationInfo.validate(); 150 | } 151 | 152 | $(document).on("click", "a[data-ajax=true]", function (evt) { 153 | evt.preventDefault(); 154 | asyncRequest(this, { 155 | url: this.href, 156 | type: "GET", 157 | data: [] 158 | }); 159 | }); 160 | 161 | $(document).on("click", "form[data-ajax=true] input[type=image]", function (evt) { 162 | var name = evt.target.name, 163 | target = $(evt.target), 164 | form = $(target.parents("form")[0]), 165 | offset = target.offset(); 166 | 167 | form.data(data_click, [ 168 | { name: name + ".x", value: Math.round(evt.pageX - offset.left) }, 169 | { name: name + ".y", value: Math.round(evt.pageY - offset.top) } 170 | ]); 171 | 172 | setTimeout(function () { 173 | form.removeData(data_click); 174 | }, 0); 175 | }); 176 | 177 | $(document).on("click", "form[data-ajax=true] :submit", function (evt) { 178 | var name = evt.currentTarget.name, 179 | target = $(evt.target), 180 | form = $(target.parents("form")[0]); 181 | 182 | form.data(data_click, name ? [{ name: name, value: evt.currentTarget.value }] : []); 183 | form.data(data_target, target); 184 | 185 | setTimeout(function () { 186 | form.removeData(data_click); 187 | form.removeData(data_target); 188 | }, 0); 189 | }); 190 | 191 | $(document).on("submit", "form[data-ajax=true]", function (evt) { 192 | var clickInfo = $(this).data(data_click) || [], 193 | clickTarget = $(this).data(data_target), 194 | isCancel = clickTarget && (clickTarget.hasClass("cancel") || clickTarget.attr('formnovalidate') !== undefined); 195 | evt.preventDefault(); 196 | if (!isCancel && !validate(this)) { 197 | return; 198 | } 199 | asyncRequest(this, { 200 | url: this.action, 201 | type: this.method || "GET", 202 | data: clickInfo.concat($(this).serializeArray()) 203 | }); 204 | }); 205 | }(jQuery)); 206 | -------------------------------------------------------------------------------- /Blip.Web/Scripts/jquery.unobtrusive-ajax.min.js: -------------------------------------------------------------------------------- 1 | // Unobtrusive Ajax support library for jQuery 2 | // Copyright (c) .NET Foundation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 4 | // @version v3.2.6 5 | // 6 | // Microsoft grants you the right to use these script files for the sole 7 | // purpose of either: (i) interacting through your browser with the Microsoft 8 | // website or online service, subject to the applicable licensing or use 9 | // terms; or (ii) using the files as included with a Microsoft product subject 10 | // to that product's license terms. Microsoft reserves all other rights to the 11 | // files not expressly granted by Microsoft, whether by implication, estoppel 12 | // or otherwise. Insofar as a script file is dual licensed under GPL, 13 | // Microsoft neither took the code under GPL nor distributes it thereunder but 14 | // under the terms set out in this paragraph. All notices and licenses 15 | // below are for informational purposes only. 16 | !function(t){function a(t,a){for(var e=window,r=(t||"").split(".");e&&r.length;)e=e[r.shift()];return"function"==typeof e?e:(a.push(t),Function.constructor.apply(null,a))}function e(t){return"GET"===t||"POST"===t}function r(t,a){e(a)||t.setRequestHeader("X-HTTP-Method-Override",a)}function n(a,e,r){var n;r.indexOf("application/x-javascript")===-1&&(n=(a.getAttribute("data-ajax-mode")||"").toUpperCase(),t(a.getAttribute("data-ajax-update")).each(function(a,r){switch(n){case"BEFORE":t(r).prepend(e);break;case"AFTER":t(r).append(e);break;case"REPLACE-WITH":t(r).replaceWith(e);break;default:t(r).html(e)}}))}function i(i,u){var o,c,d,s;if(o=i.getAttribute("data-ajax-confirm"),!o||window.confirm(o)){c=t(i.getAttribute("data-ajax-loading")),s=parseInt(i.getAttribute("data-ajax-loading-duration"),10)||0,t.extend(u,{type:i.getAttribute("data-ajax-method")||void 0,url:i.getAttribute("data-ajax-url")||void 0,cache:"true"===(i.getAttribute("data-ajax-cache")||"").toLowerCase(),beforeSend:function(t){var e;return r(t,d),e=a(i.getAttribute("data-ajax-begin"),["xhr"]).apply(i,arguments),e!==!1&&c.show(s),e},complete:function(){c.hide(s),a(i.getAttribute("data-ajax-complete"),["xhr","status"]).apply(i,arguments)},success:function(t,e,r){n(i,t,r.getResponseHeader("Content-Type")||"text/html"),a(i.getAttribute("data-ajax-success"),["data","status","xhr"]).apply(i,arguments)},error:function(){a(i.getAttribute("data-ajax-failure"),["xhr","status","error"]).apply(i,arguments)}}),u.data.push({name:"X-Requested-With",value:"XMLHttpRequest"}),d=u.type.toUpperCase(),e(d)||(u.type="POST",u.data.push({name:"X-HTTP-Method-Override",value:d}));var p=t(i);if(p.is("form")&&"multipart/form-data"==p.attr("enctype")){var f=new FormData;t.each(u.data,function(t,a){f.append(a.name,a.value)}),t("input[type=file]",p).each(function(){var a=this;t.each(a.files,function(t,e){f.append(a.name,e)})}),t.extend(u,{processData:!1,contentType:!1,data:f})}t.ajax(u)}}function u(a){var e=t(a).data(d);return!e||!e.validate||e.validate()}var o="unobtrusiveAjaxClick",c="unobtrusiveAjaxClickTarget",d="unobtrusiveValidation";t(document).on("click","a[data-ajax=true]",function(t){t.preventDefault(),i(this,{url:this.href,type:"GET",data:[]})}),t(document).on("click","form[data-ajax=true] input[type=image]",function(a){var e=a.target.name,r=t(a.target),n=t(r.parents("form")[0]),i=r.offset();n.data(o,[{name:e+".x",value:Math.round(a.pageX-i.left)},{name:e+".y",value:Math.round(a.pageY-i.top)}]),setTimeout(function(){n.removeData(o)},0)}),t(document).on("click","form[data-ajax=true] :submit",function(a){var e=a.currentTarget.name,r=t(a.target),n=t(r.parents("form")[0]);n.data(o,e?[{name:e,value:a.currentTarget.value}]:[]),n.data(c,r),setTimeout(function(){n.removeData(o),n.removeData(c)},0)}),t(document).on("submit","form[data-ajax=true]",function(a){var e=t(this).data(o)||[],r=t(this).data(c),n=r&&(r.hasClass("cancel")||void 0!==r.attr("formnovalidate"));a.preventDefault(),(n||u(this))&&i(this,{url:this.action,type:this.method||"GET",data:e.concat(t(this).serializeArray())})})}(jQuery); -------------------------------------------------------------------------------- /Blip.Web/Scripts/jquery.validate.unobtrusive.min.js: -------------------------------------------------------------------------------- 1 | // Unobtrusive validation support library for jQuery and jQuery Validate 2 | // Copyright (c) .NET Foundation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 4 | // @version v3.2.11 5 | !function(a){"function"==typeof define&&define.amd?define("jquery.validate.unobtrusive",["jquery-validation"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery-validation")):jQuery.validator.unobtrusive=a(jQuery)}(function(a){function e(a,e,n){a.rules[e]=n,a.message&&(a.messages[e]=a.message)}function n(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function t(a){return a.replace(/([!"#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function r(a){return a.substr(0,a.lastIndexOf(".")+1)}function i(a,e){return 0===a.indexOf("*.")&&(a=a.replace("*.",e)),a}function o(e,n){var r=a(this).find("[data-valmsg-for='"+t(n[0].name)+"']"),i=r.attr("data-valmsg-replace"),o=i?a.parseJSON(i)!==!1:null;r.removeClass("field-validation-valid").addClass("field-validation-error"),e.data("unobtrusiveContainer",r),o?(r.empty(),e.removeClass("input-validation-error").appendTo(r)):e.hide()}function d(e,n){var t=a(this).find("[data-valmsg-summary=true]"),r=t.find("ul");r&&r.length&&n.errorList.length&&(r.empty(),t.addClass("validation-summary-errors").removeClass("validation-summary-valid"),a.each(n.errorList,function(){a("
  • ").html(this.message).appendTo(r)}))}function s(e){var n=e.data("unobtrusiveContainer");if(n){var t=n.attr("data-valmsg-replace"),r=t?a.parseJSON(t):null;n.addClass("field-validation-valid").removeClass("field-validation-error"),e.removeData("unobtrusiveContainer"),r&&n.empty()}}function l(e){var n=a(this),t="__jquery_unobtrusive_validation_form_reset";if(!n.data(t)){n.data(t,!0);try{n.data("validator").resetForm()}finally{n.removeData(t)}n.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors"),n.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function u(e){var n=a(e),t=n.data(v),r=a.proxy(l,e),i=f.unobtrusive.options||{},u=function(n,t){var r=i[n];r&&a.isFunction(r)&&r.apply(e,t)};return t||(t={options:{errorClass:i.errorClass||"input-validation-error",errorElement:i.errorElement||"span",errorPlacement:function(){o.apply(e,arguments),u("errorPlacement",arguments)},invalidHandler:function(){d.apply(e,arguments),u("invalidHandler",arguments)},messages:{},rules:{},success:function(){s.apply(e,arguments),u("success",arguments)}},attachValidation:function(){n.off("reset."+v,r).on("reset."+v,r).validate(this.options)},validate:function(){return n.validate(),n.valid()}},n.data(v,t)),t}var m,f=a.validator,v="unobtrusiveValidation";return f.unobtrusive={adapters:[],parseElement:function(e,n){var t,r,i,o=a(e),d=o.parents("form")[0];d&&(t=u(d),t.options.rules[e.name]=r={},t.options.messages[e.name]=i={},a.each(this.adapters,function(){var n="data-val-"+this.name,t=o.attr(n),s={};void 0!==t&&(n+="-",a.each(this.params,function(){s[this]=o.attr(n+this)}),this.adapt({element:e,form:d,message:t,params:s,rules:r,messages:i}))}),a.extend(r,{__dummy__:!0}),n||t.attachValidation())},parse:function(e){var n=a(e),t=n.parents().addBack().filter("form").add(n.find("form")).has("[data-val=true]");n.find("[data-val=true]").each(function(){f.unobtrusive.parseElement(this,!0)}),t.each(function(){var a=u(this);a&&a.attachValidation()})}},m=f.unobtrusive.adapters,m.add=function(a,e,n){return n||(n=e,e=[]),this.push({name:a,params:e,adapt:n}),this},m.addBool=function(a,n){return this.add(a,function(t){e(t,n||a,!0)})},m.addMinMax=function(a,n,t,r,i,o){return this.add(a,[i||"min",o||"max"],function(a){var i=a.params.min,o=a.params.max;i&&o?e(a,r,[i,o]):i?e(a,n,i):o&&e(a,t,o)})},m.addSingleVal=function(a,n,t){return this.add(a,[n||"val"],function(r){e(r,t||a,r.params[n])})},f.addMethod("__dummy__",function(a,e,n){return!0}),f.addMethod("regex",function(a,e,n){var t;return!!this.optional(e)||(t=new RegExp(n).exec(a),t&&0===t.index&&t[0].length===a.length)}),f.addMethod("nonalphamin",function(a,e,n){var t;return n&&(t=a.match(/\W/g),t=t&&t.length>=n),t}),f.methods.extension?(m.addSingleVal("accept","mimtype"),m.addSingleVal("extension","extension")):m.addSingleVal("extension","extension","accept"),m.addSingleVal("regex","pattern"),m.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),m.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),m.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength"),m.add("equalto",["other"],function(n){var o=r(n.element.name),d=n.params.other,s=i(d,o),l=a(n.form).find(":input").filter("[name='"+t(s)+"']")[0];e(n,"equalTo",l)}),m.add("required",function(a){"INPUT"===a.element.tagName.toUpperCase()&&"CHECKBOX"===a.element.type.toUpperCase()||e(a,"required",!0)}),m.add("remote",["url","type","additionalfields"],function(o){var d={url:o.params.url,type:o.params.type||"GET",data:{}},s=r(o.element.name);a.each(n(o.params.additionalfields||o.element.name),function(e,n){var r=i(n,s);d.data[r]=function(){var e=a(o.form).find(":input").filter("[name='"+t(r)+"']");return e.is(":checkbox")?e.filter(":checked").val()||e.filter(":hidden").val()||"":e.is(":radio")?e.filter(":checked").val()||"":e.val()}}),e(o,"remote",d)}),m.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&e(a,"minlength",a.params.min),a.params.nonalphamin&&e(a,"nonalphamin",a.params.nonalphamin),a.params.regex&&e(a,"regex",a.params.regex)}),m.add("fileextensions",["extensions"],function(a){e(a,"extension",a.params.extensions)}),a(function(){f.unobtrusive.parse(document)}),f.unobtrusive}); -------------------------------------------------------------------------------- /Blip.Web/Scripts/respond.js: -------------------------------------------------------------------------------- 1 | /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */ 2 | /*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */ 3 | (function(w) { 4 | "use strict"; 5 | w.matchMedia = w.matchMedia || function(doc, undefined) { 6 | var bool, docElem = doc.documentElement, refNode = docElem.firstElementChild || docElem.firstChild, fakeBody = doc.createElement("body"), div = doc.createElement("div"); 7 | div.id = "mq-test-1"; 8 | div.style.cssText = "position:absolute;top:-100em"; 9 | fakeBody.style.background = "none"; 10 | fakeBody.appendChild(div); 11 | return function(q) { 12 | div.innerHTML = '­'; 13 | docElem.insertBefore(fakeBody, refNode); 14 | bool = div.offsetWidth === 42; 15 | docElem.removeChild(fakeBody); 16 | return { 17 | matches: bool, 18 | media: q 19 | }; 20 | }; 21 | }(w.document); 22 | })(this); 23 | 24 | /*! Respond.js v1.4.0: min/max-width media query polyfill. (c) Scott Jehl. MIT Lic. j.mp/respondjs */ 25 | (function(w) { 26 | "use strict"; 27 | var respond = {}; 28 | w.respond = respond; 29 | respond.update = function() {}; 30 | var requestQueue = [], xmlHttp = function() { 31 | var xmlhttpmethod = false; 32 | try { 33 | xmlhttpmethod = new w.XMLHttpRequest(); 34 | } catch (e) { 35 | xmlhttpmethod = new w.ActiveXObject("Microsoft.XMLHTTP"); 36 | } 37 | return function() { 38 | return xmlhttpmethod; 39 | }; 40 | }(), ajax = function(url, callback) { 41 | var req = xmlHttp(); 42 | if (!req) { 43 | return; 44 | } 45 | req.open("GET", url, true); 46 | req.onreadystatechange = function() { 47 | if (req.readyState !== 4 || req.status !== 200 && req.status !== 304) { 48 | return; 49 | } 50 | callback(req.responseText); 51 | }; 52 | if (req.readyState === 4) { 53 | return; 54 | } 55 | req.send(null); 56 | }; 57 | respond.ajax = ajax; 58 | respond.queue = requestQueue; 59 | respond.regex = { 60 | media: /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi, 61 | keyframes: /@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi, 62 | urls: /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g, 63 | findStyles: /@media *([^\{]+)\{([\S\s]+?)$/, 64 | only: /(only\s+)?([a-zA-Z]+)\s?/, 65 | minw: /\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/, 66 | maxw: /\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ 67 | }; 68 | respond.mediaQueriesSupported = w.matchMedia && w.matchMedia("only all") !== null && w.matchMedia("only all").matches; 69 | if (respond.mediaQueriesSupported) { 70 | return; 71 | } 72 | var doc = w.document, docElem = doc.documentElement, mediastyles = [], rules = [], appendedEls = [], parsedSheets = {}, resizeThrottle = 30, head = doc.getElementsByTagName("head")[0] || docElem, base = doc.getElementsByTagName("base")[0], links = head.getElementsByTagName("link"), lastCall, resizeDefer, eminpx, getEmValue = function() { 73 | var ret, div = doc.createElement("div"), body = doc.body, originalHTMLFontSize = docElem.style.fontSize, originalBodyFontSize = body && body.style.fontSize, fakeUsed = false; 74 | div.style.cssText = "position:absolute;font-size:1em;width:1em"; 75 | if (!body) { 76 | body = fakeUsed = doc.createElement("body"); 77 | body.style.background = "none"; 78 | } 79 | docElem.style.fontSize = "100%"; 80 | body.style.fontSize = "100%"; 81 | body.appendChild(div); 82 | if (fakeUsed) { 83 | docElem.insertBefore(body, docElem.firstChild); 84 | } 85 | ret = div.offsetWidth; 86 | if (fakeUsed) { 87 | docElem.removeChild(body); 88 | } else { 89 | body.removeChild(div); 90 | } 91 | docElem.style.fontSize = originalHTMLFontSize; 92 | if (originalBodyFontSize) { 93 | body.style.fontSize = originalBodyFontSize; 94 | } 95 | ret = eminpx = parseFloat(ret); 96 | return ret; 97 | }, applyMedia = function(fromResize) { 98 | var name = "clientWidth", docElemProp = docElem[name], currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[name] || docElemProp, styleBlocks = {}, lastLink = links[links.length - 1], now = new Date().getTime(); 99 | if (fromResize && lastCall && now - lastCall < resizeThrottle) { 100 | w.clearTimeout(resizeDefer); 101 | resizeDefer = w.setTimeout(applyMedia, resizeThrottle); 102 | return; 103 | } else { 104 | lastCall = now; 105 | } 106 | for (var i in mediastyles) { 107 | if (mediastyles.hasOwnProperty(i)) { 108 | var thisstyle = mediastyles[i], min = thisstyle.minw, max = thisstyle.maxw, minnull = min === null, maxnull = max === null, em = "em"; 109 | if (!!min) { 110 | min = parseFloat(min) * (min.indexOf(em) > -1 ? eminpx || getEmValue() : 1); 111 | } 112 | if (!!max) { 113 | max = parseFloat(max) * (max.indexOf(em) > -1 ? eminpx || getEmValue() : 1); 114 | } 115 | if (!thisstyle.hasquery || (!minnull || !maxnull) && (minnull || currWidth >= min) && (maxnull || currWidth <= max)) { 116 | if (!styleBlocks[thisstyle.media]) { 117 | styleBlocks[thisstyle.media] = []; 118 | } 119 | styleBlocks[thisstyle.media].push(rules[thisstyle.rules]); 120 | } 121 | } 122 | } 123 | for (var j in appendedEls) { 124 | if (appendedEls.hasOwnProperty(j)) { 125 | if (appendedEls[j] && appendedEls[j].parentNode === head) { 126 | head.removeChild(appendedEls[j]); 127 | } 128 | } 129 | } 130 | appendedEls.length = 0; 131 | for (var k in styleBlocks) { 132 | if (styleBlocks.hasOwnProperty(k)) { 133 | var ss = doc.createElement("style"), css = styleBlocks[k].join("\n"); 134 | ss.type = "text/css"; 135 | ss.media = k; 136 | head.insertBefore(ss, lastLink.nextSibling); 137 | if (ss.styleSheet) { 138 | ss.styleSheet.cssText = css; 139 | } else { 140 | ss.appendChild(doc.createTextNode(css)); 141 | } 142 | appendedEls.push(ss); 143 | } 144 | } 145 | }, translate = function(styles, href, media) { 146 | var qs = styles.replace(respond.regex.keyframes, "").match(respond.regex.media), ql = qs && qs.length || 0; 147 | href = href.substring(0, href.lastIndexOf("/")); 148 | var repUrls = function(css) { 149 | return css.replace(respond.regex.urls, "$1" + href + "$2$3"); 150 | }, useMedia = !ql && media; 151 | if (href.length) { 152 | href += "/"; 153 | } 154 | if (useMedia) { 155 | ql = 1; 156 | } 157 | for (var i = 0; i < ql; i++) { 158 | var fullq, thisq, eachq, eql; 159 | if (useMedia) { 160 | fullq = media; 161 | rules.push(repUrls(styles)); 162 | } else { 163 | fullq = qs[i].match(respond.regex.findStyles) && RegExp.$1; 164 | rules.push(RegExp.$2 && repUrls(RegExp.$2)); 165 | } 166 | eachq = fullq.split(","); 167 | eql = eachq.length; 168 | for (var j = 0; j < eql; j++) { 169 | thisq = eachq[j]; 170 | mediastyles.push({ 171 | media: thisq.split("(")[0].match(respond.regex.only) && RegExp.$2 || "all", 172 | rules: rules.length - 1, 173 | hasquery: thisq.indexOf("(") > -1, 174 | minw: thisq.match(respond.regex.minw) && parseFloat(RegExp.$1) + (RegExp.$2 || ""), 175 | maxw: thisq.match(respond.regex.maxw) && parseFloat(RegExp.$1) + (RegExp.$2 || "") 176 | }); 177 | } 178 | } 179 | applyMedia(); 180 | }, makeRequests = function() { 181 | if (requestQueue.length) { 182 | var thisRequest = requestQueue.shift(); 183 | ajax(thisRequest.href, function(styles) { 184 | translate(styles, thisRequest.href, thisRequest.media); 185 | parsedSheets[thisRequest.href] = true; 186 | w.setTimeout(function() { 187 | makeRequests(); 188 | }, 0); 189 | }); 190 | } 191 | }, ripCSS = function() { 192 | for (var i = 0; i < links.length; i++) { 193 | var sheet = links[i], href = sheet.href, media = sheet.media, isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet"; 194 | if (!!href && isCSS && !parsedSheets[href]) { 195 | if (sheet.styleSheet && sheet.styleSheet.rawCssText) { 196 | translate(sheet.styleSheet.rawCssText, href, media); 197 | parsedSheets[href] = true; 198 | } else { 199 | if (!/^([a-zA-Z:]*\/\/)/.test(href) && !base || href.replace(RegExp.$1, "").split("/")[0] === w.location.host) { 200 | if (href.substring(0, 2) === "//") { 201 | href = w.location.protocol + href; 202 | } 203 | requestQueue.push({ 204 | href: href, 205 | media: media 206 | }); 207 | } 208 | } 209 | } 210 | } 211 | makeRequests(); 212 | }; 213 | ripCSS(); 214 | respond.update = ripCSS; 215 | respond.getEmValue = getEmValue; 216 | function callMedia() { 217 | applyMedia(true); 218 | } 219 | if (w.addEventListener) { 220 | w.addEventListener("resize", callMedia, false); 221 | } else if (w.attachEvent) { 222 | w.attachEvent("onresize", callMedia); 223 | } 224 | })(this); -------------------------------------------------------------------------------- /Blip.Web/Scripts/respond.matchmedia.addListener.js: -------------------------------------------------------------------------------- 1 | /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */ 2 | /*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */ 3 | (function(w) { 4 | "use strict"; 5 | w.matchMedia = w.matchMedia || function(doc, undefined) { 6 | var bool, docElem = doc.documentElement, refNode = docElem.firstElementChild || docElem.firstChild, fakeBody = doc.createElement("body"), div = doc.createElement("div"); 7 | div.id = "mq-test-1"; 8 | div.style.cssText = "position:absolute;top:-100em"; 9 | fakeBody.style.background = "none"; 10 | fakeBody.appendChild(div); 11 | return function(q) { 12 | div.innerHTML = '­'; 13 | docElem.insertBefore(fakeBody, refNode); 14 | bool = div.offsetWidth === 42; 15 | docElem.removeChild(fakeBody); 16 | return { 17 | matches: bool, 18 | media: q 19 | }; 20 | }; 21 | }(w.document); 22 | })(this); 23 | 24 | /*! matchMedia() polyfill addListener/removeListener extension. Author & copyright (c) 2012: Scott Jehl. Dual MIT/BSD license */ 25 | (function(w) { 26 | "use strict"; 27 | if (w.matchMedia && w.matchMedia("all").addListener) { 28 | return false; 29 | } 30 | var localMatchMedia = w.matchMedia, hasMediaQueries = localMatchMedia("only all").matches, isListening = false, timeoutID = 0, queries = [], handleChange = function(evt) { 31 | w.clearTimeout(timeoutID); 32 | timeoutID = w.setTimeout(function() { 33 | for (var i = 0, il = queries.length; i < il; i++) { 34 | var mql = queries[i].mql, listeners = queries[i].listeners || [], matches = localMatchMedia(mql.media).matches; 35 | if (matches !== mql.matches) { 36 | mql.matches = matches; 37 | for (var j = 0, jl = listeners.length; j < jl; j++) { 38 | listeners[j].call(w, mql); 39 | } 40 | } 41 | } 42 | }, 30); 43 | }; 44 | w.matchMedia = function(media) { 45 | var mql = localMatchMedia(media), listeners = [], index = 0; 46 | mql.addListener = function(listener) { 47 | if (!hasMediaQueries) { 48 | return; 49 | } 50 | if (!isListening) { 51 | isListening = true; 52 | w.addEventListener("resize", handleChange, true); 53 | } 54 | if (index === 0) { 55 | index = queries.push({ 56 | mql: mql, 57 | listeners: listeners 58 | }); 59 | } 60 | listeners.push(listener); 61 | }; 62 | mql.removeListener = function(listener) { 63 | for (var i = 0, il = listeners.length; i < il; i++) { 64 | if (listeners[i] === listener) { 65 | listeners.splice(i, 1); 66 | } 67 | } 68 | }; 69 | return mql; 70 | }; 71 | })(this); 72 | 73 | /*! Respond.js v1.4.0: min/max-width media query polyfill. (c) Scott Jehl. MIT Lic. j.mp/respondjs */ 74 | (function(w) { 75 | "use strict"; 76 | var respond = {}; 77 | w.respond = respond; 78 | respond.update = function() {}; 79 | var requestQueue = [], xmlHttp = function() { 80 | var xmlhttpmethod = false; 81 | try { 82 | xmlhttpmethod = new w.XMLHttpRequest(); 83 | } catch (e) { 84 | xmlhttpmethod = new w.ActiveXObject("Microsoft.XMLHTTP"); 85 | } 86 | return function() { 87 | return xmlhttpmethod; 88 | }; 89 | }(), ajax = function(url, callback) { 90 | var req = xmlHttp(); 91 | if (!req) { 92 | return; 93 | } 94 | req.open("GET", url, true); 95 | req.onreadystatechange = function() { 96 | if (req.readyState !== 4 || req.status !== 200 && req.status !== 304) { 97 | return; 98 | } 99 | callback(req.responseText); 100 | }; 101 | if (req.readyState === 4) { 102 | return; 103 | } 104 | req.send(null); 105 | }; 106 | respond.ajax = ajax; 107 | respond.queue = requestQueue; 108 | respond.regex = { 109 | media: /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi, 110 | keyframes: /@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi, 111 | urls: /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g, 112 | findStyles: /@media *([^\{]+)\{([\S\s]+?)$/, 113 | only: /(only\s+)?([a-zA-Z]+)\s?/, 114 | minw: /\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/, 115 | maxw: /\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ 116 | }; 117 | respond.mediaQueriesSupported = w.matchMedia && w.matchMedia("only all") !== null && w.matchMedia("only all").matches; 118 | if (respond.mediaQueriesSupported) { 119 | return; 120 | } 121 | var doc = w.document, docElem = doc.documentElement, mediastyles = [], rules = [], appendedEls = [], parsedSheets = {}, resizeThrottle = 30, head = doc.getElementsByTagName("head")[0] || docElem, base = doc.getElementsByTagName("base")[0], links = head.getElementsByTagName("link"), lastCall, resizeDefer, eminpx, getEmValue = function() { 122 | var ret, div = doc.createElement("div"), body = doc.body, originalHTMLFontSize = docElem.style.fontSize, originalBodyFontSize = body && body.style.fontSize, fakeUsed = false; 123 | div.style.cssText = "position:absolute;font-size:1em;width:1em"; 124 | if (!body) { 125 | body = fakeUsed = doc.createElement("body"); 126 | body.style.background = "none"; 127 | } 128 | docElem.style.fontSize = "100%"; 129 | body.style.fontSize = "100%"; 130 | body.appendChild(div); 131 | if (fakeUsed) { 132 | docElem.insertBefore(body, docElem.firstChild); 133 | } 134 | ret = div.offsetWidth; 135 | if (fakeUsed) { 136 | docElem.removeChild(body); 137 | } else { 138 | body.removeChild(div); 139 | } 140 | docElem.style.fontSize = originalHTMLFontSize; 141 | if (originalBodyFontSize) { 142 | body.style.fontSize = originalBodyFontSize; 143 | } 144 | ret = eminpx = parseFloat(ret); 145 | return ret; 146 | }, applyMedia = function(fromResize) { 147 | var name = "clientWidth", docElemProp = docElem[name], currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[name] || docElemProp, styleBlocks = {}, lastLink = links[links.length - 1], now = new Date().getTime(); 148 | if (fromResize && lastCall && now - lastCall < resizeThrottle) { 149 | w.clearTimeout(resizeDefer); 150 | resizeDefer = w.setTimeout(applyMedia, resizeThrottle); 151 | return; 152 | } else { 153 | lastCall = now; 154 | } 155 | for (var i in mediastyles) { 156 | if (mediastyles.hasOwnProperty(i)) { 157 | var thisstyle = mediastyles[i], min = thisstyle.minw, max = thisstyle.maxw, minnull = min === null, maxnull = max === null, em = "em"; 158 | if (!!min) { 159 | min = parseFloat(min) * (min.indexOf(em) > -1 ? eminpx || getEmValue() : 1); 160 | } 161 | if (!!max) { 162 | max = parseFloat(max) * (max.indexOf(em) > -1 ? eminpx || getEmValue() : 1); 163 | } 164 | if (!thisstyle.hasquery || (!minnull || !maxnull) && (minnull || currWidth >= min) && (maxnull || currWidth <= max)) { 165 | if (!styleBlocks[thisstyle.media]) { 166 | styleBlocks[thisstyle.media] = []; 167 | } 168 | styleBlocks[thisstyle.media].push(rules[thisstyle.rules]); 169 | } 170 | } 171 | } 172 | for (var j in appendedEls) { 173 | if (appendedEls.hasOwnProperty(j)) { 174 | if (appendedEls[j] && appendedEls[j].parentNode === head) { 175 | head.removeChild(appendedEls[j]); 176 | } 177 | } 178 | } 179 | appendedEls.length = 0; 180 | for (var k in styleBlocks) { 181 | if (styleBlocks.hasOwnProperty(k)) { 182 | var ss = doc.createElement("style"), css = styleBlocks[k].join("\n"); 183 | ss.type = "text/css"; 184 | ss.media = k; 185 | head.insertBefore(ss, lastLink.nextSibling); 186 | if (ss.styleSheet) { 187 | ss.styleSheet.cssText = css; 188 | } else { 189 | ss.appendChild(doc.createTextNode(css)); 190 | } 191 | appendedEls.push(ss); 192 | } 193 | } 194 | }, translate = function(styles, href, media) { 195 | var qs = styles.replace(respond.regex.keyframes, "").match(respond.regex.media), ql = qs && qs.length || 0; 196 | href = href.substring(0, href.lastIndexOf("/")); 197 | var repUrls = function(css) { 198 | return css.replace(respond.regex.urls, "$1" + href + "$2$3"); 199 | }, useMedia = !ql && media; 200 | if (href.length) { 201 | href += "/"; 202 | } 203 | if (useMedia) { 204 | ql = 1; 205 | } 206 | for (var i = 0; i < ql; i++) { 207 | var fullq, thisq, eachq, eql; 208 | if (useMedia) { 209 | fullq = media; 210 | rules.push(repUrls(styles)); 211 | } else { 212 | fullq = qs[i].match(respond.regex.findStyles) && RegExp.$1; 213 | rules.push(RegExp.$2 && repUrls(RegExp.$2)); 214 | } 215 | eachq = fullq.split(","); 216 | eql = eachq.length; 217 | for (var j = 0; j < eql; j++) { 218 | thisq = eachq[j]; 219 | mediastyles.push({ 220 | media: thisq.split("(")[0].match(respond.regex.only) && RegExp.$2 || "all", 221 | rules: rules.length - 1, 222 | hasquery: thisq.indexOf("(") > -1, 223 | minw: thisq.match(respond.regex.minw) && parseFloat(RegExp.$1) + (RegExp.$2 || ""), 224 | maxw: thisq.match(respond.regex.maxw) && parseFloat(RegExp.$1) + (RegExp.$2 || "") 225 | }); 226 | } 227 | } 228 | applyMedia(); 229 | }, makeRequests = function() { 230 | if (requestQueue.length) { 231 | var thisRequest = requestQueue.shift(); 232 | ajax(thisRequest.href, function(styles) { 233 | translate(styles, thisRequest.href, thisRequest.media); 234 | parsedSheets[thisRequest.href] = true; 235 | w.setTimeout(function() { 236 | makeRequests(); 237 | }, 0); 238 | }); 239 | } 240 | }, ripCSS = function() { 241 | for (var i = 0; i < links.length; i++) { 242 | var sheet = links[i], href = sheet.href, media = sheet.media, isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet"; 243 | if (!!href && isCSS && !parsedSheets[href]) { 244 | if (sheet.styleSheet && sheet.styleSheet.rawCssText) { 245 | translate(sheet.styleSheet.rawCssText, href, media); 246 | parsedSheets[href] = true; 247 | } else { 248 | if (!/^([a-zA-Z:]*\/\/)/.test(href) && !base || href.replace(RegExp.$1, "").split("/")[0] === w.location.host) { 249 | if (href.substring(0, 2) === "//") { 250 | href = w.location.protocol + href; 251 | } 252 | requestQueue.push({ 253 | href: href, 254 | media: media 255 | }); 256 | } 257 | } 258 | } 259 | } 260 | makeRequests(); 261 | }; 262 | ripCSS(); 263 | respond.update = ripCSS; 264 | respond.getEmValue = getEmValue; 265 | function callMedia() { 266 | applyMedia(true); 267 | } 268 | if (w.addEventListener) { 269 | w.addEventListener("resize", callMedia, false); 270 | } else if (w.attachEvent) { 271 | w.attachEvent("onresize", callMedia); 272 | } 273 | })(this); -------------------------------------------------------------------------------- /Blip.Web/Scripts/respond.matchmedia.addListener.min.js: -------------------------------------------------------------------------------- 1 | /*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl 2 | * Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT 3 | * */ 4 | 5 | !function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";if(a.matchMedia&&a.matchMedia("all").addListener)return!1;var b=a.matchMedia,c=b("only all").matches,d=!1,e=0,f=[],g=function(){a.clearTimeout(e),e=a.setTimeout(function(){for(var c=0,d=f.length;d>c;c++){var e=f[c].mql,g=f[c].listeners||[],h=b(e.media).matches;if(h!==e.matches){e.matches=h;for(var i=0,j=g.length;j>i;i++)g[i].call(a,e)}}},30)};a.matchMedia=function(e){var h=b(e),i=[],j=0;return h.addListener=function(b){c&&(d||(d=!0,a.addEventListener("resize",g,!0)),0===j&&(j=f.push({mql:h,listeners:i})),i.push(b))},h.removeListener=function(a){for(var b=0,c=i.length;c>b;b++)i[b]===a&&i.splice(b,1)},h}}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b #mq-test-1 { width: 42px; }',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b 8 |
    9 |

    Select an address type to add

    10 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 11 | @Html.HiddenFor(model => model.CustomerID) 12 |
    13 | @Html.LabelFor(model => model.SelectedAddressType, htmlAttributes: new { @class = "control-label col-md-2", id="AddressTypeLabel" }) 14 |
    15 | @Html.DropDownListFor(model => model.SelectedAddressType, new SelectList(Model.AddressTypes, "Value", "Text"), htmlAttributes: new { @class = "form-control", id="AddressType" } ) 16 | @Html.ValidationMessageFor(model => model.SelectedAddressType, "", new { @class = "text-danger" }) 17 |
    18 |
    19 | 20 |
    21 |
    22 | 23 |
    24 |
    25 | 26 | } 27 | -------------------------------------------------------------------------------- /Blip.Web/Views/Customer/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model Blip.Entities.Customers.ViewModels.CustomerEditViewModel 2 | 3 | @{ 4 | ViewBag.Title = "Customer"; 5 | } 6 |

    Customer

    7 | 8 | 9 | @using (Html.BeginForm()) 10 | { 11 | @Html.AntiForgeryToken() 12 | 13 |
    14 |

    Create a new customer by entering the customer name, country, and region.

    15 |
    16 |
    17 | @Html.LabelFor(model => model.CustomerID, htmlAttributes: new { @class = "control-label col-md-2" }) 18 |
    19 | @Html.EditorFor(model => model.CustomerID, new { htmlAttributes = new { @class = "form-control", @readonly = "readonly" } }) 20 | @Html.ValidationMessageFor(model => model.CustomerID, "", new { @class = "text-danger" }) 21 |
    22 |
    23 |
    24 | @Html.LabelFor(model => model.CustomerName, htmlAttributes: new { @class = "control-label col-md-2" }) 25 |
    26 | @Html.EditorFor(model => model.CustomerName, new { htmlAttributes = new { @class = "form-control", @autofocus = "autofocus" } }) 27 | @Html.ValidationMessageFor(model => model.CustomerID, "", new { @class = "text-danger" }) 28 |
    29 |
    30 |
    31 | @Html.LabelFor(x => Model.SelectedCountryIso3, htmlAttributes: new { @class = "control-label col-md-2" }) 32 |
    33 | @Html.DropDownListFor(x => Model.SelectedCountryIso3, new SelectList(Model.Countries, "Value", "Text"), htmlAttributes: new { @class = "form-control", @id = "Country" }) 34 | @Html.ValidationMessageFor(x => x.SelectedCountryIso3, "", new { @class = "text-danger" }) 35 |
    36 |
    37 |
    38 | @Html.LabelFor(x => Model.SelectedRegionCode, htmlAttributes: new { @class = "control-label col-md-2" }) 39 |
    40 | @Html.DropDownListFor(x => Model.SelectedRegionCode, new SelectList(Model.Regions, "Value", "Text"), htmlAttributes: new { @class = "form-control", @id = "Region" }) 41 | @Html.ValidationMessageFor(x => x.SelectedRegionCode, "", new { @class = "text-danger" }) 42 |
    43 |
    44 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 45 |
    46 |
    47 | 48 |
    49 |
    50 |
    51 | } 52 | 53 |
    54 | @Html.ActionLink("Back to List", "Index") 55 |
    56 | 57 | @section Scripts { 58 | @Scripts.Render("~/bundles/jqueryval") @*For validate and validate-unobtrusive*@ 59 | 83 | } 84 | -------------------------------------------------------------------------------- /Blip.Web/Views/Customer/CreateEmailAddressPartial.cshtml: -------------------------------------------------------------------------------- 1 | @model Blip.Entities.Customers.ViewModels.EmailAddressViewModel 2 | 3 | @using (Html.BeginForm("CreateEmailAddressPartial", "Customer", FormMethod.Post )) 4 | { 5 | @Html.AntiForgeryToken() 6 | 7 |
    8 |
    9 |

    Add a new Email Address

    10 | @Html.HiddenFor(model => model.CustomerID) 11 |
    12 | @Html.LabelFor(model => model.Email, htmlAttributes: new { @class = "control-label col-md-2" }) 13 |
    14 | @Html.EditorFor(model => model.Email, new { htmlAttributes = new { @class = "form-control", id="email" } }) 15 | @Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" }) 16 |
    17 |
    18 | 19 |
    20 |
    21 | 22 |
    23 |
    24 |
    25 | } -------------------------------------------------------------------------------- /Blip.Web/Views/Customer/CreatePostalAddressPartial.cshtml: -------------------------------------------------------------------------------- 1 | @model Blip.Entities.Customers.ViewModels.PostalAddressEditViewModel 2 | 3 | 13 | 14 | @using (Html.BeginForm("CreatePostalAddressPartial", "Customer", FormMethod.Post)) 15 | { 16 | @Html.AntiForgeryToken() 17 | 18 |
    19 |
    20 |

    Add a new postal address

    21 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 22 | @Html.HiddenFor(model => model.CustomerID) 23 |
    24 | @Html.LabelFor(model => model.PostalAddressID, htmlAttributes: new { @class = "control-label col-md-2" }) 25 |
    26 | @Html.EditorFor(model => model.PostalAddressID, new { htmlAttributes = new { @class = "form-control", @readonly = "readonly" } }) 27 |
    28 |
    29 | 30 |
    31 | @Html.LabelFor(model => model.StreetAddress1, htmlAttributes: new { @class = "control-label col-md-2" }) 32 |
    33 | @Html.EditorFor(model => model.StreetAddress1, new { htmlAttributes = new { @class = "form-control" } }) 34 | @Html.ValidationMessageFor(model => model.StreetAddress1, "", new { @class = "text-danger" }) 35 |
    36 |
    37 | 38 |
    39 | @Html.LabelFor(model => model.StreetAddress2, htmlAttributes: new { @class = "control-label col-md-2" }) 40 |
    41 | @Html.EditorFor(model => model.StreetAddress2, new { htmlAttributes = new { @class = "form-control" } }) 42 | @Html.ValidationMessageFor(model => model.StreetAddress2, "", new { @class = "text-danger" }) 43 |
    44 |
    45 | 46 |
    47 | @Html.LabelFor(model => model.City, htmlAttributes: new { @class = "control-label col-md-2" }) 48 |
    49 | @Html.EditorFor(model => model.City, new { htmlAttributes = new { @class = "form-control" } }) 50 | @Html.ValidationMessageFor(model => model.City, "", new { @class = "text-danger" }) 51 |
    52 |
    53 | 54 |
    55 | @Html.LabelFor(model => model.PostalCode, htmlAttributes: new { @class = "control-label col-md-2" }) 56 |
    57 | @Html.EditorFor(model => model.PostalCode, new { htmlAttributes = new { @class = "form-control" } }) 58 | @Html.ValidationMessageFor(model => model.PostalCode, "", new { @class = "text-danger" }) 59 |
    60 |
    61 | 62 |
    63 | @Html.LabelFor(model => Model.SelectedCountryIso3, htmlAttributes: new { @class = "control-label col-md-2" }) 64 |
    65 | @Html.DropDownListFor(model => Model.SelectedCountryIso3, new SelectList(Model.Countries, "Value", "Text"), htmlAttributes: new { @class = "form-control", @id = "AddressCountry" }) 66 | @Html.ValidationMessageFor(model => Model.SelectedCountryIso3, "", new { @class = "text-danger" }) 67 |
    68 |
    69 |
    70 | @Html.LabelFor(model => Model.SelectedRegionCode, htmlAttributes: new { @class = "control-label col-md-2" }) 71 |
    72 | @Html.DropDownListFor(model => Model.SelectedRegionCode, new SelectList(Model.Regions, "Value", "Text"), htmlAttributes: new { @class = "form-control", @id = "AddressRegion" }) 73 | @Html.ValidationMessageFor(model => Model.SelectedRegionCode, "", new { @class = "text-danger" }) 74 |
    75 |
    76 | 77 |
    78 |
    79 | 80 |
    81 |
    82 |
    83 | } -------------------------------------------------------------------------------- /Blip.Web/Views/Customer/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @*Models are in partial views.*@ 2 | 3 | @section header { 4 | 5 | } 6 | 7 | @{ 8 | ViewBag.Title = "Edit Customer Information"; 9 | } 10 | 11 |
    12 |
    13 |

    Edit Customer Information

    14 |
    15 |
    16 | 17 |
    18 | @Html.Action("EditCustomerPartial", new { id = Url.RequestContext.RouteData.Values["id"] }) 19 |
    20 | 21 |
    22 | @Html.Action("AddressTypePartial", new { id = Url.RequestContext.RouteData.Values["id"] }) 23 |
    24 | 25 |
    26 | 27 |
    28 |
    29 |
    30 |
    31 |
    32 | @Html.ActionLink("Back to List", "Index") 33 |
    34 |
    35 |
    36 |
    37 | 38 | @section Scripts { 39 | @Scripts.Render("~/bundles/jqueryunobtrusive") @*For unobtrusive-ajax*@ 40 | @Scripts.Render("~/bundles/jqueryval") @*For validate and validate-unobtrusive*@ 41 | 42 | 79 | } -------------------------------------------------------------------------------- /Blip.Web/Views/Customer/EditCustomerPartial.cshtml: -------------------------------------------------------------------------------- 1 | @model Blip.Entities.Customers.ViewModels.CustomerEditViewModel 2 | 3 | @{ 4 | Layout = null; 5 | } 6 | 7 | @using (Html.BeginForm("EditCustomerPartial", "Customer", FormMethod.Post)) 8 | { 9 | @Html.AntiForgeryToken() 10 | 11 |
    12 |
    13 |

    Edit customer details

    14 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 15 |
    16 | @Html.LabelFor(model => model.CustomerID, htmlAttributes: new { @class = "control-label col-md-2" }) 17 |
    18 | @Html.EditorFor(model => model.CustomerID, new { htmlAttributes = new { @class = "form-control", @readonly = "readonly" } }) 19 |
    20 |
    21 | 22 |
    23 | @Html.LabelFor(model => model.CustomerName, htmlAttributes: new { @class = "control-label col-md-2" }) 24 |
    25 | @Html.EditorFor(model => model.CustomerName, new { htmlAttributes = new { @class = "form-control" } }) 26 | @Html.ValidationMessageFor(model => model.CustomerName, "", new { @class = "text-danger" }) 27 |
    28 |
    29 | 30 |
    31 | @Html.LabelFor(model => model.SelectedCountryIso3, htmlAttributes: new { @class = "control-label col-md-2" }) 32 |
    33 | @Html.DropDownListFor(model => model.SelectedCountryIso3, new SelectList(Model.Countries, "Value", "Text"), htmlAttributes: new { @class = "form-control", @id="Country" }) 34 | @Html.ValidationMessageFor(model => model.SelectedCountryIso3, "", new { @class = "text-danger" }) 35 |
    36 |
    37 | 38 |
    39 | @Html.LabelFor(model => model.SelectedRegionCode, htmlAttributes: new { @class = "control-label col-md-2" }) 40 |
    41 | @Html.DropDownListFor(model => model.SelectedRegionCode, new SelectList(Model.Regions, "Value", "Text"), htmlAttributes: new { @class = "form-control", @id="Region" }) 42 | @Html.ValidationMessageFor(model => model.SelectedRegionCode, "", new { @class = "text-danger" }) 43 |
    44 |
    45 | 46 |
    47 |
    48 | 49 |
    50 |
    51 |
    52 | } -------------------------------------------------------------------------------- /Blip.Web/Views/Customer/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "Customer List"; 5 | } 6 | 7 |

    Customer List

    8 |

    9 | To see the dropdown lists in action, click "Create New". 10 |

    11 | 12 |

    13 | @Html.ActionLink("Create New", "Create") 14 |

    15 | 16 | 17 | 20 | 23 | 26 | 29 | 30 | 31 | 32 | @foreach(var item in Model) 33 | { 34 | 35 | 38 | 41 | 44 | 47 | 52 | 53 | } 54 | 55 |
    18 | @Html.DisplayNameFor(model => model.CustomerID) 19 | 21 | @Html.DisplayNameFor(model => model.CustomerName) 22 | 24 | @Html.DisplayNameFor(model => model.CountryName) 25 | 27 | @Html.DisplayNameFor(model => model.RegionName) 28 |
    36 | @Html.DisplayFor(modelItem => item.CustomerID) 37 | 39 | @Html.DisplayFor(modelItem => item.CustomerName) 40 | 42 | @Html.DisplayFor(modelItem => item.CountryName) 43 | 45 | @Html.DisplayFor(modelItem => item.RegionName) 46 | 48 | @Html.ActionLink("Edit", "Edit", new { id=item.CustomerID }) @*| 49 | @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) | 50 | @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })*@ 51 |
    56 | -------------------------------------------------------------------------------- /Blip.Web/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "About"; 3 | } 4 |

    @ViewBag.Title.

    5 |

    @ViewBag.Message

    6 | 7 |

    Use this area to provide additional information.

    8 | -------------------------------------------------------------------------------- /Blip.Web/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 |
    -------------------------------------------------------------------------------- /Blip.Web/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Home Page"; 3 | } 4 | 5 |
    6 |

    ASP.NET

    7 |

    ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.

    8 |

    Learn more »

    9 |
    10 | 11 |
    12 |
    13 |

    PluralSight Hack.Guides() Demos

    14 |
    15 |
    16 |

    Using Ajax helpers to populate partial views

    17 |

    18 | Demonstration of methods for updating a web page with ASP.NET MVC Ajax Helper class methods. 19 |

    20 |

    Customers »

    21 |
    22 |
    23 | 24 |
    25 |
    26 |

    Getting started

    27 |

    28 | ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that 29 | enables a clean separation of concerns and gives you full control over markup 30 | for enjoyable, agile development. 31 |

    32 |

    Learn more »

    33 |
    34 |
    35 |

    Get more libraries

    36 |

    NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.

    37 |

    Learn more »

    38 |
    39 |
    40 |

    Web Hosting

    41 |

    You can easily find a web hosting company that offers the right mix of features and price for your applications.

    42 |

    Learn more »

    43 |
    44 |
    -------------------------------------------------------------------------------- /Blip.Web/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 | -------------------------------------------------------------------------------- /Blip.Web/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewBag.Title - My ASP.NET Application 7 | @Styles.Render("~/Content/css") 8 | @Scripts.Render("~/bundles/modernizr") 9 | @RenderSection("header", required: false) 10 | 11 | 12 | 31 |
    32 | @RenderBody() 33 |
    34 |
    35 |

    © @DateTime.Now.Year - My ASP.NET Application

    36 |
    37 |
    38 | 39 | @Scripts.Render("~/bundles/jquery") 40 | @Scripts.Render("~/bundles/bootstrap") 41 | @RenderSection("scripts", required: false) 42 | 43 | 44 | -------------------------------------------------------------------------------- /Blip.Web/Views/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 |
    7 |
    8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Blip.Web/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /Blip.Web/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Blip.Web/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Blip.Web/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 |
    10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /Blip.Web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajsaulsberry/BlipAjax/0bb46f1f40bd57adfc484deb41933ac74bcf13f8/Blip.Web/favicon.ico -------------------------------------------------------------------------------- /Blip.Web/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajsaulsberry/BlipAjax/0bb46f1f40bd57adfc484deb41933ac74bcf13f8/Blip.Web/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Blip.Web/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajsaulsberry/BlipAjax/0bb46f1f40bd57adfc484deb41933ac74bcf13f8/Blip.Web/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Blip.Web/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajsaulsberry/BlipAjax/0bb46f1f40bd57adfc484deb41933ac74bcf13f8/Blip.Web/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Blip.Web/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajsaulsberry/BlipAjax/0bb46f1f40bd57adfc484deb41933ac74bcf13f8/Blip.Web/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /Blip.Web/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /BlipAjax.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26730.16 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blip.Data", "Blip.Data\Blip.Data.csproj", "{C8F46FA8-BEF3-4592-BD57-E5E9ECFCA1B9}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blip.Entities", "Blip.Entities\Blip.Entities.csproj", "{3A1FF2CA-E0AA-4E04-A082-B8FCCD23F8F0}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blip.Web", "Blip.Web\Blip.Web.csproj", "{C822CC2D-7129-46F8-9CA0-A519046EB5A7}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {C8F46FA8-BEF3-4592-BD57-E5E9ECFCA1B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {C8F46FA8-BEF3-4592-BD57-E5E9ECFCA1B9}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {C8F46FA8-BEF3-4592-BD57-E5E9ECFCA1B9}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {C8F46FA8-BEF3-4592-BD57-E5E9ECFCA1B9}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {3A1FF2CA-E0AA-4E04-A082-B8FCCD23F8F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {3A1FF2CA-E0AA-4E04-A082-B8FCCD23F8F0}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {3A1FF2CA-E0AA-4E04-A082-B8FCCD23F8F0}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {3A1FF2CA-E0AA-4E04-A082-B8FCCD23F8F0}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {C822CC2D-7129-46F8-9CA0-A519046EB5A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {C822CC2D-7129-46F8-9CA0-A519046EB5A7}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {C822CC2D-7129-46F8-9CA0-A519046EB5A7}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {C822CC2D-7129-46F8-9CA0-A519046EB5A7}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {C2ECC89A-7104-490A-AAC2-6534D8E807EF} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | Thanks for taking an interest in this project. The authors hope the code in this repository and the accompanying article on [PluralSight Hack.Guides](https://www.pluralsight.com/guides) is helpful to you on your path toward greater proficiency as a developer. 4 | 5 | * See the [Readme](Readme.md) file for information about the article(s) associated with this repository. 6 | 7 | * If you have a suggestion to make the code more useful, and that suggestion takes the form of *code*, see the section on [Making Changes](#making-changes). 8 | 9 | * If you believe you have found a bug in the code, please check to see if it has previously been reported by searching for it on GitHub under [Issues](https://github.com/ajsaulsberry/BlipAjax/issues) before opening a new issue or making changes. 10 | 11 | ## Reporting issues 12 | 13 | Keep in mind that the intended use of the GitHub issue tracker for this repository is to report, discuss, and eliminate bugs in the existing code. It is not for: 14 | 15 | * Requesting help implementing or modifying the code 16 | 17 | * Reporting problems or asking questions about the article based on the code. (Use the Disqus commenting section below the article for that.) 18 | 19 | ### Making changes 20 | 21 | Keep in mind that the code in the **master** branch of the repository is used in the text of the accompanying article on PluralSight. There is no automatic link between the repository and the article, so changes to the repository that effect code used in the article will necessitate manual changes to the article as well. Such changes may in turn effect the relevance of the code to the content of the article. Exercise restraint. 22 | 23 | * If you are new to contributing to open source projects, kindly read the exellent [Open Source Contribution Etiquette](http://tirania.org/blog/archive/2010/Dec-31.htm) by Miguel de Icaza. 24 | 25 | * Fork the code and create a topic branch off **master** for your changes. 26 | 27 | * Make commits to your local repo and sync them with the origin repo on GitHub. 28 | 29 | * Commit messages should be 72 characters or less, optionally followed by a blank line and a description of the commit if more information is appropriate. 30 | 31 | * Send a pull request for your proposed changes. 32 | 33 | * Mention @ajsaulsberry in your pull request to have your proposed changes reviewed. 34 | 35 | * Do not create a pull request solely for the purpose of updating NuGet packages or other dependencies. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 A. J. Saulsberry 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # BlipAjax 2 | 3 | **_BlipAjax_** is an ASP.NET MVC case study solution to accompany two guides in the [**PluralSight Guides**](https://www.pluralsight.com/guides) collection for Microsoft .NET technologies. 4 | 5 | ## PluralSight Guides 6 | 7 | [ASP.NET MVC - Using Ajax helpers with Razor partial views](https://www.pluralsight.com/guides/asp-net-mvc-using-ajax-helpers-with-razor-partial-views) - The case study presented in this guide uses one AjaxHelper class method, `BeginForm` to provide the asynchronous functionality needed to update a section of a web page without refreshing the entire page. 8 | 9 | [ASP.NET MVC - Using JavaScript with Ajax and Razor partial views](https://www.pluralsight.com/guides/asp-net-mvc-using-javascript-with-ajax-and-razor-partial-views) - Ajax helper methods and extensions in the **System.Web.Mvc** and **System.Web.Mvc.Ajax** namespaces can be combined with JavaScript and MVC partial views to create flexible interactive web pages with minimal code. 10 | 11 | *Notice: PluralSight and the author(s) disclaim any liability for errors or omissions in this code. See the [Disclaimer of Warranties and Limitation of Liability](#Disclaimer-of-Warranties-and-Limitation-of-Liability) for complete information.* 12 | 13 | ## Solution Projects 14 | 15 | | Project | Application Layer | 16 | | :--- | :--- | 17 | | Blip.Data | Data Context and Repositories | 18 | | Blip.Entities | Data Entities | 19 | | Blip.Web | User Interface (views) and Business Logic (controllers) | 20 | 21 | ## Technologies 22 | 23 | | Dependency | Version* 24 | | :--- | ---: 25 | | .NET Framework | 4.7.2 26 | | ASP.NET MVC | 5.2.7 27 | | Bootstrap | 3.4.1 28 | | Entity Framework | 6.4.0 29 | | jQuery | 3.4.1 30 | | jQuery Validation | 1.19.1 31 | | Microsoft jQuery Unobtrusive Ajax | 3.2.6 32 | | Microsoft jQuery Unobtrusive Validation | 3.2.11 33 | 34 | * As of the latest commit. 35 | 36 | ## Getting Started 37 | 38 | 1. Download or clone this repository. 39 | 1. Open the solution in Visual Studio 2017 or higher. 40 | 1. Select the **Blip.Data** project. 41 | 1. Open a Package Manager Console window. 42 | 1. Select "Blip.Data" for **Default Project**. 43 | 1. Run: `update-database`. 44 | 45 | This will create the database, apply Entity Framework migrations, and run the `Seed` method to populate the database with values for the lookup tables. 46 | 47 | ## Configuration 48 | 49 | * Two projects contain configuration strings which may require modification for the developer's specific environment: 50 | 51 | | Project | File 52 | | :--- | :--- 53 | | Blip.Data | App.config 54 | | Blip.Web | Web.config 55 | 56 | * The configuration strings specify the instance of SQL Server Express installed with Visual Studio 2017 as the target database server: `Data Source=(localdb)\ProjectsV13`. Developers using a different target database will have to change the connection strings in both projects. 57 | 58 | ## License 59 | 60 | This project is licensed under the terms of the MIT license. 61 | 62 | ## Contributing 63 | 64 | See the accompanying instructions on [How to contribute](CONTRIBUTING.md). 65 | 66 | ## Disclaimer of Warranties and Limitation of Liability 67 | 68 | The contents of this repository are offered on an as-is and as-available basis and the authors make no representations or warranties of any kind concerning the contents, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. 69 | 70 | To the extent possible, in no event will the authors be liable on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of the use of the contents, even if the the authors have been advised of the possibility of such losses, costs, expenses, or damages. 71 | 72 | The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. --------------------------------------------------------------------------------