Permalink
Browse files

Update #276 - Added MVC4 version of MVC Music Store as sample/test ap…

…plication.
  • Loading branch information...
1 parent 3921822 commit e0f009699ac63d1e0727972986c41b56a0c28025 @nikmd23 nikmd23 committed Mar 11, 2013
Showing with 21,924 additions and 0 deletions.
  1. +8 −0 .gitignore
  2. +13 −0 Glimpse.All.sln
  3. BIN source/Glimpse.Mvc4.MusicStore.Sample/App_Data/ASPNETDB_ReadOnly.mdf
  4. BIN source/Glimpse.Mvc4.MusicStore.Sample/App_Data/ASPNETDB_log_ReadOnly.ldf
  5. BIN source/Glimpse.Mvc4.MusicStore.Sample/App_Data/MvcMusicStore_ReadOnly.mdf
  6. BIN source/Glimpse.Mvc4.MusicStore.Sample/App_Data/MvcMusicStore_log_ReadOnly.ldf
  7. +39 −0 source/Glimpse.Mvc4.MusicStore.Sample/App_Start/AppConfig.cs
  8. +32 −0 source/Glimpse.Mvc4.MusicStore.Sample/App_Start/AuthConfig.cs
  9. +26 −0 source/Glimpse.Mvc4.MusicStore.Sample/App_Start/BundleConfig.cs
  10. +13 −0 source/Glimpse.Mvc4.MusicStore.Sample/App_Start/FilterConfig.cs
  11. +23 −0 source/Glimpse.Mvc4.MusicStore.Sample/App_Start/RouteConfig.cs
  12. +19 −0 source/Glimpse.Mvc4.MusicStore.Sample/App_Start/WebApiConfig.cs
  13. +928 −0 source/Glimpse.Mvc4.MusicStore.Sample/Content/Site.css
  14. +426 −0 source/Glimpse.Mvc4.MusicStore.Sample/Controllers/AccountController.cs
  15. +85 −0 source/Glimpse.Mvc4.MusicStore.Sample/Controllers/CheckoutController.cs
  16. +35 −0 source/Glimpse.Mvc4.MusicStore.Sample/Controllers/HomeController.cs
  17. +101 −0 source/Glimpse.Mvc4.MusicStore.Sample/Controllers/ShoppingCartController.cs
  18. +57 −0 source/Glimpse.Mvc4.MusicStore.Sample/Controllers/StoreController.cs
  19. +131 −0 source/Glimpse.Mvc4.MusicStore.Sample/Controllers/StoreManagerController.cs
  20. +50 −0 source/Glimpse.Mvc4.MusicStore.Sample/Filters/InitializeSimpleMembershipAttribute.cs
  21. +328 −0 source/Glimpse.Mvc4.MusicStore.Sample/Glimpse.Mvc4.MusicStore.Sample.csproj
  22. +1 −0 source/Glimpse.Mvc4.MusicStore.Sample/Global.asax
  23. +30 −0 source/Glimpse.Mvc4.MusicStore.Sample/Global.asax.cs
  24. BIN source/Glimpse.Mvc4.MusicStore.Sample/Images/accent.png
  25. BIN source/Glimpse.Mvc4.MusicStore.Sample/Images/bullet.png
  26. BIN source/Glimpse.Mvc4.MusicStore.Sample/Images/heroAccent.png
  27. BIN source/Glimpse.Mvc4.MusicStore.Sample/Images/home-showcase.png
  28. BIN source/Glimpse.Mvc4.MusicStore.Sample/Images/logo.png
  29. +303 −0 source/Glimpse.Mvc4.MusicStore.Sample/Images/logo.svg
  30. BIN source/Glimpse.Mvc4.MusicStore.Sample/Images/orderedList0.png
  31. BIN source/Glimpse.Mvc4.MusicStore.Sample/Images/orderedList1.png
  32. BIN source/Glimpse.Mvc4.MusicStore.Sample/Images/orderedList2.png
  33. BIN source/Glimpse.Mvc4.MusicStore.Sample/Images/orderedList3.png
  34. BIN source/Glimpse.Mvc4.MusicStore.Sample/Images/orderedList4.png
  35. BIN source/Glimpse.Mvc4.MusicStore.Sample/Images/orderedList5.png
  36. BIN source/Glimpse.Mvc4.MusicStore.Sample/Images/orderedList6.png
  37. BIN source/Glimpse.Mvc4.MusicStore.Sample/Images/orderedList7.png
  38. BIN source/Glimpse.Mvc4.MusicStore.Sample/Images/orderedList8.png
  39. BIN source/Glimpse.Mvc4.MusicStore.Sample/Images/orderedList9.png
  40. BIN source/Glimpse.Mvc4.MusicStore.Sample/Images/placeholder.png
  41. +112 −0 source/Glimpse.Mvc4.MusicStore.Sample/Images/placeholder.svg
  42. +97 −0 source/Glimpse.Mvc4.MusicStore.Sample/Models/AccountModels.cs
  43. +36 −0 source/Glimpse.Mvc4.MusicStore.Sample/Models/Album.cs
  44. +13 −0 source/Glimpse.Mvc4.MusicStore.Sample/Models/Artist.cs
  45. +19 −0 source/Glimpse.Mvc4.MusicStore.Sample/Models/Cart.cs
  46. +12 −0 source/Glimpse.Mvc4.MusicStore.Sample/Models/Genre.cs
  47. +14 −0 source/Glimpse.Mvc4.MusicStore.Sample/Models/MusicStoreEntities.cs
  48. +68 −0 source/Glimpse.Mvc4.MusicStore.Sample/Models/Order.cs
  49. +14 −0 source/Glimpse.Mvc4.MusicStore.Sample/Models/OrderDetail.cs
  50. +827 −0 source/Glimpse.Mvc4.MusicStore.Sample/Models/SampleData.cs
  51. +195 −0 source/Glimpse.Mvc4.MusicStore.Sample/Models/ShoppingCart.cs
  52. +35 −0 source/Glimpse.Mvc4.MusicStore.Sample/Properties/AssemblyInfo.cs
  53. BIN source/Glimpse.Mvc4.MusicStore.Sample/Scripts/_references.js
  54. +2,657 −0 source/Glimpse.Mvc4.MusicStore.Sample/Scripts/jquery-1.9.1.intellisense.js
  55. +9,597 −0 source/Glimpse.Mvc4.MusicStore.Sample/Scripts/jquery-1.9.1.js
  56. +5 −0 source/Glimpse.Mvc4.MusicStore.Sample/Scripts/jquery-1.9.1.min.js
  57. +1 −0 source/Glimpse.Mvc4.MusicStore.Sample/Scripts/jquery-1.9.1.min.map
  58. +163 −0 source/Glimpse.Mvc4.MusicStore.Sample/Scripts/jquery.unobtrusive-ajax.js
  59. +5 −0 source/Glimpse.Mvc4.MusicStore.Sample/Scripts/jquery.unobtrusive-ajax.min.js
  60. +1,288 −0 source/Glimpse.Mvc4.MusicStore.Sample/Scripts/jquery.validate-vsdoc.js
  61. +1,207 −0 source/Glimpse.Mvc4.MusicStore.Sample/Scripts/jquery.validate.js
  62. +4 −0 source/Glimpse.Mvc4.MusicStore.Sample/Scripts/jquery.validate.min.js
  63. +367 −0 source/Glimpse.Mvc4.MusicStore.Sample/Scripts/jquery.validate.unobtrusive.js
  64. +5 −0 source/Glimpse.Mvc4.MusicStore.Sample/Scripts/jquery.validate.unobtrusive.min.js
  65. +1,265 −0 source/Glimpse.Mvc4.MusicStore.Sample/Scripts/modernizr-2.5.3.js
  66. +11 −0 source/Glimpse.Mvc4.MusicStore.Sample/ViewModels/ShoppingCartRemoveViewModel.cs
  67. +11 −0 source/Glimpse.Mvc4.MusicStore.Sample/ViewModels/ShoppingCartViewModel.cs
  68. +36 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Account/ExternalLoginConfirmation.cshtml
  69. +8 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Account/ExternalLoginFailure.cshtml
  70. +50 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Account/Login.cshtml
  71. +32 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Account/Manage.cshtml
  72. +37 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Account/Register.cshtml
  73. +27 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Account/_ChangePasswordPartial.cshtml
  74. +25 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Account/_ExternalLoginsListPartial.cshtml
  75. +34 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Account/_RemoveExternalLoginsPartial.cshtml
  76. +26 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Account/_SetPasswordPartial.cshtml
  77. +32 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Checkout/AddressAndPayment.cshtml
  78. +13 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Checkout/Complete.cshtml
  79. +34 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Home/About.cshtml
  80. +50 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Home/Contact.cshtml
  81. +21 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Home/Index.cshtml
  82. +11 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Shared/Error.cshtml
  83. +52 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Shared/_Layout.cshtml
  84. +14 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Shared/_LoginPartial.cshtml
  85. +8 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/ShoppingCart/CartSummary.cshtml
  86. +91 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/ShoppingCart/Index.cshtml
  87. +23 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Store/Browse.cshtml
  88. +30 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Store/Details.cshtml
  89. +16 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Store/GenreMenu.cshtml
  90. +14 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Store/Index.cshtml
  91. +67 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/StoreManager/Create.cshtml
  92. +21 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/StoreManager/Delete.cshtml
  93. +50 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/StoreManager/Details.cshtml
  94. +69 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/StoreManager/Edit.cshtml
  95. +61 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/StoreManager/Index.cshtml
  96. +59 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/Web.config
  97. +3 −0 source/Glimpse.Mvc4.MusicStore.Sample/Views/_ViewStart.cshtml
  98. +30 −0 source/Glimpse.Mvc4.MusicStore.Sample/Web.Debug.config
  99. +31 −0 source/Glimpse.Mvc4.MusicStore.Sample/Web.Release.config
  100. +143 −0 source/Glimpse.Mvc4.MusicStore.Sample/Web.config
  101. BIN source/Glimpse.Mvc4.MusicStore.Sample/favicon.ico
  102. +30 −0 source/Glimpse.Mvc4.MusicStore.Sample/packages.config
