├── README.md ├── Vidly ├── Views │ ├── _ViewStart.cshtml │ ├── Home │ │ ├── About.cshtml │ │ ├── Contact.cshtml │ │ └── Index.cshtml │ ├── Account │ │ ├── ExternalLoginFailure.cshtml │ │ ├── ForgotPasswordConfirmation.cshtml │ │ ├── ConfirmEmail.cshtml │ │ ├── ResetPasswordConfirmation.cshtml │ │ ├── SendCode.cshtml │ │ ├── ForgotPassword.cshtml │ │ ├── _ExternalLoginsListPartial.cshtml │ │ ├── VerifyCode.cshtml │ │ ├── ResetPassword.cshtml │ │ ├── ExternalLoginConfirmation.cshtml │ │ ├── Register.cshtml │ │ └── Login.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── Lockout.cshtml │ │ ├── _Layout.cshtml │ │ ├── _LoginPartial.cshtml │ │ └── _NavBar.cshtml │ ├── Customers │ │ ├── Details.cshtml │ │ └── CustomerForm.cshtml │ ├── Movies │ │ ├── Details.cshtml │ │ ├── Random.cshtml │ │ ├── ReadOnlyList.cshtml │ │ ├── MovieForm.cshtml │ │ └── List.cshtml │ ├── Manage │ │ ├── AddPhoneNumber.cshtml │ │ ├── VerifyPhoneNumber.cshtml │ │ ├── SetPassword.cshtml │ │ └── ChangePassword.cshtml │ └── Web.config ├── favicon.ico ├── Global.asax ├── Scripts │ ├── _references.js │ └── DataTables │ │ ├── autoFill.foundation.min.js │ │ ├── autoFill.bootstrap.min.js │ │ ├── autoFill.jqueryui.min.js │ │ ├── responsive.jqueryui.min.js │ │ ├── buttons.bootstrap4.min.js │ │ ├── responsive.foundation.min.js │ │ ├── buttons.bootstrap.min.js │ │ ├── buttons.jqueryui.min.js │ │ ├── buttons.foundation.min.js │ │ ├── autoFill.bootstrap.js │ │ ├── autoFill.foundation.js │ │ ├── autoFill.jqueryui.js │ │ ├── responsive.bootstrap.min.js │ │ ├── buttons.bootstrap4.js │ │ ├── buttons.print.min.js │ │ ├── responsive.jqueryui.js │ │ ├── buttons.jqueryui.js │ │ ├── buttons.bootstrap.js │ │ ├── responsive.foundation.js │ │ ├── dataTables.bootstrap.min.js │ │ ├── dataTables.bootstrap4.min.js │ │ ├── dataTables.foundation.min.js │ │ ├── dataTables.material.min.js │ │ ├── responsive.bootstrap.js │ │ ├── dataTables.semanticui.min.js │ │ ├── buttons.foundation.js │ │ ├── dataTables.uikit.min.js │ │ ├── buttons.colVis.min.js │ │ └── dataTables.jqueryui.min.js ├── Content │ ├── DataTables │ │ ├── images │ │ │ ├── sort_asc.png │ │ │ ├── sort_both.png │ │ │ ├── sort_desc.png │ │ │ ├── details_open.png │ │ │ ├── details_close.png │ │ │ ├── sort_asc_disabled.png │ │ │ └── sort_desc_disabled.png │ │ ├── swf │ │ │ └── flashExport.swf │ │ └── css │ │ │ ├── keyTable.bootstrap.min.css │ │ │ ├── keyTable.dataTables.min.css │ │ │ ├── keyTable.foundation.min.css │ │ │ ├── keyTable.jqueryui.min.css │ │ │ ├── keyTable.bootstrap.css │ │ │ ├── keyTable.dataTables.css │ │ │ ├── keyTable.foundation.css │ │ │ ├── keyTable.jqueryui.css │ │ │ ├── colReorder.jqueryui.min.css │ │ │ ├── colReorder.bootstrap.min.css │ │ │ ├── colReorder.dataTables.min.css │ │ │ ├── colReorder.foundation.min.css │ │ │ ├── fixedColumns.jqueryui.min.css │ │ │ ├── fixedHeader.jqueryui.min.css │ │ │ ├── fixedColumns.jqueryui.css │ │ │ ├── colReorder.bootstrap.css │ │ │ ├── colReorder.dataTables.css │ │ │ ├── colReorder.foundation.css │ │ │ ├── colReorder.jqueryui.css │ │ │ ├── fixedHeader.dataTables.min.css │ │ │ ├── rowReorder.dataTables.min.css │ │ │ ├── rowReorder.jqueryui.min.css │ │ │ ├── fixedHeader.jqueryui.css │ │ │ ├── rowReorder.bootstrap.min.css │ │ │ ├── rowReorder.foundation.min.css │ │ │ ├── fixedColumns.dataTables.min.css │ │ │ ├── fixedHeader.bootstrap.min.css │ │ │ ├── fixedHeader.foundation.min.css │ │ │ ├── scroller.foundation.min.css │ │ │ ├── scroller.jqueryui.min.css │ │ │ ├── scroller.dataTables.min.css │ │ │ ├── fixedHeader.dataTables.css │ │ │ ├── scroller.bootstrap.min.css │ │ │ ├── fixedColumns.dataTables.css │ │ │ ├── scroller.foundation.css │ │ │ ├── fixedHeader.bootstrap.css │ │ │ ├── fixedHeader.foundation.css │ │ │ ├── rowReorder.dataTables.css │ │ │ ├── rowReorder.jqueryui.css │ │ │ ├── rowReorder.bootstrap.css │ │ │ ├── rowReorder.foundation.css │ │ │ ├── fixedColumns.foundation.min.css │ │ │ ├── scroller.dataTables.css │ │ │ ├── scroller.jqueryui.css │ │ │ ├── common.scss │ │ │ ├── scroller.bootstrap.css │ │ │ ├── fixedColumns.foundation.css │ │ │ ├── fixedColumns.bootstrap.min.css │ │ │ ├── dataTables.semanticui.min.css │ │ │ ├── autoFill.bootstrap.min.css │ │ │ ├── autoFill.foundation.min.css │ │ │ ├── fixedColumns.bootstrap.css │ │ │ ├── autoFill.jqueryui.min.css │ │ │ ├── buttons.bootstrap.min.css │ │ │ ├── autoFill.dataTables.min.css │ │ │ ├── dataTables.semanticui.css │ │ │ ├── buttons.foundation.min.css │ │ │ ├── autoFill.bootstrap.css │ │ │ ├── dataTables.material.min.css │ │ │ ├── autoFill.foundation.css │ │ │ ├── autoFill.jqueryui.css │ │ │ ├── dataTables.foundation.min.css │ │ │ ├── autoFill.dataTables.css │ │ │ ├── buttons.bootstrap.css │ │ │ └── buttons.bootstrap4.min.css │ ├── Site.css │ ├── typeahead.css │ └── bootstrap-theme.css ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff ├── Dtos │ ├── GenreDto.cs │ ├── NewRentalDto.cs │ ├── MembershipTypeDto.cs │ ├── CustomerDto.cs │ └── MovieDto.cs ├── Models │ ├── RoleName.cs │ ├── Genre.cs │ ├── Rental.cs │ ├── MembershipType.cs │ ├── Customer.cs │ ├── ApplicationDbContext.cs │ ├── Movie.cs │ ├── Min18YearsIfAMember.cs │ └── ApplicationUser.cs ├── 404.html ├── Startup.cs ├── ViewModels │ ├── RandomMovieViewModel.cs │ ├── CustomerFormViewModel.cs │ └── MovieFormViewModel.cs ├── Controllers │ ├── RentalsController.cs │ ├── HomeController.cs │ └── Api │ │ └── NewRentalsController.cs ├── App_Start │ ├── FilterConfig.cs │ ├── RouteConfig.cs │ ├── MappingProfile.cs │ ├── WebApiConfig.cs │ └── BundleConfig.cs ├── Migrations │ ├── 201604050626453_AddBirthdateToCustomer.cs │ ├── 201604050620598_AddNameToMembershipType.cs │ ├── 201604220403453_AddPhoneToApplicationUser.cs │ ├── 201604050035427_AddIsSubscribedToCustomer.cs │ ├── 201604050216273_ApplyAnnotationsToCustomerName.cs │ ├── 201604210511510_AddDrivingLicenseToApplicationUser.cs │ ├── 201605020226564_AddNumberAvailableToMovie.cs │ ├── 201604050621225_SetNameOfMembershipTypes.cs │ ├── 201604050707219_Genres.cs │ ├── 201604050143242_PopulateMembershipTypes.cs │ ├── 201604050707219_Genres.Designer.cs │ ├── 201604050706359_AddMovie.Designer.cs │ ├── 201604210211534_SeedUsers.Designer.cs │ ├── 201605020104315_AddRental.Designer.cs │ ├── 201604040445246_InitialModel.Designer.cs │ ├── 201604050041345_AddMembershipType.Designer.cs │ ├── 201604050626453_AddBirthdateToCustomer.Designer.cs │ ├── 201604050143242_PopulateMembershipTypes.Designer.cs │ ├── 201604050620598_AddNameToMembershipType.Designer.cs │ ├── 201604050035427_AddIsSubscribedToCustomer.Designer.cs │ ├── 201604050621225_SetNameOfMembershipTypes.Designer.cs │ ├── 201604220403453_AddPhoneToApplicationUser.Designer.cs │ ├── 201605020226564_AddNumberAvailableToMovie.Designer.cs │ ├── 201604050216273_ApplyAnnotationsToCustomerName.Designer.cs │ ├── 201604210511510_AddDrivingLicenseToApplicationUser.Designer.cs │ ├── Configuration.cs │ ├── 201604050041345_AddMembershipType.cs │ ├── 201605020104315_AddRental.cs │ ├── 201604210211534_SeedUsers.cs │ └── 201604050706359_AddMovie.cs ├── Global.asax.cs ├── Properties │ ├── PublishProfiles │ │ ├── Testing.pubxml │ │ └── GoDaddyProfile.pubxml │ └── AssemblyInfo.cs ├── GlimpseSecurityPolicy.cs ├── Web.Debug.config ├── Web.Release.config └── Web.Testing.config ├── Vidly.sln └── .gitattributes /README.md: -------------------------------------------------------------------------------- 1 | # vidly-mvc-5 2 | A new line of code 3 | -------------------------------------------------------------------------------- /Vidly/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /Vidly/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mosh-hamedani/vidly-mvc-5/HEAD/Vidly/favicon.ico -------------------------------------------------------------------------------- /Vidly/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Vidly.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Vidly/Scripts/_references.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mosh-hamedani/vidly-mvc-5/HEAD/Vidly/Scripts/_references.js -------------------------------------------------------------------------------- /Vidly/Content/DataTables/images/sort_asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mosh-hamedani/vidly-mvc-5/HEAD/Vidly/Content/DataTables/images/sort_asc.png -------------------------------------------------------------------------------- /Vidly/Content/DataTables/images/sort_both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mosh-hamedani/vidly-mvc-5/HEAD/Vidly/Content/DataTables/images/sort_both.png -------------------------------------------------------------------------------- /Vidly/Content/DataTables/images/sort_desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mosh-hamedani/vidly-mvc-5/HEAD/Vidly/Content/DataTables/images/sort_desc.png -------------------------------------------------------------------------------- /Vidly/Content/DataTables/swf/flashExport.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mosh-hamedani/vidly-mvc-5/HEAD/Vidly/Content/DataTables/swf/flashExport.swf -------------------------------------------------------------------------------- /Vidly/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mosh-hamedani/vidly-mvc-5/HEAD/Vidly/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Vidly/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mosh-hamedani/vidly-mvc-5/HEAD/Vidly/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Vidly/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mosh-hamedani/vidly-mvc-5/HEAD/Vidly/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/keyTable.bootstrap.min.css: -------------------------------------------------------------------------------- 1 | table.dataTable th.focus,table.dataTable td.focus{outline:3px solid #337ab7;outline-offset:-1px} 2 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/keyTable.dataTables.min.css: -------------------------------------------------------------------------------- 1 | table.dataTable th.focus,table.dataTable td.focus{outline:3px solid #3366FF;outline-offset:-1px} 2 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/keyTable.foundation.min.css: -------------------------------------------------------------------------------- 1 | table.dataTable th.focus,table.dataTable td.focus{outline:3px solid #008CBA;outline-offset:-1px} 2 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/keyTable.jqueryui.min.css: -------------------------------------------------------------------------------- 1 | table.dataTable th.focus,table.dataTable td.focus{outline:3px solid #3366FF;outline-offset:-1px} 2 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/images/details_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mosh-hamedani/vidly-mvc-5/HEAD/Vidly/Content/DataTables/images/details_open.png -------------------------------------------------------------------------------- /Vidly/Content/DataTables/images/details_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mosh-hamedani/vidly-mvc-5/HEAD/Vidly/Content/DataTables/images/details_close.png -------------------------------------------------------------------------------- /Vidly/Content/DataTables/images/sort_asc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mosh-hamedani/vidly-mvc-5/HEAD/Vidly/Content/DataTables/images/sort_asc_disabled.png -------------------------------------------------------------------------------- /Vidly/Content/DataTables/images/sort_desc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mosh-hamedani/vidly-mvc-5/HEAD/Vidly/Content/DataTables/images/sort_desc_disabled.png -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/keyTable.bootstrap.css: -------------------------------------------------------------------------------- 1 | table.dataTable th.focus, 2 | table.dataTable td.focus { 3 | outline: 3px solid #337ab7; 4 | outline-offset: -1px; 5 | } 6 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/keyTable.dataTables.css: -------------------------------------------------------------------------------- 1 | table.dataTable th.focus, 2 | table.dataTable td.focus { 3 | outline: 3px solid #3366FF; 4 | outline-offset: -1px; 5 | } 6 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/keyTable.foundation.css: -------------------------------------------------------------------------------- 1 | table.dataTable th.focus, 2 | table.dataTable td.focus { 3 | outline: 3px solid #008CBA; 4 | outline-offset: -1px; 5 | } 6 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/keyTable.jqueryui.css: -------------------------------------------------------------------------------- 1 | table.dataTable th.focus, 2 | table.dataTable td.focus { 3 | outline: 3px solid #3366FF; 4 | outline-offset: -1px; 5 | } 6 | -------------------------------------------------------------------------------- /Vidly/Dtos/GenreDto.cs: -------------------------------------------------------------------------------- 1 | namespace Vidly.Dtos 2 | { 3 | public class GenreDto 4 | { 5 | public byte Id { get; set; } 6 | public string Name { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /Vidly/Models/RoleName.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Vidly.Models 3 | { 4 | public static class RoleName 5 | { 6 | public const string CanManageMovies = "CanManageMovies"; 7 | } 8 | } -------------------------------------------------------------------------------- /Vidly/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Not Found