View
@@ -39,3 +39,11 @@ Help/
/source/Glimpse.AspNet.Net45/NuSpec/lib/net45/Glimpse.AspNet.dll
/source/Glimpse.AspNet.Net45/NuSpec/lib/net45/Glimpse.AspNet.pdb
+
+/source/Glimpse.Mvc4.MusicStore.Sample/App_Data/ASPNETDB.MDF
+
+/source/Glimpse.Mvc4.MusicStore.Sample/App_Data/ASPNETDB_log.ldf
+
+/source/Glimpse.Mvc4.MusicStore.Sample/App_Data/MvcMusicStore.mdf
+
+/source/Glimpse.Mvc4.MusicStore.Sample/App_Data/MvcMusicStore_log.ldf
View
@@ -62,6 +62,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glimpse.AspNet.Net45", "sou
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glimpse.Mvc3", "source\Glimpse.Mvc3\Glimpse.Mvc3.csproj", "{585C1C27-8D37-4CB6-BD0F-464487845661}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glimpse.Mvc4.MusicStore.Sample", "source\Glimpse.Mvc4.MusicStore.Sample\Glimpse.Mvc4.MusicStore.Sample.csproj", "{C2C38EE9-01B7-4929-B7E9-086077D1AB58}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -282,12 +284,23 @@ Global
{585C1C27-8D37-4CB6-BD0F-464487845661}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{585C1C27-8D37-4CB6-BD0F-464487845661}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{585C1C27-8D37-4CB6-BD0F-464487845661}.Release|x86.ActiveCfg = Release|Any CPU
+ {C2C38EE9-01B7-4929-B7E9-086077D1AB58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C2C38EE9-01B7-4929-B7E9-086077D1AB58}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C2C38EE9-01B7-4929-B7E9-086077D1AB58}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {C2C38EE9-01B7-4929-B7E9-086077D1AB58}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {C2C38EE9-01B7-4929-B7E9-086077D1AB58}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {C2C38EE9-01B7-4929-B7E9-086077D1AB58}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C2C38EE9-01B7-4929-B7E9-086077D1AB58}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C2C38EE9-01B7-4929-B7E9-086077D1AB58}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {C2C38EE9-01B7-4929-B7E9-086077D1AB58}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {C2C38EE9-01B7-4929-B7E9-086077D1AB58}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{32DCD27D-A84C-4250-B657-408B3620A9AC} = {CCFACE51-18FA-4C5D-9F89-EC58881786A9}
+ {C2C38EE9-01B7-4929-B7E9-086077D1AB58} = {CCFACE51-18FA-4C5D-9F89-EC58881786A9}
{9923BFBD-EA73-4719-A418-213003862550} = {A3097EAF-9D1B-416A-822E-F679D768BC55}
{76714E46-AFE9-49F0-AEE8-C8A966195914} = {A3097EAF-9D1B-416A-822E-F679D768BC55}
{FE12BC0C-CD22-4D24-BFC7-13ED1C428BAD} = {A3097EAF-9D1B-416A-822E-F679D768BC55}
@@ -0,0 +1,39 @@
+using MvcMusicStore.Filters;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Linq;
+using System.Web;
+using System.Web.Security;
+using WebMatrix.WebData;
+
+namespace MvcMusicStore
+{
+ public static class AppConfig
+ {
+ public static void Configure()
+ {
+ System.Data.Entity.Database.SetInitializer(new MvcMusicStore.Models.SampleData());
+
+ CreateAdminUser();
+ }
+
+ private static void CreateAdminUser()
+ {
+ string _username = ConfigurationManager.AppSettings["DefaultAdminUsername"];
+ string _password = ConfigurationManager.AppSettings["DefaultAdminPassword"];
+ string _role = "Administrator";
+
+ new InitializeSimpleMembershipAttribute().OnActionExecuting(null);
+
+ if (!WebSecurity.UserExists(_username))
+ WebSecurity.CreateUserAndAccount(_username, _password);
+
+ if (!Roles.RoleExists(_role))
+ Roles.CreateRole(_role);
+
+ if (!Roles.IsUserInRole(_username, _role))
+ Roles.AddUserToRole(_username, _role);
+ }
+ }
+}
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Web.WebPages.OAuth;
+using MvcMusicStore.Models;
+
+namespace MvcMusicStore
+{
+ public static class AuthConfig
+ {
+ public static void RegisterAuth()
+ {
+ // To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
+ // you must update this site. For more information visit http://go.microsoft.com/fwlink/?LinkID=252166
+
+ //OAuthWebSecurity.RegisterMicrosoftClient(
+ // clientId: "",
+ // clientSecret: "");
+
+ //OAuthWebSecurity.RegisterTwitterClient(
+ // consumerKey: "",
+ // consumerSecret: "");
+
+ //OAuthWebSecurity.RegisterFacebookClient(
+ // appId: "",
+ // appSecret: "");
+
+ //OAuthWebSecurity.RegisterGoogleClient();
+ }
+ }
+}
@@ -0,0 +1,26 @@
+using System.Web;
+using System.Web.Optimization;
+
+namespace MvcMusicStore
+{
+ public class BundleConfig
+ {
+ // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
+ public static void RegisterBundles(BundleCollection bundles)
+ {
+ bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
+ "~/Scripts/jquery-{version}.js"));
+
+ bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
+ "~/Scripts/jquery.unobtrusive*",
+ "~/Scripts/jquery.validate*"));
+
+ // Use the development version of Modernizr to develop with and learn from. Then, when you're
+ // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
+ bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
+ "~/Scripts/modernizr-*"));
+
+ bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
+ }
+ }
+}
@@ -0,0 +1,13 @@
+using System.Web;
+using System.Web.Mvc;
+
+namespace MvcMusicStore
+{
+ public class FilterConfig
+ {
+ public static void RegisterGlobalFilters(GlobalFilterCollection filters)
+ {
+ filters.Add(new HandleErrorAttribute());
+ }
+ }
+}
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.Mvc;
+using System.Web.Routing;
+
+namespace MvcMusicStore
+{
+ public class RouteConfig
+ {
+ public static void RegisterRoutes(RouteCollection routes)
+ {
+ routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
+
+ routes.MapRoute(
+ name: "Default",
+ url: "{controller}/{action}/{id}",
+ defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
+ );
+ }
+ }
+}
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web.Http;
+
+namespace MvcMusicStore
+{
+ public static class WebApiConfig
+ {
+ public static void Register(HttpConfiguration config)
+ {
+ config.Routes.MapHttpRoute(
+ name: "DefaultApi",
+ routeTemplate: "api/{controller}/{id}",
+ defaults: new { id = RouteParameter.Optional }
+ );
+ }
+ }
+}
Oops, something went wrong.

0 comments on commit e0f0096

Please sign in to comment.