8 | 9 | 10 | -------------------------------------------------------------------------------- /Vidly/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 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/colReorder.jqueryui.min.css: -------------------------------------------------------------------------------- 1 | table.DTCR_clonedTable.dataTable{position:absolute !important;background-color:rgba(255,255,255,0.7);z-index:202}div.DTCR_pointer{width:1px;background-color:#0259C4;z-index:201} 2 | -------------------------------------------------------------------------------- /Vidly/Views/Account/ExternalLoginFailure.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Login Failure"; 3 | } 4 | 5 |
6 |

@ViewBag.Title.

7 |

Unsuccessful login with service.

8 |
9 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/colReorder.bootstrap.min.css: -------------------------------------------------------------------------------- 1 | table.DTCR_clonedTable.dataTable{position:absolute !important;background-color:rgba(255,255,255,0.7);z-index:202}div.DTCR_pointer{width:1px;background-color:#337ab7;z-index:201} 2 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/colReorder.dataTables.min.css: -------------------------------------------------------------------------------- 1 | table.DTCR_clonedTable.dataTable{position:absolute !important;background-color:rgba(255,255,255,0.7);z-index:202}div.DTCR_pointer{width:1px;background-color:#0259C4;z-index:201} 2 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/colReorder.foundation.min.css: -------------------------------------------------------------------------------- 1 | table.DTCR_clonedTable.dataTable{position:absolute !important;background-color:rgba(255,255,255,0.7);z-index:202}div.DTCR_pointer{width:1px;background-color:#008CBA;z-index:201} 2 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/fixedColumns.jqueryui.min.css: -------------------------------------------------------------------------------- 1 | div.DTFC_LeftWrapper table.dataTable,div.DTFC_RightWrapper table.dataTable{z-index:2}div.DTFC_LeftWrapper table.dataTable.no-footer,div.DTFC_RightWrapper table.dataTable.no-footer{border-bottom:none} 2 | -------------------------------------------------------------------------------- /Vidly/Dtos/NewRentalDto.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Vidly.Dtos 4 | { 5 | public class NewRentalDto 6 | { 7 | public int CustomerId { get; set; } 8 | public List MovieIds { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /Vidly/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Web.Mvc.HandleErrorInfo 2 | 3 | @{ 4 | ViewBag.Title = "Error"; 5 | } 6 | 7 |

Error.

8 |

An error occurred while processing your request.

9 | 10 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/fixedHeader.jqueryui.min.css: -------------------------------------------------------------------------------- 1 | table.fixedHeader-floating{position:fixed !important;background-color:white}table.fixedHeader-locked{position:absolute !important;background-color:white}@media print{table.fixedHeader-floating{display:none}} 2 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/fixedColumns.jqueryui.css: -------------------------------------------------------------------------------- 1 | div.DTFC_LeftWrapper table.dataTable, 2 | div.DTFC_RightWrapper table.dataTable { 3 | z-index: 2; 4 | } 5 | div.DTFC_LeftWrapper table.dataTable.no-footer, 6 | div.DTFC_RightWrapper table.dataTable.no-footer { 7 | border-bottom: none; 8 | } 9 | -------------------------------------------------------------------------------- /Vidly/Models/Genre.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Vidly.Models 4 | { 5 | public class Genre 6 | { 7 | public byte Id { get; set; } 8 | 9 | [Required] 10 | [StringLength(255)] 11 | public string Name { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /Vidly/Views/Shared/Lockout.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Web.Mvc.HandleErrorInfo 2 | 3 | @{ 4 | ViewBag.Title = "Locked Out"; 5 | } 6 | 7 |
8 |

Locked out.

9 |

This account has been locked out, please try again later.

10 |
11 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/colReorder.bootstrap.css: -------------------------------------------------------------------------------- 1 | table.DTCR_clonedTable.dataTable { 2 | position: absolute !important; 3 | background-color: rgba(255, 255, 255, 0.7); 4 | z-index: 202; 5 | } 6 | 7 | div.DTCR_pointer { 8 | width: 1px; 9 | background-color: #337ab7; 10 | z-index: 201; 11 | } 12 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/colReorder.dataTables.css: -------------------------------------------------------------------------------- 1 | table.DTCR_clonedTable.dataTable { 2 | position: absolute !important; 3 | background-color: rgba(255, 255, 255, 0.7); 4 | z-index: 202; 5 | } 6 | 7 | div.DTCR_pointer { 8 | width: 1px; 9 | background-color: #0259C4; 10 | z-index: 201; 11 | } 12 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/colReorder.foundation.css: -------------------------------------------------------------------------------- 1 | table.DTCR_clonedTable.dataTable { 2 | position: absolute !important; 3 | background-color: rgba(255, 255, 255, 0.7); 4 | z-index: 202; 5 | } 6 | 7 | div.DTCR_pointer { 8 | width: 1px; 9 | background-color: #008CBA; 10 | z-index: 201; 11 | } 12 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/colReorder.jqueryui.css: -------------------------------------------------------------------------------- 1 | table.DTCR_clonedTable.dataTable { 2 | position: absolute !important; 3 | background-color: rgba(255, 255, 255, 0.7); 4 | z-index: 202; 5 | } 6 | 7 | div.DTCR_pointer { 8 | width: 1px; 9 | background-color: #0259C4; 10 | z-index: 201; 11 | } 12 | -------------------------------------------------------------------------------- /Vidly/Dtos/MembershipTypeDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace Vidly.Dtos 7 | { 8 | public class MembershipTypeDto 9 | { 10 | public byte Id { get; set; } 11 | public string Name { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /Vidly/Views/Account/ForgotPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Forgot Password Confirmation"; 3 | } 4 | 5 |
6 |

@ViewBag.Title.

7 |
8 |
9 |

10 | Please check your email to reset your password. 11 |

12 |
13 | 14 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/fixedHeader.dataTables.min.css: -------------------------------------------------------------------------------- 1 | table.fixedHeader-floating{position:fixed !important;background-color:white}table.fixedHeader-floating.no-footer{border-bottom-width:0}table.fixedHeader-locked{position:absolute !important;background-color:white}@media print{table.fixedHeader-floating{display:none}} 2 | -------------------------------------------------------------------------------- /Vidly/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Owin; 2 | using Owin; 3 | 4 | [assembly: OwinStartupAttribute(typeof(Vidly.Startup))] 5 | namespace Vidly 6 | { 7 | public partial class Startup 8 | { 9 | public void Configuration(IAppBuilder app) 10 | { 11 | ConfigureAuth(app); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Vidly/Views/Account/ConfirmEmail.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Confirm Email"; 3 | } 4 | 5 |

@ViewBag.Title.

6 |
7 |

8 | Thank you for confirming your email. Please @Html.ActionLink("Click here to Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" }) 9 |

10 |
11 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/rowReorder.dataTables.min.css: -------------------------------------------------------------------------------- 1 | table.dt-rowReorder-float{position:absolute !important;opacity:0.8;table-layout:static;outline:2px solid #888;outline-offset:-2px;z-index:2001}tr.dt-rowReorder-moving{outline:2px solid #555;outline-offset:-2px}body.dt-rowReorder-noOverflow{overflow-x:hidden}table.dataTable td.reorder{text-align:center;cursor:move} 2 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/rowReorder.jqueryui.min.css: -------------------------------------------------------------------------------- 1 | table.dt-rowReorder-float{position:absolute !important;opacity:0.8;table-layout:static;outline:2px solid #888;outline-offset:-2px;z-index:2001}tr.dt-rowReorder-moving{outline:2px solid #555;outline-offset:-2px}body.dt-rowReorder-noOverflow{overflow-x:hidden}table.dataTable td.reorder{text-align:center;cursor:move} 2 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/fixedHeader.jqueryui.css: -------------------------------------------------------------------------------- 1 | table.fixedHeader-floating { 2 | position: fixed !important; 3 | background-color: white; 4 | } 5 | 6 | table.fixedHeader-locked { 7 | position: absolute !important; 8 | background-color: white; 9 | } 10 | 11 | @media print { 12 | table.fixedHeader-floating { 13 | display: none; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/rowReorder.bootstrap.min.css: -------------------------------------------------------------------------------- 1 | table.dt-rowReorder-float{position:absolute !important;opacity:0.8;table-layout:static;outline:2px solid #337ab7;outline-offset:-2px;z-index:2001}tr.dt-rowReorder-moving{outline:2px solid #888;outline-offset:-2px}body.dt-rowReorder-noOverflow{overflow-x:hidden}table.dataTable td.reorder{text-align:center;cursor:move} 2 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/rowReorder.foundation.min.css: -------------------------------------------------------------------------------- 1 | table.dt-rowReorder-float{position:absolute !important;opacity:0.8;table-layout:static;outline:2px solid #337ab7;outline-offset:-2px;z-index:2001}tr.dt-rowReorder-moving{outline:2px solid #888;outline-offset:-2px}body.dt-rowReorder-noOverflow{overflow-x:hidden}table.dataTable td.reorder{text-align:center;cursor:move} 2 | -------------------------------------------------------------------------------- /Vidly/ViewModels/RandomMovieViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using Vidly.Models; 6 | 7 | namespace Vidly.ViewModels 8 | { 9 | public class RandomMovieViewModel 10 | { 11 | public Movie Movie { get; set; } 12 | public List Customers { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/fixedColumns.dataTables.min.css: -------------------------------------------------------------------------------- 1 | table.DTFC_Cloned thead,table.DTFC_Cloned tfoot{background-color:white}div.DTFC_Blocker{background-color:white}div.DTFC_LeftWrapper table.dataTable,div.DTFC_RightWrapper table.dataTable{margin-bottom:0;z-index:2}div.DTFC_LeftWrapper table.dataTable.no-footer,div.DTFC_RightWrapper table.dataTable.no-footer{border-bottom:none} 2 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/fixedHeader.bootstrap.min.css: -------------------------------------------------------------------------------- 1 | table.dataTable.fixedHeader-floating,table.dataTable.fixedHeader-locked{background-color:white;margin-top:0 !important;margin-bottom:0 !important}table.dataTable.fixedHeader-floating{position:fixed !important}table.dataTable.fixedHeader-locked{position:absolute !important}@media print{table.fixedHeader-floating{display:none}} 2 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/fixedHeader.foundation.min.css: -------------------------------------------------------------------------------- 1 | table.dataTable.fixedHeader-floating,table.dataTable.fixedHeader-locked{background-color:white;margin-top:0 !important;margin-bottom:0 !important}table.dataTable.fixedHeader-floating{position:fixed !important}table.dataTable.fixedHeader-locked{position:absolute !important}@media print{table.fixedHeader-floating{display:none}} 2 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/scroller.foundation.min.css: -------------------------------------------------------------------------------- 1 | div.DTS tbody th,div.DTS tbody td{white-space:nowrap}div.DTS div.DTS_Loading{z-index:1}div.DTS div.dataTables_scrollBody{background:repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, #fff 10px, #fff 20px)}div.DTS div.dataTables_scrollBody table{z-index:2}div.DTS div.dataTables_paginate,div.DTS div.dataTables_length{display:none} 2 | -------------------------------------------------------------------------------- /Vidly/Controllers/RentalsController.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 Vidly.Controllers 8 | { 9 | public class RentalsController : Controller 10 | { 11 | public ActionResult New() 12 | { 13 | return View(); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Vidly/ViewModels/CustomerFormViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using Vidly.Models; 6 | 7 | namespace Vidly.ViewModels 8 | { 9 | public class CustomerFormViewModel 10 | { 11 | public IEnumerable MembershipTypes { get; set; } 12 | public Customer Customer { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/scroller.jqueryui.min.css: -------------------------------------------------------------------------------- 1 | div.DTS{display:block !important}div.DTS tbody th,div.DTS tbody td{white-space:nowrap}div.DTS div.DTS_Loading{z-index:1}div.DTS div.dataTables_scrollBody{background:repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, #fff 10px, #fff 20px)}div.DTS div.dataTables_scrollBody table{z-index:2}div.DTS div.dataTables_paginate,div.DTS div.dataTables_length{display:none} 2 | -------------------------------------------------------------------------------- /Vidly/Views/Customers/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model Vidly.Models.Customer 2 | 3 | @{ 4 | ViewBag.Title = Model.Name; 5 | Layout = "~/Views/Shared/_Layout.cshtml"; 6 | } 7 | 8 |

@Model.Name

9 |
    10 |
  • Membership Type: @Model.MembershipType.Name
  • 11 | @if (Model.Birthdate.HasValue) 12 | { 13 |
  • Birthdate: @Model.Birthdate.Value.ToShortDateString()
  • 14 | } 15 |
-------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/scroller.dataTables.min.css: -------------------------------------------------------------------------------- 1 | div.DTS{display:block !important}div.DTS tbody th,div.DTS tbody td{white-space:nowrap}div.DTS div.DTS_Loading{z-index:1}div.DTS div.dataTables_scrollBody{background:repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, #fff 10px, #fff 20px)}div.DTS div.dataTables_scrollBody table{z-index:2}div.DTS div.dataTables_paginate,div.DTS div.dataTables_length{display:none} 2 | -------------------------------------------------------------------------------- /Vidly/Views/Account/ResetPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Reset password confirmation"; 3 | } 4 | 5 |
6 |

@ViewBag.Title.

7 |
8 |
9 |

10 | Your password has been reset. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" }) 11 |

12 |
13 | -------------------------------------------------------------------------------- /Vidly/Views/Movies/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model Vidly.Models.Movie 2 | 3 | @{ 4 | ViewBag.Title = Model.Name; 5 | Layout = "~/Views/Shared/_Layout.cshtml"; 6 | } 7 | 8 |

@Model.Name

9 |
    10 |
  • Genre: @Model.Genre.Name
  • 11 |
  • Release Date: @Model.ReleaseDate.ToLongDateString()
  • 12 |
  • Date Added: @Model.DateAdded.ToLongDateString()
  • 13 |
  • Number in Stock: @Model.NumberInStock
  • 14 |
15 | -------------------------------------------------------------------------------- /Vidly/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace Vidly 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | filters.Add(new AuthorizeAttribute()); 12 | filters.Add(new RequireHttpsAttribute()); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/fixedHeader.dataTables.css: -------------------------------------------------------------------------------- 1 | table.fixedHeader-floating { 2 | position: fixed !important; 3 | background-color: white; 4 | } 5 | 6 | table.fixedHeader-floating.no-footer { 7 | border-bottom-width: 0; 8 | } 9 | 10 | table.fixedHeader-locked { 11 | position: absolute !important; 12 | background-color: white; 13 | } 14 | 15 | @media print { 16 | table.fixedHeader-floating { 17 | display: none; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/scroller.bootstrap.min.css: -------------------------------------------------------------------------------- 1 | div.DTS{display:block !important}div.DTS tbody th,div.DTS tbody td{white-space:nowrap}div.DTS div.DTS_Loading{z-index:1}div.DTS div.dataTables_scrollBody{background:repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, #fff 10px, #fff 20px)}div.DTS div.dataTables_scrollBody table{z-index:2}div.DTS div.dataTables_paginate,div.DTS div.dataTables_length{display:none}div.DTS tbody tr.even{background-color:white} 2 | -------------------------------------------------------------------------------- /Vidly/Models/Rental.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace Vidly.Models 5 | { 6 | public class Rental 7 | { 8 | public int Id { get; set; } 9 | 10 | [Required] 11 | public Customer Customer { get; set; } 12 | 13 | [Required] 14 | public Movie Movie { get; set; } 15 | 16 | public DateTime DateRented { get; set; } 17 | 18 | public DateTime? DateReturned { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/fixedColumns.dataTables.css: -------------------------------------------------------------------------------- 1 | table.DTFC_Cloned thead, 2 | table.DTFC_Cloned tfoot { 3 | background-color: white; 4 | } 5 | 6 | div.DTFC_Blocker { 7 | background-color: white; 8 | } 9 | 10 | div.DTFC_LeftWrapper table.dataTable, 11 | div.DTFC_RightWrapper table.dataTable { 12 | margin-bottom: 0; 13 | z-index: 2; 14 | } 15 | div.DTFC_LeftWrapper table.dataTable.no-footer, 16 | div.DTFC_RightWrapper table.dataTable.no-footer { 17 | border-bottom: none; 18 | } 19 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/scroller.foundation.css: -------------------------------------------------------------------------------- 1 | div.DTS tbody th, 2 | div.DTS tbody td { 3 | white-space: nowrap; 4 | } 5 | div.DTS div.DTS_Loading { 6 | z-index: 1; 7 | } 8 | div.DTS div.dataTables_scrollBody { 9 | background: repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px); 10 | } 11 | div.DTS div.dataTables_scrollBody table { 12 | z-index: 2; 13 | } 14 | div.DTS div.dataTables_paginate, 15 | div.DTS div.dataTables_length { 16 | display: none; 17 | } 18 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/fixedHeader.bootstrap.css: -------------------------------------------------------------------------------- 1 | table.dataTable.fixedHeader-floating, 2 | table.dataTable.fixedHeader-locked { 3 | background-color: white; 4 | margin-top: 0 !important; 5 | margin-bottom: 0 !important; 6 | } 7 | 8 | table.dataTable.fixedHeader-floating { 9 | position: fixed !important; 10 | } 11 | 12 | table.dataTable.fixedHeader-locked { 13 | position: absolute !important; 14 | } 15 | 16 | @media print { 17 | table.fixedHeader-floating { 18 | display: none; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/fixedHeader.foundation.css: -------------------------------------------------------------------------------- 1 | table.dataTable.fixedHeader-floating, 2 | table.dataTable.fixedHeader-locked { 3 | background-color: white; 4 | margin-top: 0 !important; 5 | margin-bottom: 0 !important; 6 | } 7 | 8 | table.dataTable.fixedHeader-floating { 9 | position: fixed !important; 10 | } 11 | 12 | table.dataTable.fixedHeader-locked { 13 | position: absolute !important; 14 | } 15 | 16 | @media print { 17 | table.fixedHeader-floating { 18 | display: none; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/rowReorder.dataTables.css: -------------------------------------------------------------------------------- 1 | table.dt-rowReorder-float { 2 | position: absolute !important; 3 | opacity: 0.8; 4 | table-layout: static; 5 | outline: 2px solid #888; 6 | outline-offset: -2px; 7 | z-index: 2001; 8 | } 9 | 10 | tr.dt-rowReorder-moving { 11 | outline: 2px solid #555; 12 | outline-offset: -2px; 13 | } 14 | 15 | body.dt-rowReorder-noOverflow { 16 | overflow-x: hidden; 17 | } 18 | 19 | table.dataTable td.reorder { 20 | text-align: center; 21 | cursor: move; 22 | } 23 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/rowReorder.jqueryui.css: -------------------------------------------------------------------------------- 1 | table.dt-rowReorder-float { 2 | position: absolute !important; 3 | opacity: 0.8; 4 | table-layout: static; 5 | outline: 2px solid #888; 6 | outline-offset: -2px; 7 | z-index: 2001; 8 | } 9 | 10 | tr.dt-rowReorder-moving { 11 | outline: 2px solid #555; 12 | outline-offset: -2px; 13 | } 14 | 15 | body.dt-rowReorder-noOverflow { 16 | overflow-x: hidden; 17 | } 18 | 19 | table.dataTable td.reorder { 20 | text-align: center; 21 | cursor: move; 22 | } 23 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/rowReorder.bootstrap.css: -------------------------------------------------------------------------------- 1 | table.dt-rowReorder-float { 2 | position: absolute !important; 3 | opacity: 0.8; 4 | table-layout: static; 5 | outline: 2px solid #337ab7; 6 | outline-offset: -2px; 7 | z-index: 2001; 8 | } 9 | 10 | tr.dt-rowReorder-moving { 11 | outline: 2px solid #888; 12 | outline-offset: -2px; 13 | } 14 | 15 | body.dt-rowReorder-noOverflow { 16 | overflow-x: hidden; 17 | } 18 | 19 | table.dataTable td.reorder { 20 | text-align: center; 21 | cursor: move; 22 | } 23 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/rowReorder.foundation.css: -------------------------------------------------------------------------------- 1 | table.dt-rowReorder-float { 2 | position: absolute !important; 3 | opacity: 0.8; 4 | table-layout: static; 5 | outline: 2px solid #337ab7; 6 | outline-offset: -2px; 7 | z-index: 2001; 8 | } 9 | 10 | tr.dt-rowReorder-moving { 11 | outline: 2px solid #888; 12 | outline-offset: -2px; 13 | } 14 | 15 | body.dt-rowReorder-noOverflow { 16 | overflow-x: hidden; 17 | } 18 | 19 | table.dataTable td.reorder { 20 | text-align: center; 21 | cursor: move; 22 | } 23 | -------------------------------------------------------------------------------- /Vidly/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 |
-------------------------------------------------------------------------------- /Vidly/Migrations/201604050626453_AddBirthdateToCustomer.cs: -------------------------------------------------------------------------------- 1 | namespace Vidly.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity.Migrations; 5 | 6 | public partial class AddBirthdateToCustomer : DbMigration 7 | { 8 | public override void Up() 9 | { 10 | AddColumn("dbo.Customers", "Birthdate", c => c.DateTime()); 11 | } 12 | 13 | public override void Down() 14 | { 15 | DropColumn("dbo.Customers", "Birthdate"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/fixedColumns.foundation.min.css: -------------------------------------------------------------------------------- 1 | div.DTFC_LeftHeadWrapper table,div.DTFC_LeftBodyWrapper table,div.DTFC_LeftFootWrapper table{border-right-width:0}div.DTFC_RightHeadWrapper table,div.DTFC_RightBodyWrapper table,div.DTFC_RightFootWrapper table{border-left-width:0}div.DTFC_LeftHeadWrapper table,div.DTFC_RightHeadWrapper table{margin-bottom:0 !important}div.DTFC_LeftBodyWrapper table,div.DTFC_RightBodyWrapper table{border-top:none;margin:0 !important}div.DTFC_LeftFootWrapper table,div.DTFC_RightFootWrapper table{margin-top:0 !important} 2 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/scroller.dataTables.css: -------------------------------------------------------------------------------- 1 | div.DTS { 2 | display: block !important; 3 | } 4 | div.DTS tbody th, 5 | div.DTS tbody td { 6 | white-space: nowrap; 7 | } 8 | div.DTS div.DTS_Loading { 9 | z-index: 1; 10 | } 11 | div.DTS div.dataTables_scrollBody { 12 | background: repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px); 13 | } 14 | div.DTS div.dataTables_scrollBody table { 15 | z-index: 2; 16 | } 17 | div.DTS div.dataTables_paginate, 18 | div.DTS div.dataTables_length { 19 | display: none; 20 | } 21 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/scroller.jqueryui.css: -------------------------------------------------------------------------------- 1 | div.DTS { 2 | display: block !important; 3 | } 4 | div.DTS tbody th, 5 | div.DTS tbody td { 6 | white-space: nowrap; 7 | } 8 | div.DTS div.DTS_Loading { 9 | z-index: 1; 10 | } 11 | div.DTS div.dataTables_scrollBody { 12 | background: repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px); 13 | } 14 | div.DTS div.dataTables_scrollBody table { 15 | z-index: 2; 16 | } 17 | div.DTS div.dataTables_paginate, 18 | div.DTS div.dataTables_length { 19 | display: none; 20 | } 21 | -------------------------------------------------------------------------------- /Vidly/Models/MembershipType.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace Vidly.Models 4 | { 5 | public class MembershipType 6 | { 7 | public byte Id { get; set; } 8 | [Required] 9 | public string Name { get; set; } 10 | public short SignUpFee { get; set; } 11 | public byte DurationInMonths { get; set; } 12 | public byte DiscountRate { get; set; } 13 | 14 | public static readonly byte Unknown = 0; 15 | public static readonly byte PayAsYouGo = 1; 16 | } 17 | } -------------------------------------------------------------------------------- /Vidly/Migrations/201604050620598_AddNameToMembershipType.cs: -------------------------------------------------------------------------------- 1 | namespace Vidly.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity.Migrations; 5 | 6 | public partial class AddNameToMembershipType : DbMigration 7 | { 8 | public override void Up() 9 | { 10 | AddColumn("dbo.MembershipTypes", "Name", c => c.String(nullable: false)); 11 | } 12 | 13 | public override void Down() 14 | { 15 | DropColumn("dbo.MembershipTypes", "Name"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604220403453_AddPhoneToApplicationUser.cs: -------------------------------------------------------------------------------- 1 | namespace Vidly.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity.Migrations; 5 | 6 | public partial class AddPhoneToApplicationUser : DbMigration 7 | { 8 | public override void Up() 9 | { 10 | AddColumn("dbo.AspNetUsers", "Phone", c => c.String(nullable: false, maxLength: 50)); 11 | } 12 | 13 | public override void Down() 14 | { 15 | DropColumn("dbo.AspNetUsers", "Phone"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/common.scss: -------------------------------------------------------------------------------- 1 | 2 | div.dt-button-info { 3 | position: fixed; 4 | top: 50%; 5 | left: 50%; 6 | width: 400px; 7 | margin-top: -100px; 8 | margin-left: -200px; 9 | background-color: white; 10 | border: 2px solid #111; 11 | box-shadow: 3px 3px 8px rgba( 0, 0, 0, 0.3); 12 | border-radius: 3px; 13 | text-align: center; 14 | z-index: 21; 15 | 16 | h2 { 17 | padding: 0.5em; 18 | margin: 0; 19 | font-weight: normal; 20 | border-bottom: 1px solid #ddd; 21 | background-color: #f3f3f3; 22 | } 23 | 24 | > div { 25 | padding: 1em; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604050035427_AddIsSubscribedToCustomer.cs: -------------------------------------------------------------------------------- 1 | namespace Vidly.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity.Migrations; 5 | 6 | public partial class AddIsSubscribedToCustomer : DbMigration 7 | { 8 | public override void Up() 9 | { 10 | AddColumn("dbo.Customers", "IsSubscribedToNewsletter", c => c.Boolean(nullable: false)); 11 | } 12 | 13 | public override void Down() 14 | { 15 | DropColumn("dbo.Customers", "IsSubscribedToNewsletter"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604050216273_ApplyAnnotationsToCustomerName.cs: -------------------------------------------------------------------------------- 1 | namespace Vidly.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity.Migrations; 5 | 6 | public partial class ApplyAnnotationsToCustomerName : DbMigration 7 | { 8 | public override void Up() 9 | { 10 | AlterColumn("dbo.Customers", "Name", c => c.String(nullable: false, maxLength: 255)); 11 | } 12 | 13 | public override void Down() 14 | { 15 | AlterColumn("dbo.Customers", "Name", c => c.String()); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604210511510_AddDrivingLicenseToApplicationUser.cs: -------------------------------------------------------------------------------- 1 | namespace Vidly.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity.Migrations; 5 | 6 | public partial class AddDrivingLicenseToApplicationUser : DbMigration 7 | { 8 | public override void Up() 9 | { 10 | AddColumn("dbo.AspNetUsers", "DrivingLicense", c => c.String(nullable: false, maxLength: 255)); 11 | } 12 | 13 | public override void Down() 14 | { 15 | DropColumn("dbo.AspNetUsers", "DrivingLicense"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Vidly/Dtos/CustomerDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace Vidly.Dtos 5 | { 6 | public class CustomerDto 7 | { 8 | public int Id { get; set; } 9 | 10 | [Required] 11 | [StringLength(255)] 12 | public string Name { get; set; } 13 | 14 | public bool IsSubscribedToNewsletter { get; set; } 15 | 16 | public byte MembershipTypeId { get; set; } 17 | 18 | public MembershipTypeDto MembershipType { get; set; } 19 | 20 | // [Min18YearsIfAMember] 21 | public DateTime? Birthdate { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/scroller.bootstrap.css: -------------------------------------------------------------------------------- 1 | div.DTS { 2 | display: block !important; 3 | } 4 | div.DTS tbody th, 5 | div.DTS tbody td { 6 | white-space: nowrap; 7 | } 8 | div.DTS div.DTS_Loading { 9 | z-index: 1; 10 | } 11 | div.DTS div.dataTables_scrollBody { 12 | background: repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px); 13 | } 14 | div.DTS div.dataTables_scrollBody table { 15 | z-index: 2; 16 | } 17 | div.DTS div.dataTables_paginate, 18 | div.DTS div.dataTables_length { 19 | display: none; 20 | } 21 | 22 | div.DTS tbody tr.even { 23 | background-color: white; 24 | } 25 | -------------------------------------------------------------------------------- /Vidly/Migrations/201605020226564_AddNumberAvailableToMovie.cs: -------------------------------------------------------------------------------- 1 | namespace Vidly.Migrations 2 | { 3 | using System.Data.Entity.Migrations; 4 | 5 | public partial class AddNumberAvailableToMovie : DbMigration 6 | { 7 | public override void Up() 8 | { 9 | AddColumn("dbo.Movies", "NumberAvailable", c => c.Byte(nullable: false)); 10 | 11 | Sql("UPDATE Movies SET NumberAvailable = NumberInStock"); 12 | } 13 | 14 | public override void Down() 15 | { 16 | DropColumn("dbo.Movies", "NumberAvailable"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Vidly/Scripts/DataTables/autoFill.foundation.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | Foundation integration for DataTables' AutoFill 3 | ©2015 SpryMedia Ltd - datatables.net/license 4 | */ 5 | (function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net-zf","datatables.net-autofill"],function(b){return a(b,window,document)}):"object"===typeof exports?module.exports=function(b,c){b||(b=window);if(!c||!c.fn.dataTable)c=require("datatables.net-zf")(b,c).$;c.fn.dataTable.AutoFill||require("datatables.net-autofill")(b,c);return a(c,b,b.document)}:a(jQuery,window,document)})(function(a){a=a.fn.dataTable;a.AutoFill.classes.btn="button tiny";return a}); 6 | -------------------------------------------------------------------------------- /Vidly/Scripts/DataTables/autoFill.bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | Bootstrap integration for DataTables' AutoFill 3 | ©2015 SpryMedia Ltd - datatables.net/license 4 | */ 5 | (function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs","datatables.net-autofill"],function(b){return a(b,window,document)}):"object"===typeof exports?module.exports=function(b,c){b||(b=window);if(!c||!c.fn.dataTable)c=require("datatables.net-bs")(b,c).$;c.fn.dataTable.AutoFill||require("datatables.net-autofill")(b,c);return a(c,b,b.document)}:a(jQuery,window,document)})(function(a){a=a.fn.dataTable;a.AutoFill.classes.btn="btn btn-primary";return a}); 6 | -------------------------------------------------------------------------------- /Vidly/Dtos/MovieDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace Vidly.Dtos 5 | { 6 | public class MovieDto 7 | { 8 | public int Id { get; set; } 9 | 10 | [Required] 11 | [StringLength(255)] 12 | public string Name { get; set; } 13 | 14 | [Required] 15 | public byte GenreId { get; set; } 16 | 17 | public GenreDto Genre { get; set; } 18 | 19 | public DateTime DateAdded { get; set; } 20 | 21 | public DateTime ReleaseDate { get; set; } 22 | 23 | [Range(1, 20)] 24 | public byte NumberInStock { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /Vidly/Scripts/DataTables/autoFill.jqueryui.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | jQuery UI integration for DataTables' AutoFill 3 | ©2015 SpryMedia Ltd - datatables.net/license 4 | */ 5 | (function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net-jqui","datatables.net-autofill"],function(b){return a(b,window,document)}):"object"===typeof exports?module.exports=function(b,c){b||(b=window);if(!c||!c.fn.dataTable)c=require("datatables.net-jqui")(b,c).$;c.fn.dataTable.AutoFill||require("datatables.net-autofill")(b,c);return a(c,b,b.document)}:a(jQuery,window,document)})(function(a){a=a.fn.dataTable;a.AutoFill.classes.btn="ui-button ui-state-default ui-corner-all"; 6 | return a}); 7 | -------------------------------------------------------------------------------- /Vidly/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 Vidly 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 | -------------------------------------------------------------------------------- /Vidly/Views/Movies/Random.cshtml: -------------------------------------------------------------------------------- 1 | @model Vidly.ViewModels.RandomMovieViewModel 2 | @{ 3 | ViewBag.Title = "Random"; 4 | Layout = "~/Views/Shared/_Layout.cshtml"; 5 | } 6 | 7 | @* 8 | This is a comment 9 | On multiple lines 10 | *@ 11 | 12 | 13 | @{ 14 | var className = Model.Customers.Count > 0 ? "popular" : null; 15 | } 16 | 17 |

@Model.Movie.Name

18 | 19 | @if (Model.Customers.Count == 0) 20 | { 21 | No one has rented this movie before. 22 | } 23 | else 24 | { 25 |
    26 | @foreach (var customer in Model.Customers) 27 | { 28 |
  • @customer.Name
  • 29 | } 30 |
31 | } 32 | 33 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604050621225_SetNameOfMembershipTypes.cs: -------------------------------------------------------------------------------- 1 | namespace Vidly.Migrations 2 | { 3 | using System.Data.Entity.Migrations; 4 | 5 | public partial class SetNameOfMembershipTypes : DbMigration 6 | { 7 | public override void Up() 8 | { 9 | Sql("UPDATE MembershipTypes SET Name = 'Pay as You Go' WHERE Id = 1"); 10 | Sql("UPDATE MembershipTypes SET Name = 'Monthly' WHERE Id = 2"); 11 | Sql("UPDATE MembershipTypes SET Name = 'Quarterly' WHERE Id = 3"); 12 | Sql("UPDATE MembershipTypes SET Name = 'Annual' WHERE Id = 4"); 13 | } 14 | 15 | public override void Down() 16 | { 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Vidly/Content/DataTables/css/fixedColumns.foundation.css: -------------------------------------------------------------------------------- 1 | div.DTFC_LeftHeadWrapper table, 2 | div.DTFC_LeftBodyWrapper table, 3 | div.DTFC_LeftFootWrapper table { 4 | border-right-width: 0; 5 | } 6 | 7 | div.DTFC_RightHeadWrapper table, 8 | div.DTFC_RightBodyWrapper table, 9 | div.DTFC_RightFootWrapper table { 10 | border-left-width: 0; 11 | } 12 | 13 | div.DTFC_LeftHeadWrapper table, 14 | div.DTFC_RightHeadWrapper table { 15 | margin-bottom: 0 !important; 16 | } 17 | 18 | div.DTFC_LeftBodyWrapper table, 19 | div.DTFC_RightBodyWrapper table { 20 | border-top: none; 21 | margin: 0 !important; 22 | } 23 | 24 | div.DTFC_LeftFootWrapper table, 25 | div.DTFC_RightFootWrapper table { 26 | margin-top: 0 !important; 27 | } 28 | -------------------------------------------------------------------------------- /Vidly/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 | 10 | 11 | 12 | @Html.Partial("_NavBar") 13 |
14 | @RenderBody() 15 |
16 |
17 |

© @DateTime.Now.Year - Vidly

18 |
19 |
20 | 21 | @Scripts.Render("~/bundles/lib") 22 | @RenderSection("scripts", required: false) 23 | 24 | 25 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604050707219_Genres.cs: -------------------------------------------------------------------------------- 1 | namespace Vidly.Migrations 2 | { 3 | using System.Data.Entity.Migrations; 4 | 5 | public partial class Genres : DbMigration 6 | { 7 | public override void Up() 8 | { 9 | Sql("INSERT INTO Genres (Id, Name) VALUES (1, 'Action')"); 10 | Sql("INSERT INTO Genres (Id, Name) VALUES (2, 'Thriller')"); 11 | Sql("INSERT INTO Genres (Id, Name) VALUES (3, 'Family')"); 12 | Sql("INSERT INTO Genres (Id, Name) VALUES (4, 'Romance')"); 13 | Sql("INSERT INTO Genres (Id, Name) VALUES (5, 'Comedy')"); 14 | } 15 | 16 | public override void Down() 17 | { 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Vidly/Models/Customer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace Vidly.Models 5 | { 6 | public class Customer 7 | { 8 | public int Id { get; set; } 9 | 10 | [Required] 11 | [StringLength(255)] 12 | public string Name { get; set; } 13 | 14 | public bool IsSubscribedToNewsletter { get; set; } 15 | 16 | public MembershipType MembershipType { get; set; } 17 | 18 | [Display(Name = "Membership Type")] 19 | public byte MembershipTypeId { get; set; } 20 | 21 | [Display(Name = "Date of Birth")] 22 | [Min18YearsIfAMember] 23 | public DateTime? Birthdate { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /Vidly/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 Vidly.Controllers 8 | { 9 | [AllowAnonymous] 10 | public class HomeController : Controller 11 | { 12 | public ActionResult Index() 13 | { 14 | return View(); 15 | } 16 | 17 | public ActionResult About() 18 | { 19 | ViewBag.Message = "Your application description page."; 20 | 21 | return View(); 22 | } 23 | 24 | public ActionResult Contact() 25 | { 26 | ViewBag.Message = "Your contact page."; 27 | 28 | return View(); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Vidly/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using System.Web.Http; 3 | using System.Web.Mvc; 4 | using System.Web.Optimization; 5 | using System.Web.Routing; 6 | using Vidly.App_Start; 7 | 8 | namespace Vidly 9 | { 10 | public class MvcApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | Mapper.Initialize(c => c.AddProfile()); 15 | GlobalConfiguration.Configure(WebApiConfig.Register); 16 | AreaRegistration.RegisterAllAreas(); 17 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 18 | RouteConfig.RegisterRoutes(RouteTable.Routes); 19 | BundleConfig.RegisterBundles(BundleTable.Bundles); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Vidly/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Override the default bootstrap behavior where horizontal description lists 13 | will truncate terms that are too long to fit in the left column 14 | */ 15 | .dl-horizontal dt { 16 | white-space: normal; 17 | } 18 | 19 | /* Set width on the form input elements since they're 100% wide by default */ 20 | input, 21 | select, 22 | textarea { 23 | max-width: 280px; 24 | } 25 | 26 | .field-validation-error, 27 | label.error { 28 | color: red; 29 | } 30 | 31 | .input-validation-error, 32 | input.error { 33 | border: 2px solid red; 34 | } -------------------------------------------------------------------------------- /Vidly/App_Start/MappingProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Vidly.Dtos; 3 | using Vidly.Models; 4 | 5 | namespace Vidly.App_Start 6 | { 7 | public class MappingProfile : Profile 8 | { 9 | public MappingProfile() 10 | { 11 | // Domain to Dto 12 | Mapper.CreateMap(); 13 | Mapper.CreateMap(); 14 | Mapper.CreateMap(); 15 | Mapper.CreateMap(); 16 | 17 | 18 | // Dto to Domain 19 | Mapper.CreateMap() 20 | .ForMember(c => c.Id, opt => opt.Ignore()); 21 | 22 | Mapper.CreateMap() 23 | .ForMember(c => c.Id, opt => opt.Ignore()); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Vidly/Models/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Entity; 2 | using Microsoft.AspNet.Identity.EntityFramework; 3 | 4 | namespace Vidly.Models 5 | { 6 | public class ApplicationDbContext : IdentityDbContext 7 | { 8 | public DbSet Customers { get; set; } 9 | public DbSet Movies { get; set; } 10 | public DbSet MembershipTypes { get; set; } 11 | public DbSet Genres { get; set; } 12 | public DbSet Rentals { get; set; } 13 | 14 | public ApplicationDbContext() 15 | : base("DefaultConnection", throwIfV1Schema: false) 16 | { 17 | } 18 | 19 | public static ApplicationDbContext Create() 20 | { 21 | return new ApplicationDbContext(); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Vidly/Models/Movie.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.ComponentModel.DataAnnotations; 4 | 5 | namespace Vidly.Models 6 | { 7 | public class Movie 8 | { 9 | public int Id { get; set; } 10 | 11 | [Required] 12 | [StringLength(255)] 13 | public string Name { get; set; } 14 | 15 | public Genre Genre { get; set; } 16 | 17 | [Display(Name = "Genre")] 18 | [Required] 19 | public byte GenreId { get; set; } 20 | 21 | public DateTime DateAdded { get; set; } 22 | 23 | [Display(Name = "Release Date")] 24 | public DateTime ReleaseDate { get; set; } 25 | 26 | [Display(Name = "Number in Stock")] 27 | [Range(1, 20)] 28 | public byte NumberInStock { get; set; } 29 | 30 | public byte NumberAvailable { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /Vidly/Scripts/DataTables/responsive.jqueryui.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | jQuery UI integration for DataTables' Responsive 3 | ©2015 SpryMedia Ltd - datatables.net/license 4 | */ 5 | (function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-jqui","datatables.net-responsive"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);if(!b||!b.fn.dataTable)b=require("datatables.net-jqui")(a,b).$;b.fn.dataTable.Responsive||require("datatables.net-responsive")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c){var a=c.fn.dataTable,b=a.Responsive.display,f=b.modal;b.modal=function(a){return function(b, 6 | d,e){c.fn.dialog?d||c("
").append(e()).appendTo("body").dialog(c.extend(!0,{title:a&&a.header?a.header(b):"",width:500},a.dialog)):f(b,d,e)}};return a.Responsive}); 7 | -------------------------------------------------------------------------------- /Vidly/Views/Account/SendCode.cshtml: -------------------------------------------------------------------------------- 1 | @model Vidly.Models.SendCodeViewModel 2 | @{ 3 | ViewBag.Title = "Send"; 4 | } 5 | 6 |

@ViewBag.Title.

7 | 8 | @using (Html.BeginForm("SendCode", "Account", new { ReturnUrl = Model.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { 9 | @Html.AntiForgeryToken() 10 | @Html.Hidden("rememberMe", @Model.RememberMe) 11 |

Send verification code

12 |
13 |
14 |
15 | Select Two-Factor Authentication Provider: 16 | @Html.DropDownListFor(model => model.SelectedProvider, Model.Providers) 17 | 18 |
19 |
20 | } 21 | 22 | @section Scripts { 23 | @Scripts.Render("~/bundles/jqueryval") 24 | } 25 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604050143242_PopulateMembershipTypes.cs: -------------------------------------------------------------------------------- 1 | namespace Vidly.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity.Migrations; 5 | 6 | public partial class PopulateMembershipTypes : DbMigration 7 | { 8 | public override void Up() 9 | { 10 | Sql("INSERT INTO MembershipTypes (Id, SignUpFee, DurationInMonths, DiscountRate) VALUES (1, 0, 0, 0)"); 11 | Sql("INSERT INTO MembershipTypes (Id, SignUpFee, DurationInMonths, DiscountRate) VALUES (2, 30, 1, 10)"); 12 | Sql("INSERT INTO MembershipTypes (Id, SignUpFee, DurationInMonths, DiscountRate) VALUES (3, 90, 3, 15)"); 13 | Sql("INSERT INTO MembershipTypes (Id, SignUpFee, DurationInMonths, DiscountRate) VALUES (4, 300, 12, 20)"); 14 | } 15 | 16 | public override void Down() 17 | { 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Vidly/Scripts/DataTables/buttons.bootstrap4.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | Bootstrap integration for DataTables' Buttons 3 | ©2015 SpryMedia Ltd - datatables.net/license 4 | */ 5 | (function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs4","datatables.net-buttons"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);if(!b||!b.fn.dataTable)b=require("datatables.net-bs4")(a,b).$;b.fn.dataTable.Buttons||require("datatables.net-buttons")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c){var a=c.fn.dataTable;c.extend(!0,a.Buttons.defaults,{dom:{container:{className:"dt-buttons btn-group"}, 6 | button:{className:"btn btn-secondary"},collection:{tag:"div",className:"dt-button-collection dropdown-menu",button:{tag:"a",className:"dt-button dropdown-item"}}}});a.ext.buttons.collection.className+=" dropdown-toggle";return a.Buttons}); 7 | -------------------------------------------------------------------------------- /Vidly/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web.Http; 5 | using Newtonsoft.Json; 6 | using Newtonsoft.Json.Serialization; 7 | 8 | namespace Vidly 9 | { 10 | public static class WebApiConfig 11 | { 12 | public static void Register(HttpConfiguration config) 13 | { 14 | var settings = config.Formatters.JsonFormatter.SerializerSettings; 15 | settings.ContractResolver = new CamelCasePropertyNamesContractResolver(); 16 | settings.Formatting = Formatting.Indented; 17 | 18 | config.MapHttpAttributeRoutes(); 19 | 20 | config.Routes.MapHttpRoute( 21 | name: "DefaultApi", 22 | routeTemplate: "api/{controller}/{id}", 23 | defaults: new { id = RouteParameter.Optional } 24 | ); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Vidly/Properties/PublishProfiles/Testing.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | FileSystem 9 | Testing 10 | Any CPU 11 | 12 | True 13 | False 14 | C:\Testing 15 | False 16 | 17 | -------------------------------------------------------------------------------- /Vidly/Properties/PublishProfiles/GoDaddyProfile.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | FileSystem 9 | Release 10 | Any CPU 11 | 12 | True 13 | False 14 | C:\Deploy 15 | False 16 | 17 | -------------------------------------------------------------------------------- /Vidly/Scripts/DataTables/responsive.foundation.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | Foundation integration for DataTables' Responsive 3 | ©2015 SpryMedia Ltd - datatables.net/license 4 | */ 5 | (function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-zf","datatables.net-responsive"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);if(!b||!b.fn.dataTable)b=require("datatables.net-zf")(a,b).$;b.fn.dataTable.Responsive||require("datatables.net-responsive")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c){var a=c.fn.dataTable,b=a.Responsive.display,f=b.modal;b.modal=function(a){return function(b, 6 | d,e){c.fn.foundation?d||c('
').append('×').append(a&&a.header?"

"+a.header(b)+"

":null).append(e()).appendTo("body").foundation("reveal","open"):f(b,d,e)}};return a.Responsive}); 7 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604050707219_Genres.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Vidly.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.1-30610")] 10 | public sealed partial class Genres : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(Genres)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201604050707219_Genres"; } 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 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604050706359_AddMovie.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Vidly.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.1-30610")] 10 | public sealed partial class AddMovie : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(AddMovie)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201604050706359_AddMovie"; } 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 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604210211534_SeedUsers.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Vidly.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.1-30610")] 10 | public sealed partial class SeedUsers : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(SeedUsers)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201604210211534_SeedUsers"; } 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 | -------------------------------------------------------------------------------- /Vidly/Migrations/201605020104315_AddRental.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Vidly.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.1-30610")] 10 | public sealed partial class AddRental : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(AddRental)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201605020104315_AddRental"; } 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 | -------------------------------------------------------------------------------- /Vidly/Scripts/DataTables/buttons.bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | Bootstrap integration for DataTables' Buttons 3 | ©2015 SpryMedia Ltd - datatables.net/license 4 | */ 5 | (function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs","datatables.net-buttons"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);if(!b||!b.fn.dataTable)b=require("datatables.net-bs")(a,b).$;b.fn.dataTable.Buttons||require("datatables.net-buttons")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c){var a=c.fn.dataTable;c.extend(!0,a.Buttons.defaults,{dom:{container:{className:"dt-buttons btn-group"}, 6 | button:{className:"btn btn-default"},collection:{tag:"ul",className:"dt-button-collection dropdown-menu",button:{tag:"li",className:"dt-button"},buttonLiner:{tag:"a",className:""}}}});a.ext.buttons.collection.text=function(a){return a.i18n("buttons.collection",'Collection ')};return a.Buttons}); 7 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604040445246_InitialModel.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Vidly.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.1-30610")] 10 | public sealed partial class InitialModel : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(InitialModel)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201604040445246_InitialModel"; } 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 | -------------------------------------------------------------------------------- /Vidly/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNet.Identity 2 | @if (Request.IsAuthenticated) 3 | { 4 | using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) 5 | { 6 | @Html.AntiForgeryToken() 7 | 8 | 14 | } 15 | } 16 | else 17 | { 18 | 22 | } 23 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604050041345_AddMembershipType.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Vidly.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.1-30610")] 10 | public sealed partial class AddMembershipType : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(AddMembershipType)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201604050041345_AddMembershipType"; } 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 | -------------------------------------------------------------------------------- /Vidly/Views/Manage/AddPhoneNumber.cshtml: -------------------------------------------------------------------------------- 1 | @model Vidly.Models.AddPhoneNumberViewModel 2 | @{ 3 | ViewBag.Title = "Phone Number"; 4 | } 5 | 6 |

@ViewBag.Title.

7 | 8 | @using (Html.BeginForm("AddPhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 9 | { 10 | @Html.AntiForgeryToken() 11 |

Add a phone number

12 |
13 | @Html.ValidationSummary("", new { @class = "text-danger" }) 14 |
15 | @Html.LabelFor(m => m.Number, new { @class = "col-md-2 control-label" }) 16 |
17 | @Html.TextBoxFor(m => m.Number, new { @class = "form-control" }) 18 |
19 |
20 |
21 |
22 | 23 |
24 |
25 | } 26 | 27 | @section Scripts { 28 | @Scripts.Render("~/bundles/jqueryval") 29 | } 30 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604050626453_AddBirthdateToCustomer.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Vidly.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.1-30610")] 10 | public sealed partial class AddBirthdateToCustomer : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(AddBirthdateToCustomer)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201604050626453_AddBirthdateToCustomer"; } 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 | -------------------------------------------------------------------------------- /Vidly/Views/Account/ForgotPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model Vidly.Models.ForgotPasswordViewModel 2 | @{ 3 | ViewBag.Title = "Forgot your password?"; 4 | } 5 | 6 |

@ViewBag.Title.

7 | 8 | @using (Html.BeginForm("ForgotPassword", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 9 | { 10 | @Html.AntiForgeryToken() 11 |

Enter your email.

12 |
13 | @Html.ValidationSummary("", new { @class = "text-danger" }) 14 |
15 | @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) 16 |
17 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) 18 |
19 |
20 |
21 |
22 | 23 |
24 |
25 | } 26 | 27 | @section Scripts { 28 | @Scripts.Render("~/bundles/jqueryval") 29 | } 30 | -------------------------------------------------------------------------------- /Vidly/Views/Shared/_NavBar.cshtml: -------------------------------------------------------------------------------- 1 | 21 | 22 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604050143242_PopulateMembershipTypes.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Vidly.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.1-30610")] 10 | public sealed partial class PopulateMembershipTypes : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(PopulateMembershipTypes)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201604050143242_PopulateMembershipTypes"; } 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 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604050620598_AddNameToMembershipType.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Vidly.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.1-30610")] 10 | public sealed partial class AddNameToMembershipType : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(AddNameToMembershipType)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201604050620598_AddNameToMembershipType"; } 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 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604050035427_AddIsSubscribedToCustomer.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Vidly.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.1-30610")] 10 | public sealed partial class AddIsSubscribedToCustomer : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(AddIsSubscribedToCustomer)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201604050035427_AddIsSubscribedToCustomer"; } 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 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604050621225_SetNameOfMembershipTypes.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Vidly.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.1-30610")] 10 | public sealed partial class SetNameOfMembershipTypes : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(SetNameOfMembershipTypes)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201604050621225_SetNameOfMembershipTypes"; } 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 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604220403453_AddPhoneToApplicationUser.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Vidly.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.1-30610")] 10 | public sealed partial class AddPhoneToApplicationUser : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(AddPhoneToApplicationUser)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201604220403453_AddPhoneToApplicationUser"; } 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 | -------------------------------------------------------------------------------- /Vidly/Migrations/201605020226564_AddNumberAvailableToMovie.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Vidly.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.1-30610")] 10 | public sealed partial class AddNumberAvailableToMovie : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(AddNumberAvailableToMovie)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201605020226564_AddNumberAvailableToMovie"; } 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 | -------------------------------------------------------------------------------- /Vidly/Scripts/DataTables/buttons.jqueryui.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | jQuery UI integration for DataTables' Buttons 3 | ©2015 SpryMedia Ltd - datatables.net/license 4 | */ 5 | (function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-jqui","datatables.net-buttons"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);if(!b||!b.fn.dataTable)b=require("datatables.net-jqui")(a,b).$;b.fn.dataTable.Buttons||require("datatables.net-buttons")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c){var a=c.fn.dataTable;c.extend(!0,a.Buttons.defaults,{dom:{container:{className:"dt-buttons ui-buttonset"}, 6 | button:{className:"dt-button ui-button ui-state-default ui-button-text-only",disabled:"ui-state-disabled",active:"ui-state-active"},buttonLiner:{tag:"span",className:"ui-button-text"}}});a.ext.buttons.collection.text=function(a){return a.i18n("buttons.collection",'Collection ')};return a.Buttons}); 7 | -------------------------------------------------------------------------------- /Vidly/Views/Movies/ReadOnlyList.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "Movies"; 5 | Layout = "~/Views/Shared/_Layout.cshtml"; 6 | } 7 | 8 |

Movies

9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
MovieGenre
20 | @section scripts 21 | { 22 | 40 | } 41 | -------------------------------------------------------------------------------- /Vidly/Models/Min18YearsIfAMember.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace Vidly.Models 5 | { 6 | public class Min18YearsIfAMember : ValidationAttribute 7 | { 8 | protected override ValidationResult IsValid(object value, ValidationContext validationContext) 9 | { 10 | var customer = (Customer)validationContext.ObjectInstance; 11 | 12 | if (customer.MembershipTypeId == MembershipType.Unknown || 13 | customer.MembershipTypeId == MembershipType.PayAsYouGo) 14 | return ValidationResult.Success; 15 | 16 | if (customer.Birthdate == null) 17 | return new ValidationResult("Birthdate is required."); 18 | 19 | var age = DateTime.Today.Year - customer.Birthdate.Value.Year; 20 | 21 | return (age >= 18) 22 | ? ValidationResult.Success 23 | : new ValidationResult("Customer should be at least 18 years old to go on a membership."); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Vidly/Migrations/201604050216273_ApplyAnnotationsToCustomerName.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Vidly.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.1-30610")] 10 | public sealed partial class ApplyAnnotationsToCustomerName : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(ApplyAnnotationsToCustomerName)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201604050216273_ApplyAnnotationsToCustomerName"; } 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 | -------------------------------------------------------------------------------- /Vidly/Migrations/201604210511510_AddDrivingLicenseToApplicationUser.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Vidly.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.1-30610")] 10 | public sealed partial class AddDrivingLicenseToApplicationUser : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(AddDrivingLicenseToApplicationUser)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201604210511510_AddDrivingLicenseToApplicationUser"; } 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 | -------------------------------------------------------------------------------- /Vidly/Views/Manage/VerifyPhoneNumber.cshtml: -------------------------------------------------------------------------------- 1 | @model Vidly.Models.VerifyPhoneNumberViewModel 2 | @{ 3 | ViewBag.Title = "Verify Phone Number"; 4 | } 5 | 6 |

@ViewBag.Title.

7 | 8 | @using (Html.BeginForm("VerifyPhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 9 | { 10 | @Html.AntiForgeryToken() 11 | @Html.Hidden("phoneNumber", @Model.PhoneNumber) 12 |

Enter verification code

13 |
@ViewBag.Status
14 |
15 | @Html.ValidationSummary("", new { @class = "text-danger" }) 16 |
17 | @Html.LabelFor(m => m.Code, new { @class = "col-md-2 control-label" }) 18 |
19 | @Html.TextBoxFor(m => m.Code, new { @class = "form-control" }) 20 |
21 |
22 |
23 |
24 | 25 |
26 |
27 | } 28 | 29 | @section Scripts { 30 | @Scripts.Render("~/bundles/jqueryval") 31 | } 32 | -------------------------------------------------------------------------------- /Vidly/Scripts/DataTables/buttons.foundation.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | Foundation integration for DataTables' Buttons 3 | ©2015 SpryMedia Ltd - datatables.net/license 4 | */ 5 | (function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-zf","datatables.net-buttons"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);if(!b||!b.fn.dataTable)b=require("datatables.net-zf")(a,b).$;b.fn.dataTable.Buttons||require("datatables.net-buttons")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c){var a=c.fn.dataTable;c.extend(!0,a.Buttons.defaults,{dom:{container:{tag:"div",className:"dt-buttons button-group"}, 6 | buttonContainer:{tag:null,className:""},button:{tag:"a",className:"button small"},buttonLiner:{tag:null},collection:6===a.ext.foundationVersion?{tag:"div",className:"dt-button-collection dropdown-pane is-open button-group stacked"}:{tag:"ul",className:"dt-button-collection f-dropdown open dropdown-pane is-open",button:{tag:"li",className:"small"},buttonLiner:{tag:"a"}}}});a.ext.buttons.collection.className="buttons-collection dropdown";return a.Buttons}); 7 | -------------------------------------------------------------------------------- /Vidly/Migrations/Configuration.cs: -------------------------------------------------------------------------------- 1 | namespace Vidly.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity; 5 | using System.Data.Entity.Migrations; 6 | using System.Linq; 7 | 8 | internal sealed class Configuration : DbMigrationsConfiguration 9 | { 10 | public Configuration() 11 | { 12 | AutomaticMigrationsEnabled = false; 13 | } 14 | 15 | protected override void Seed(Vidly.Models.ApplicationDbContext context) 16 | { 17 | // This method will be called after migrating to the latest version. 18 | 19 | // You can use the DbSet.AddOrUpdate() helper extension method 20 | // to avoid creating duplicate seed data. E.g. 21 | // 22 | // context.People.AddOrUpdate( 23 | // p => p.FullName, 24 | // new Person { FullName = "Andrew Peters" }, 25 | // new Person { FullName = "Brice Lambson" }, 26 | // new Person { FullName = "Rowan Miller" } 27 | // ); 28 | // 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Vidly/Scripts/DataTables/autoFill.bootstrap.js: -------------------------------------------------------------------------------- 1 | /*! Bootstrap integration for DataTables' AutoFill 2 | * ©2015 SpryMedia Ltd - datatables.net/license 3 | */ 4 | 5 | (function( factory ){ 6 | if ( typeof define === 'function' && define.amd ) { 7 | // AMD 8 | define( ['jquery', 'datatables.net-bs', 'datatables.net-autofill'], function ( $ ) { 9 | return factory( $, window, document ); 10 | } ); 11 | } 12 | else if ( typeof exports === 'object' ) { 13 | // CommonJS 14 | module.exports = function (root, $) { 15 | if ( ! root ) { 16 | root = window; 17 | } 18 | 19 | if ( ! $ || ! $.fn.dataTable ) { 20 | $ = require('datatables.net-bs')(root, $).$; 21 | } 22 | 23 | if ( ! $.fn.dataTable.AutoFill ) { 24 | require('datatables.net-autofill')(root, $); 25 | } 26 | 27 | return factory( $, root, root.document ); 28 | }; 29 | } 30 | else { 31 | // Browser 32 | factory( jQuery, window, document ); 33 | } 34 | }(function( $, window, document, undefined ) { 35 | 'use strict'; 36 | var DataTable = $.fn.dataTable; 37 | 38 | 39 | DataTable.AutoFill.classes.btn = 'btn btn-primary'; 40 | 41 | 42 | return DataTable; 43 | })); -------------------------------------------------------------------------------- /Vidly/Scripts/DataTables/autoFill.foundation.js: -------------------------------------------------------------------------------- 1 | /*! Foundation integration for DataTables' AutoFill 2 | * ©2015 SpryMedia Ltd - datatables.net/license 3 | */ 4 | 5 | (function( factory ){ 6 | if ( typeof define === 'function' && define.amd ) { 7 | // AMD 8 | define( ['jquery', 'datatables.net-zf', 'datatables.net-autofill'], function ( $ ) { 9 | return factory( $, window, document ); 10 | } ); 11 | } 12 | else if ( typeof exports === 'object' ) { 13 | // CommonJS 14 | module.exports = function (root, $) { 15 | if ( ! root ) { 16 | root = window; 17 | } 18 | 19 | if ( ! $ || ! $.fn.dataTable ) { 20 | $ = require('datatables.net-zf')(root, $).$; 21 | } 22 | 23 | if ( ! $.fn.dataTable.AutoFill ) { 24 | require('datatables.net-autofill')(root, $); 25 | } 26 | 27 | return factory( $, root, root.document ); 28 | }; 29 | } 30 | else { 31 | // Browser 32 | factory( jQuery, window, document ); 33 | } 34 | }(function( $, window, document, undefined ) { 35 | 'use strict'; 36 | var DataTable = $.fn.dataTable; 37 | 38 | 39 | DataTable.AutoFill.classes.btn = 'button tiny'; 40 | 41 | 42 | return DataTable; 43 | })); -------------------------------------------------------------------------------- /Vidly/Scripts/DataTables/autoFill.jqueryui.js: -------------------------------------------------------------------------------- 1 | /*! jQuery UI integration for DataTables' AutoFill 2 | * ©2015 SpryMedia Ltd - datatables.net/license 3 | */ 4 | 5 | (function( factory ){ 6 | if ( typeof define === 'function' && define.amd ) { 7 | // AMD 8 | define( ['jquery', 'datatables.net-jqui', 'datatables.net-autofill'], function ( $ ) { 9 | return factory( $, window, document ); 10 | } ); 11 | } 12 | else if ( typeof exports === 'object' ) { 13 | // CommonJS 14 | module.exports = function (root, $) { 15 | if ( ! root ) { 16 | root = window; 17 | } 18 | 19 | if ( ! $ || ! $.fn.dataTable ) { 20 | $ = require('datatables.net-jqui')(root, $).$; 21 | } 22 | 23 | if ( ! $.fn.dataTable.AutoFill ) { 24 | require('datatables.net-autofill')(root, $); 25 | } 26 | 27 | return factory( $, root, root.document ); 28 | }; 29 | } 30 | else { 31 | // Browser 32 | factory( jQuery, window, document ); 33 | } 34 | }(function( $, window, document, undefined ) { 35 | 'use strict'; 36 | var DataTable = $.fn.dataTable; 37 | 38 | 39 | DataTable.AutoFill.classes.btn = 'ui-button ui-state-default ui-corner-all'; 40 | 41 | 42 | return DataTable; 43 | })); 44 | -------------------------------------------------------------------------------- /Vidly/Scripts/DataTables/responsive.bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | Bootstrap integration for DataTables' Responsive 3 | ©2015 SpryMedia Ltd - datatables.net/license 4 | */ 5 | (function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs","datatables.net-responsive"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);if(!b||!b.fn.dataTable)b=require("datatables.net-bs")(a,b).$;b.fn.dataTable.Responsive||require("datatables.net-responsive")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c){var a=c.fn.dataTable,b=a.Responsive.display,f=b.modal;b.modal=function(a){return function(b, 6 | d,e){c.fn.modal?d||(d=c('