├── .gitattributes ├── .gitignore ├── InventoryManagementSystem.sln ├── InventoryManagementSystem ├── App_Start │ ├── BundleConfig.cs │ ├── FilterConfig.cs │ ├── IdentityConfig.cs │ ├── RouteConfig.cs │ └── Startup.Auth.cs ├── ApplicationInsights.config ├── Content │ ├── PagedList.css │ ├── Site.css │ ├── bootstrap.css │ ├── bootstrap.min.css │ └── img │ │ ├── 0.08.jpeg │ │ ├── 0.09.jpeg │ │ ├── 01.jpg │ │ ├── 02.jpg │ │ ├── Back.jpg │ │ ├── BikeOnCar.jpg │ │ ├── Bikesinline.jpg │ │ ├── FIXED.jpg │ │ ├── Faastbike.jpg │ │ ├── FixieChix.jpg │ │ ├── Orange.jpg │ │ ├── Trail.jpg │ │ ├── Youth.jpg │ │ ├── fixie.JPG │ │ ├── racer.JPG │ │ ├── roadbike.JPG │ │ ├── they.mov │ │ ├── train-15.jpg │ │ └── trains.jpeg ├── Controllers │ ├── AccountController.cs │ ├── AssignmentController.cs │ ├── CustomerController.cs │ ├── DepartmentController.cs │ ├── EmployeeController.cs │ ├── HomeController.cs │ ├── ManageController.cs │ ├── ProductController.cs │ └── PurchaseController.cs ├── DAL │ ├── StoreConfiguration.cs │ ├── StoreContext.cs │ ├── StoreInitializer.cs │ ├── StoreInterceptorErrors.cs │ ├── StoreInterceptorLogging.cs │ └── StoreInterceptorTransientErrors.cs ├── Global.asax ├── Global.asax.cs ├── InventoryManagementSystem.csproj ├── Logging │ ├── ILogger.cs │ └── Logger.cs ├── Models │ ├── AccountViewModels.cs │ ├── Assignment.cs │ ├── Customer.cs │ ├── Department.cs │ ├── Employee.cs │ ├── IdentityModels.cs │ ├── ManageViewModels.cs │ ├── Product.cs │ ├── Purchase.cs │ └── Transaction.cs ├── Properties │ └── AssemblyInfo.cs ├── Scripts │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-1.10.2.intellisense.js │ ├── jquery-1.10.2.js │ ├── jquery-1.10.2.min.js │ ├── jquery-1.10.2.min.map │ ├── jquery.validate-vsdoc.js │ ├── jquery.validate.js │ ├── jquery.validate.min.js │ ├── jquery.validate.unobtrusive.js │ ├── jquery.validate.unobtrusive.min.js │ ├── modernizr-2.6.2.js │ ├── respond.js │ └── respond.min.js ├── Startup.cs ├── ViewModels │ └── EmployeeIndexData.cs ├── Views │ ├── Account │ │ ├── ConfirmEmail.cshtml │ │ ├── ExternalLoginConfirmation.cshtml │ │ ├── ExternalLoginFailure.cshtml │ │ ├── ForgotPassword.cshtml │ │ ├── ForgotPasswordConfirmation.cshtml │ │ ├── Login.cshtml │ │ ├── Register.cshtml │ │ ├── ResetPassword.cshtml │ │ ├── ResetPasswordConfirmation.cshtml │ │ ├── SendCode.cshtml │ │ ├── VerifyCode.cshtml │ │ └── _ExternalLoginsListPartial.cshtml │ ├── Assignment │ │ ├── Create.cshtml │ │ ├── Delete.cshtml │ │ ├── Details.cshtml │ │ ├── Edit.cshtml │ │ └── Index.cshtml │ ├── Customer │ │ ├── Create.cshtml │ │ ├── Delete.cshtml │ │ ├── Details.cshtml │ │ ├── Edit.cshtml │ │ └── Index.cshtml │ ├── Department │ │ ├── Create.cshtml │ │ ├── Delete.cshtml │ │ ├── Details.cshtml │ │ ├── Edit.cshtml │ │ └── Index.cshtml │ ├── Employee │ │ ├── Create.cshtml │ │ ├── Delete.cshtml │ │ ├── Details.cshtml │ │ ├── Edit.cshtml │ │ └── Index.cshtml │ ├── Home │ │ ├── About.cshtml │ │ ├── Contact.cshtml │ │ └── Index.cshtml │ ├── Manage │ │ ├── AddPhoneNumber.cshtml │ │ ├── ChangePassword.cshtml │ │ ├── Index.cshtml │ │ ├── ManageLogins.cshtml │ │ ├── SetPassword.cshtml │ │ └── VerifyPhoneNumber.cshtml │ ├── Product │ │ ├── Create.cshtml │ │ ├── Delete.cshtml │ │ ├── Details.cshtml │ │ ├── Edit.cshtml │ │ └── Index.cshtml │ ├── Purchase │ │ ├── Create.cshtml │ │ ├── Delete.cshtml │ │ ├── Details.cshtml │ │ ├── Edit.cshtml │ │ └── Index.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── Lockout.cshtml │ │ ├── _Layout.cshtml │ │ └── _LoginPartial.cshtml │ ├── Web.config │ └── _ViewStart.cshtml ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── favicon.ico ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff └── packages.config └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /InventoryManagementSystem.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26430.6 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InventoryManagementSystem", "InventoryManagementSystem\InventoryManagementSystem.csproj", "{B5FB919D-1D54-4808-870D-38A653ED6ABE}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{44B432F8-B855-443D-9814-84B6792C5EEB}" 9 | ProjectSection(SolutionItems) = preProject 10 | README.md = README.md 11 | EndProjectSection 12 | EndProject 13 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ScreenShots", "ScreenShots", "{956D42F2-0762-4EFC-A962-55658DEA85A9}" 14 | ProjectSection(SolutionItems) = preProject 15 | ..\..\..\Pictures\new\Capture.PNG = ..\..\..\Pictures\new\Capture.PNG 16 | ..\..\..\Pictures\new\Capture1.PNG = ..\..\..\Pictures\new\Capture1.PNG 17 | EndProjectSection 18 | EndProject 19 | Global 20 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 21 | Debug|Any CPU = Debug|Any CPU 22 | Release|Any CPU = Release|Any CPU 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {B5FB919D-1D54-4808-870D-38A653ED6ABE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 26 | {B5FB919D-1D54-4808-870D-38A653ED6ABE}.Debug|Any CPU.Build.0 = Debug|Any CPU 27 | {B5FB919D-1D54-4808-870D-38A653ED6ABE}.Release|Any CPU.ActiveCfg = Release|Any CPU 28 | {B5FB919D-1D54-4808-870D-38A653ED6ABE}.Release|Any CPU.Build.0 = Release|Any CPU 29 | EndGlobalSection 30 | GlobalSection(SolutionProperties) = preSolution 31 | HideSolutionNode = FALSE 32 | EndGlobalSection 33 | GlobalSection(NestedProjects) = preSolution 34 | {956D42F2-0762-4EFC-A962-55658DEA85A9} = {44B432F8-B855-443D-9814-84B6792C5EEB} 35 | EndGlobalSection 36 | EndGlobal 37 | -------------------------------------------------------------------------------- /InventoryManagementSystem/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace InventoryManagementSystem 5 | { 6 | public class BundleConfig 7 | { 8 | // For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 12 | "~/Scripts/jquery-{version}.js")); 13 | 14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( 15 | "~/Scripts/jquery.validate*")); 16 | 17 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 18 | // ready for production, use the build tool at https://modernizr.com to pick only the tests you need. 19 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 20 | "~/Scripts/modernizr-*")); 21 | 22 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 23 | "~/Scripts/bootstrap.js", 24 | "~/Scripts/respond.js")); 25 | 26 | bundles.Add(new StyleBundle("~/Content/css").Include( 27 | "~/Content/bootstrap.css", 28 | "~/Content/site.css")); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /InventoryManagementSystem/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace InventoryManagementSystem 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /InventoryManagementSystem/App_Start/IdentityConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data.Entity; 4 | using System.Linq; 5 | using System.Security.Claims; 6 | using System.Threading.Tasks; 7 | using System.Web; 8 | using Microsoft.AspNet.Identity; 9 | using Microsoft.AspNet.Identity.EntityFramework; 10 | using Microsoft.AspNet.Identity.Owin; 11 | using Microsoft.Owin; 12 | using Microsoft.Owin.Security; 13 | using InventoryManagementSystem.Models; 14 | 15 | namespace InventoryManagementSystem 16 | { 17 | public class EmailService : IIdentityMessageService 18 | { 19 | public Task SendAsync(IdentityMessage message) 20 | { 21 | // Plug in your email service here to send an email. 22 | return Task.FromResult(0); 23 | } 24 | } 25 | 26 | public class SmsService : IIdentityMessageService 27 | { 28 | public Task SendAsync(IdentityMessage message) 29 | { 30 | // Plug in your SMS service here to send a text message. 31 | return Task.FromResult(0); 32 | } 33 | } 34 | 35 | // Configure the application user manager used in this application. UserManager is defined in ASP.NET Identity and is used by the application. 36 | public class ApplicationUserManager : UserManager 37 | { 38 | public ApplicationUserManager(IUserStore store) 39 | : base(store) 40 | { 41 | } 42 | 43 | public static ApplicationUserManager Create(IdentityFactoryOptions options, IOwinContext context) 44 | { 45 | var manager = new ApplicationUserManager(new UserStore(context.Get())); 46 | // Configure validation logic for usernames 47 | manager.UserValidator = new UserValidator(manager) 48 | { 49 | AllowOnlyAlphanumericUserNames = false, 50 | RequireUniqueEmail = true 51 | }; 52 | 53 | // Configure validation logic for passwords 54 | manager.PasswordValidator = new PasswordValidator 55 | { 56 | RequiredLength = 6, 57 | RequireNonLetterOrDigit = true, 58 | RequireDigit = true, 59 | RequireLowercase = true, 60 | RequireUppercase = true, 61 | }; 62 | 63 | // Configure user lockout defaults 64 | manager.UserLockoutEnabledByDefault = true; 65 | manager.DefaultAccountLockoutTimeSpan = TimeSpan.FromMinutes(5); 66 | manager.MaxFailedAccessAttemptsBeforeLockout = 5; 67 | 68 | // Register two factor authentication providers. This application uses Phone and Emails as a step of receiving a code for verifying the user 69 | // You can write your own provider and plug it in here. 70 | manager.RegisterTwoFactorProvider("Phone Code", new PhoneNumberTokenProvider 71 | { 72 | MessageFormat = "Your security code is {0}" 73 | }); 74 | manager.RegisterTwoFactorProvider("Email Code", new EmailTokenProvider 75 | { 76 | Subject = "Security Code", 77 | BodyFormat = "Your security code is {0}" 78 | }); 79 | manager.EmailService = new EmailService(); 80 | manager.SmsService = new SmsService(); 81 | var dataProtectionProvider = options.DataProtectionProvider; 82 | if (dataProtectionProvider != null) 83 | { 84 | manager.UserTokenProvider = 85 | new DataProtectorTokenProvider(dataProtectionProvider.Create("ASP.NET Identity")); 86 | } 87 | return manager; 88 | } 89 | } 90 | 91 | // Configure the application sign-in manager which is used in this application. 92 | public class ApplicationSignInManager : SignInManager 93 | { 94 | public ApplicationSignInManager(ApplicationUserManager userManager, IAuthenticationManager authenticationManager) 95 | : base(userManager, authenticationManager) 96 | { 97 | } 98 | 99 | public override Task CreateUserIdentityAsync(ApplicationUser user) 100 | { 101 | return user.GenerateUserIdentityAsync((ApplicationUserManager)UserManager); 102 | } 103 | 104 | public static ApplicationSignInManager Create(IdentityFactoryOptions options, IOwinContext context) 105 | { 106 | return new ApplicationSignInManager(context.GetUserManager(), context.Authentication); 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /InventoryManagementSystem/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 InventoryManagementSystem 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 | -------------------------------------------------------------------------------- /InventoryManagementSystem/App_Start/Startup.Auth.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.AspNet.Identity; 3 | using Microsoft.AspNet.Identity.Owin; 4 | using Microsoft.Owin; 5 | using Microsoft.Owin.Security.Cookies; 6 | using Microsoft.Owin.Security.Google; 7 | using Owin; 8 | using InventoryManagementSystem.Models; 9 | 10 | namespace InventoryManagementSystem 11 | { 12 | public partial class Startup 13 | { 14 | // For more information on configuring authentication, please visit https://go.microsoft.com/fwlink/?LinkId=301864 15 | public void ConfigureAuth(IAppBuilder app) 16 | { 17 | // Configure the db context, user manager and signin manager to use a single instance per request 18 | app.CreatePerOwinContext(ApplicationDbContext.Create); 19 | app.CreatePerOwinContext(ApplicationUserManager.Create); 20 | app.CreatePerOwinContext(ApplicationSignInManager.Create); 21 | 22 | // Enable the application to use a cookie to store information for the signed in user 23 | // and to use a cookie to temporarily store information about a user logging in with a third party login provider 24 | // Configure the sign in cookie 25 | app.UseCookieAuthentication(new CookieAuthenticationOptions 26 | { 27 | AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, 28 | LoginPath = new PathString("/Account/Login"), 29 | Provider = new CookieAuthenticationProvider 30 | { 31 | // Enables the application to validate the security stamp when the user logs in. 32 | // This is a security feature which is used when you change a password or add an external login to your account. 33 | OnValidateIdentity = SecurityStampValidator.OnValidateIdentity( 34 | validateInterval: TimeSpan.FromMinutes(30), 35 | regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager)) 36 | } 37 | }); 38 | app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie); 39 | 40 | // Enables the application to temporarily store user information when they are verifying the second factor in the two-factor authentication process. 41 | app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5)); 42 | 43 | // Enables the application to remember the second login verification factor such as phone or email. 44 | // Once you check this option, your second step of verification during the login process will be remembered on the device where you logged in from. 45 | // This is similar to the RememberMe option when you log in. 46 | app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie); 47 | 48 | // Uncomment the following lines to enable logging in with third party login providers 49 | //app.UseMicrosoftAccountAuthentication( 50 | // clientId: "", 51 | // clientSecret: ""); 52 | 53 | //app.UseTwitterAuthentication( 54 | // consumerKey: "", 55 | // consumerSecret: ""); 56 | 57 | //app.UseFacebookAuthentication( 58 | // appId: "", 59 | // appSecret: ""); 60 | 61 | //app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions() 62 | //{ 63 | // ClientId = "", 64 | // ClientSecret = "" 65 | //}); 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/ApplicationInsights.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | search|spider|crawl|Bot|Monitor|AlwaysOn 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 54 | System.Web.Handlers.TransferRequestHandler 55 | Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.RequestDataHttpHandler 56 | System.Web.StaticFileHandler 57 | System.Web.Handlers.AssemblyResourceLoader 58 | System.Web.Optimization.BundleHandler 59 | System.Web.Script.Services.ScriptHandlerFactory 60 | System.Web.Handlers.TraceHandler 61 | System.Web.Services.Discovery.DiscoveryRequestHandler 62 | System.Web.HttpDebugHandler 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 5 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/PagedList.css: -------------------------------------------------------------------------------- 1 | .pagination { 2 | display: inline-block; 3 | padding-left: 0; 4 | margin: 20px 0; 5 | border-radius: 4px; 6 | } 7 | 8 | .pagination > li { 9 | display: inline; 10 | } 11 | 12 | .pagination > li > a, 13 | .pagination > li > span { 14 | position: relative; 15 | float: left; 16 | padding: 6px 12px; 17 | margin-left: -1px; 18 | line-height: 1.428571429; 19 | text-decoration: none; 20 | background-color: #ffffff; 21 | border: 1px solid #dddddd; 22 | } 23 | 24 | .pagination > li:first-child > a, 25 | .pagination > li:first-child > span { 26 | margin-left: 0; 27 | border-bottom-left-radius: 4px; 28 | border-top-left-radius: 4px; 29 | } 30 | 31 | .pagination > li:last-child > a, 32 | .pagination > li:last-child > span { 33 | border-top-right-radius: 4px; 34 | border-bottom-right-radius: 4px; 35 | } 36 | 37 | .pagination > li > a:hover, 38 | .pagination > li > span:hover, 39 | .pagination > li > a:focus, 40 | .pagination > li > span:focus { 41 | background-color: #eeeeee; 42 | } 43 | 44 | .pagination > .active > a, 45 | .pagination > .active > span, 46 | .pagination > .active > a:hover, 47 | .pagination > .active > span:hover, 48 | .pagination > .active > a:focus, 49 | .pagination > .active > span:focus { 50 | z-index: 2; 51 | color: #ffffff; 52 | cursor: default; 53 | background-color: #428bca; 54 | border-color: #428bca; 55 | } 56 | 57 | .pagination > .disabled > span, 58 | .pagination > .disabled > a, 59 | .pagination > .disabled > a:hover, 60 | .pagination > .disabled > a:focus { 61 | color: #999999; 62 | cursor: not-allowed; 63 | background-color: #ffffff; 64 | border-color: #dddddd; 65 | } 66 | 67 | .pagination-lg > li > a, 68 | .pagination-lg > li > span { 69 | padding: 10px 16px; 70 | font-size: 18px; 71 | } 72 | 73 | .pagination-lg > li:first-child > a, 74 | .pagination-lg > li:first-child > span { 75 | border-bottom-left-radius: 6px; 76 | border-top-left-radius: 6px; 77 | } 78 | 79 | .pagination-lg > li:last-child > a, 80 | .pagination-lg > li:last-child > span { 81 | border-top-right-radius: 6px; 82 | border-bottom-right-radius: 6px; 83 | } 84 | 85 | .pagination-sm > li > a, 86 | .pagination-sm > li > span { 87 | padding: 5px 10px; 88 | font-size: 12px; 89 | } 90 | 91 | .pagination-sm > li:first-child > a, 92 | .pagination-sm > li:first-child > span { 93 | border-bottom-left-radius: 3px; 94 | border-top-left-radius: 3px; 95 | } 96 | 97 | .pagination-sm > li:last-child > a, 98 | .pagination-sm > li:last-child > span { 99 | border-top-right-radius: 3px; 100 | border-bottom-right-radius: 3px; 101 | } 102 | 103 | .pager { 104 | padding-left: 0; 105 | margin: 20px 0; 106 | text-align: center; 107 | list-style: none; 108 | } 109 | 110 | .pager:before, 111 | .pager:after { 112 | display: table; 113 | content: " "; 114 | } 115 | 116 | .pager:after { 117 | clear: both; 118 | } 119 | 120 | .pager:before, 121 | .pager:after { 122 | display: table; 123 | content: " "; 124 | } 125 | 126 | .pager:after { 127 | clear: both; 128 | } 129 | 130 | .pager li { 131 | display: inline; 132 | } 133 | 134 | .pager li > a, 135 | .pager li > span { 136 | display: inline-block; 137 | padding: 5px 14px; 138 | background-color: #ffffff; 139 | border: 1px solid #dddddd; 140 | border-radius: 15px; 141 | } 142 | 143 | .pager li > a:hover, 144 | .pager li > a:focus { 145 | text-decoration: none; 146 | background-color: #eeeeee; 147 | } 148 | 149 | .pager .next > a, 150 | .pager .next > span { 151 | float: right; 152 | } 153 | 154 | .pager .previous > a, 155 | .pager .previous > span { 156 | float: left; 157 | } 158 | 159 | .pager .disabled > a, 160 | .pager .disabled > a:hover, 161 | .pager .disabled > a:focus, 162 | .pager .disabled > span { 163 | color: #999999; 164 | cursor: not-allowed; 165 | background-color: #ffffff; 166 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/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 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/0.08.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/0.08.jpeg -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/0.09.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/0.09.jpeg -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/01.jpg -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/02.jpg -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/Back.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/Back.jpg -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/BikeOnCar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/BikeOnCar.jpg -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/Bikesinline.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/Bikesinline.jpg -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/FIXED.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/FIXED.jpg -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/Faastbike.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/Faastbike.jpg -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/FixieChix.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/FixieChix.jpg -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/Orange.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/Orange.jpg -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/Trail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/Trail.jpg -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/Youth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/Youth.jpg -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/fixie.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/fixie.JPG -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/racer.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/racer.JPG -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/roadbike.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/roadbike.JPG -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/they.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/they.mov -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/train-15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/train-15.jpg -------------------------------------------------------------------------------- /InventoryManagementSystem/Content/img/trains.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/Content/img/trains.jpeg -------------------------------------------------------------------------------- /InventoryManagementSystem/Controllers/AssignmentController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.Entity; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Web; 8 | using System.Web.Mvc; 9 | using InventoryManagementSystem.DAL; 10 | using InventoryManagementSystem.Models; 11 | 12 | namespace InventoryManagementSystem.Controllers 13 | { 14 | public class AssignmentController : Controller 15 | { 16 | private StoreContext db = new StoreContext(); 17 | 18 | // GET: Assignment 19 | public ActionResult Index() 20 | { 21 | var assignments = db.Assignments.Include(a => a.Department).Include(a => a.Employee); 22 | return View(assignments.ToList()); 23 | } 24 | 25 | // GET: Assignment/Details/5 26 | public ActionResult Details(int? id) 27 | { 28 | if (id == null) 29 | { 30 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 31 | } 32 | Assignment assignment = db.Assignments.Find(id); 33 | if (assignment == null) 34 | { 35 | return HttpNotFound(); 36 | } 37 | return View(assignment); 38 | } 39 | 40 | // GET: Assignment/Create 41 | public ActionResult Create() 42 | { 43 | ViewBag.DepartmentID = new SelectList(db.Departments, "DepartmentID", "Name"); 44 | ViewBag.EmployeeID = new SelectList(db.Employees, "ID", "LastName"); 45 | return View(); 46 | } 47 | 48 | // POST: Assignment/Create 49 | // To protect from overposting attacks, please enable the specific properties you want to bind to, for 50 | // more details see https://go.microsoft.com/fwlink/?LinkId=317598. 51 | [HttpPost] 52 | [ValidateAntiForgeryToken] 53 | public ActionResult Create([Bind(Include = "EmployeeID,DepartmentID")] Assignment assignment) 54 | { 55 | if (ModelState.IsValid) 56 | { 57 | db.Assignments.Add(assignment); 58 | db.SaveChanges(); 59 | return RedirectToAction("Index"); 60 | } 61 | 62 | ViewBag.DepartmentID = new SelectList(db.Departments, "DepartmentID", "Name", assignment.DepartmentID); 63 | ViewBag.EmployeeID = new SelectList(db.Employees, "ID", "LastName", assignment.EmployeeID); 64 | return View(assignment); 65 | } 66 | 67 | // GET: Assignment/Edit/5 68 | public ActionResult Edit(int? id) 69 | { 70 | if (id == null) 71 | { 72 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 73 | } 74 | Assignment assignment = db.Assignments.Find(id); 75 | if (assignment == null) 76 | { 77 | return HttpNotFound(); 78 | } 79 | ViewBag.DepartmentID = new SelectList(db.Departments, "DepartmentID", "Name", assignment.DepartmentID); 80 | ViewBag.EmployeeID = new SelectList(db.Employees, "ID", "LastName", assignment.EmployeeID); 81 | return View(assignment); 82 | } 83 | 84 | // POST: Assignment/Edit/5 85 | // To protect from overposting attacks, please enable the specific properties you want to bind to, for 86 | // more details see https://go.microsoft.com/fwlink/?LinkId=317598. 87 | [HttpPost] 88 | [ValidateAntiForgeryToken] 89 | public ActionResult Edit([Bind(Include = "EmployeeID,DepartmentID")] Assignment assignment) 90 | { 91 | if (ModelState.IsValid) 92 | { 93 | db.Entry(assignment).State = EntityState.Modified; 94 | db.SaveChanges(); 95 | return RedirectToAction("Index"); 96 | } 97 | ViewBag.DepartmentID = new SelectList(db.Departments, "DepartmentID", "Name", assignment.DepartmentID); 98 | ViewBag.EmployeeID = new SelectList(db.Employees, "ID", "LastName", assignment.EmployeeID); 99 | return View(assignment); 100 | } 101 | 102 | // GET: Assignment/Delete/5 103 | public ActionResult Delete(int? id) 104 | { 105 | if (id == null) 106 | { 107 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 108 | } 109 | Assignment assignment = db.Assignments.Find(id); 110 | if (assignment == null) 111 | { 112 | return HttpNotFound(); 113 | } 114 | return View(assignment); 115 | } 116 | 117 | // POST: Assignment/Delete/5 118 | [HttpPost, ActionName("Delete")] 119 | [ValidateAntiForgeryToken] 120 | public ActionResult DeleteConfirmed(int id) 121 | { 122 | Assignment assignment = db.Assignments.Find(id); 123 | db.Assignments.Remove(assignment); 124 | db.SaveChanges(); 125 | return RedirectToAction("Index"); 126 | } 127 | 128 | protected override void Dispose(bool disposing) 129 | { 130 | if (disposing) 131 | { 132 | db.Dispose(); 133 | } 134 | base.Dispose(disposing); 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Controllers/CustomerController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.Entity; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Web; 8 | using System.Web.Mvc; 9 | using InventoryManagementSystem.DAL; 10 | using InventoryManagementSystem.Models; 11 | using PagedList; 12 | using System.Data.Entity.Infrastructure; 13 | 14 | namespace InventoryManagementSystem.Controllers 15 | { 16 | public class CustomerController : Controller 17 | { 18 | private StoreContext db = new StoreContext(); 19 | 20 | // GET: Customer 21 | public ActionResult Index(string sortOrder, string currentFilter, string searchString, int? page) 22 | { 23 | ViewBag.CurrentSort = sortOrder; 24 | ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "name_desc" : ""; 25 | ViewBag.DataSortParm = sortOrder == "Date" ? "date_desc" : "Date"; 26 | 27 | if (searchString != null) 28 | { 29 | page = 1; 30 | } 31 | else 32 | { 33 | searchString = currentFilter; 34 | } 35 | 36 | ViewBag.CurrentFilter = searchString; 37 | 38 | var customers = from s in db.Customers 39 | select s; 40 | if (!String.IsNullOrEmpty(searchString)) 41 | { 42 | customers = customers.Where(s => s.LastName.Contains(searchString) 43 | || s.FirstMidName.Contains(searchString)); 44 | } 45 | switch (sortOrder) 46 | { 47 | case "name_desc": 48 | customers = customers.OrderByDescending(s => s.LastName); 49 | break; 50 | case "Date": 51 | customers = customers.OrderBy(s => s.Purchase); 52 | break; 53 | case "date_desc": 54 | customers = customers.OrderByDescending(s => s.PurchaseDate); 55 | break; 56 | default: 57 | customers = customers.OrderBy(s => s.LastName); 58 | break; 59 | } 60 | int pageSize = 3; 61 | int pageNumber = (page ?? 1); 62 | return View(customers.ToPagedList(pageNumber,pageSize)); 63 | } 64 | 65 | // GET: Customer/Details/5 66 | public ActionResult Details(int? id) 67 | { 68 | if (id == null) 69 | { 70 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 71 | } 72 | Customer customer = db.Customers.Find(id); 73 | if (customer == null) 74 | { 75 | return HttpNotFound(); 76 | } 77 | return View(customer); 78 | } 79 | 80 | // GET: Customer/Create 81 | public ActionResult Create() 82 | { 83 | return View(); 84 | } 85 | 86 | // POST: Customer/Create 87 | // To protect from overposting attacks, please enable the specific properties you want to bind to, for 88 | // more details see https://go.microsoft.com/fwlink/?LinkId=317598. 89 | [HttpPost] 90 | [ValidateAntiForgeryToken] 91 | public ActionResult Create([Bind(Include = "LastName, FirstMidName, PurchaseDate")]Customer customer) 92 | { 93 | try 94 | { 95 | if (ModelState.IsValid) 96 | { 97 | db.Customers.Add(customer); 98 | db.SaveChanges(); 99 | return RedirectToAction("Index"); 100 | } 101 | } 102 | catch (RetryLimitExceededException /* dex */) 103 | { 104 | //Log the error (uncomment dex variable name and add a line here to write a log. 105 | ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator."); 106 | } 107 | return View(customer); 108 | } 109 | 110 | // GET: Customer/Edit/5 111 | public ActionResult Edit(int? id) 112 | { 113 | if (id == null) 114 | { 115 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 116 | } 117 | Customer customer = db.Customers.Find(id); 118 | if (customer == null) 119 | { 120 | return HttpNotFound(); 121 | } 122 | return View(customer); 123 | } 124 | 125 | // POST: Customer/Edit/5 126 | // To protect from overposting attacks, please enable the specific properties you want to bind to, for 127 | // more details see https://go.microsoft.com/fwlink/?LinkId=317598. 128 | [HttpPost, ActionName("Edit")] 129 | [ValidateAntiForgeryToken] 130 | public ActionResult EditPost(int? id) //([Bind(Include = "ID,LastName,FirstMidName,PurchaseDate")] Customer customer) 131 | { 132 | if (id == null) 133 | { 134 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 135 | } 136 | var customerToUpdate = db.Customers.Find(id); 137 | if (TryUpdateModel(customerToUpdate, "", 138 | new string[] { "LastName", "FirstMidName", "PurchaseDate" })) 139 | { 140 | try 141 | { 142 | db.SaveChanges(); 143 | 144 | return RedirectToAction("Index"); 145 | } 146 | catch (RetryLimitExceededException /* dex */) 147 | { 148 | //Log the error (uncomment dex variable name and add a line here to write a log. 149 | ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists, see your system administrator."); 150 | } 151 | } 152 | return View(customerToUpdate); 153 | } 154 | 155 | // GET: Customer/Delete/5 156 | public ActionResult Delete(int? id, bool? saveChangesError = false) 157 | { 158 | if (id == null) 159 | { 160 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 161 | } 162 | if (saveChangesError.GetValueOrDefault()) 163 | { 164 | ViewBag.ErrorMessage = "Delete failed. Try again, and if the problem persists see your system administrator."; 165 | } 166 | Customer customer = db.Customers.Find(id); 167 | if (customer == null) 168 | { 169 | return HttpNotFound(); 170 | } 171 | return View(customer); 172 | } 173 | 174 | // POST: Customer/Delete/5 175 | [HttpPost] 176 | [ValidateAntiForgeryToken] 177 | public ActionResult Delete(int id) 178 | { 179 | try 180 | { 181 | Customer customer = db.Customers.Find(id); 182 | db.Customers.Remove(customer); 183 | db.SaveChanges(); 184 | } 185 | catch (RetryLimitExceededException /* dex */) 186 | { 187 | //Log the error (uncomment dex variable name and add a line here to write a log. 188 | return RedirectToAction("Delete", new { id = id, saveChangesError = true }); 189 | } 190 | return RedirectToAction("Index"); 191 | } 192 | 193 | protected override void Dispose(bool disposing) 194 | { 195 | if (disposing) 196 | { 197 | db.Dispose(); 198 | } 199 | base.Dispose(disposing); 200 | } 201 | } 202 | } 203 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Controllers/DepartmentController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.Entity; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Web; 8 | using System.Web.Mvc; 9 | using InventoryManagementSystem.DAL; 10 | using InventoryManagementSystem.Models; 11 | 12 | namespace InventoryManagementSystem.Controllers 13 | { 14 | public class DepartmentController : Controller 15 | { 16 | private StoreContext db = new StoreContext(); 17 | 18 | // GET: Department 19 | public ActionResult Index() 20 | { 21 | var departments = db.Departments.Include(d => d.Manager); 22 | return View(departments.ToList()); 23 | } 24 | 25 | // GET: Department/Details/5 26 | public ActionResult Details(int? id) 27 | { 28 | if (id == null) 29 | { 30 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 31 | } 32 | Department department = db.Departments.Find(id); 33 | if (department == null) 34 | { 35 | return HttpNotFound(); 36 | } 37 | return View(department); 38 | } 39 | 40 | // GET: Department/Create 41 | public ActionResult Create() 42 | { 43 | ViewBag.EmployeeID = new SelectList(db.Employees, "ID", "LastName"); 44 | return View(); 45 | } 46 | 47 | // POST: Department/Create 48 | // To protect from overposting attacks, please enable the specific properties you want to bind to, for 49 | // more details see https://go.microsoft.com/fwlink/?LinkId=317598. 50 | [HttpPost] 51 | [ValidateAntiForgeryToken] 52 | public ActionResult Create([Bind(Include = "DepartmentID,Name,Budget,StartDate,EmployeeID")] Department department) 53 | { 54 | if (ModelState.IsValid) 55 | { 56 | db.Departments.Add(department); 57 | db.SaveChanges(); 58 | return RedirectToAction("Index"); 59 | } 60 | 61 | ViewBag.EmployeeID = new SelectList(db.Employees, "ID", "LastName", department.EmployeeID); 62 | return View(department); 63 | } 64 | 65 | // GET: Department/Edit/5 66 | public ActionResult Edit(int? id) 67 | { 68 | if (id == null) 69 | { 70 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 71 | } 72 | Department department = db.Departments.Find(id); 73 | if (department == null) 74 | { 75 | return HttpNotFound(); 76 | } 77 | ViewBag.EmployeeID = new SelectList(db.Employees, "ID", "LastName", department.EmployeeID); 78 | return View(department); 79 | } 80 | 81 | // POST: Department/Edit/5 82 | // To protect from overposting attacks, please enable the specific properties you want to bind to, for 83 | // more details see https://go.microsoft.com/fwlink/?LinkId=317598. 84 | [HttpPost] 85 | [ValidateAntiForgeryToken] 86 | public ActionResult Edit([Bind(Include = "DepartmentID,Name,Budget,StartDate,EmployeeID")] Department department) 87 | { 88 | if (ModelState.IsValid) 89 | { 90 | db.Entry(department).State = EntityState.Modified; 91 | db.SaveChanges(); 92 | return RedirectToAction("Index"); 93 | } 94 | ViewBag.EmployeeID = new SelectList(db.Employees, "ID", "LastName", department.EmployeeID); 95 | return View(department); 96 | } 97 | 98 | // GET: Department/Delete/5 99 | public ActionResult Delete(int? id) 100 | { 101 | if (id == null) 102 | { 103 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 104 | } 105 | Department department = db.Departments.Find(id); 106 | if (department == null) 107 | { 108 | return HttpNotFound(); 109 | } 110 | return View(department); 111 | } 112 | 113 | // POST: Department/Delete/5 114 | [HttpPost, ActionName("Delete")] 115 | [ValidateAntiForgeryToken] 116 | public ActionResult DeleteConfirmed(int id) 117 | { 118 | Department department = db.Departments.Find(id); 119 | db.Departments.Remove(department); 120 | db.SaveChanges(); 121 | return RedirectToAction("Index"); 122 | } 123 | 124 | protected override void Dispose(bool disposing) 125 | { 126 | if (disposing) 127 | { 128 | db.Dispose(); 129 | } 130 | base.Dispose(disposing); 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Controllers/EmployeeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.Entity; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Web; 8 | using System.Web.Mvc; 9 | using InventoryManagementSystem.DAL; 10 | using InventoryManagementSystem.Models; 11 | 12 | namespace InventoryManagementSystem.Controllers 13 | { 14 | public class EmployeeController : Controller 15 | { 16 | private StoreContext db = new StoreContext(); 17 | 18 | // GET: Employee 19 | public ActionResult Index() 20 | { 21 | var employees = db.Employees.Include(e => e.Assignment); 22 | return View(employees.ToList()); 23 | } 24 | 25 | // GET: Employee/Details/5 26 | public ActionResult Details(int? id) 27 | { 28 | if (id == null) 29 | { 30 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 31 | } 32 | Employee employee = db.Employees.Find(id); 33 | if (employee == null) 34 | { 35 | return HttpNotFound(); 36 | } 37 | return View(employee); 38 | } 39 | 40 | // GET: Employee/Create 41 | public ActionResult Create() 42 | { 43 | ViewBag.ID = new SelectList(db.Assignments, "EmployeeID", "EmployeeID"); 44 | return View(); 45 | } 46 | 47 | // POST: Employee/Create 48 | // To protect from overposting attacks, please enable the specific properties you want to bind to, for 49 | // more details see https://go.microsoft.com/fwlink/?LinkId=317598. 50 | [HttpPost] 51 | [ValidateAntiForgeryToken] 52 | public ActionResult Create([Bind(Include = "ID,LastName,FirstMidName,HireDate")] Employee employee) 53 | { 54 | if (ModelState.IsValid) 55 | { 56 | db.Employees.Add(employee); 57 | db.SaveChanges(); 58 | return RedirectToAction("Index"); 59 | } 60 | 61 | ViewBag.ID = new SelectList(db.Assignments, "EmployeeID", "EmployeeID", employee.ID); 62 | return View(employee); 63 | } 64 | 65 | // GET: Employee/Edit/5 66 | public ActionResult Edit(int? id) 67 | { 68 | if (id == null) 69 | { 70 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 71 | } 72 | Employee employee = db.Employees.Find(id); 73 | if (employee == null) 74 | { 75 | return HttpNotFound(); 76 | } 77 | ViewBag.ID = new SelectList(db.Assignments, "EmployeeID", "EmployeeID", employee.ID); 78 | return View(employee); 79 | } 80 | 81 | // POST: Employee/Edit/5 82 | // To protect from overposting attacks, please enable the specific properties you want to bind to, for 83 | // more details see https://go.microsoft.com/fwlink/?LinkId=317598. 84 | [HttpPost] 85 | [ValidateAntiForgeryToken] 86 | public ActionResult Edit([Bind(Include = "ID,LastName,FirstMidName,HireDate")] Employee employee) 87 | { 88 | if (ModelState.IsValid) 89 | { 90 | db.Entry(employee).State = EntityState.Modified; 91 | db.SaveChanges(); 92 | return RedirectToAction("Index"); 93 | } 94 | ViewBag.ID = new SelectList(db.Assignments, "EmployeeID", "EmployeeID", employee.ID); 95 | return View(employee); 96 | } 97 | 98 | // GET: Employee/Delete/5 99 | public ActionResult Delete(int? id) 100 | { 101 | if (id == null) 102 | { 103 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 104 | } 105 | Employee employee = db.Employees.Find(id); 106 | if (employee == null) 107 | { 108 | return HttpNotFound(); 109 | } 110 | return View(employee); 111 | } 112 | 113 | // POST: Employee/Delete/5 114 | [HttpPost, ActionName("Delete")] 115 | [ValidateAntiForgeryToken] 116 | public ActionResult DeleteConfirmed(int id) 117 | { 118 | Employee employee = db.Employees.Find(id); 119 | db.Employees.Remove(employee); 120 | db.SaveChanges(); 121 | return RedirectToAction("Index"); 122 | } 123 | 124 | protected override void Dispose(bool disposing) 125 | { 126 | if (disposing) 127 | { 128 | db.Dispose(); 129 | } 130 | base.Dispose(disposing); 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /InventoryManagementSystem/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 InventoryManagementSystem.Controllers 8 | { 9 | public class HomeController : Controller 10 | { 11 | public ActionResult Index() 12 | { 13 | return View(); 14 | } 15 | 16 | public ActionResult About() 17 | { 18 | ViewBag.Message = "Your application description page."; 19 | 20 | return View(); 21 | } 22 | 23 | public ActionResult Contact() 24 | { 25 | ViewBag.Message = "Your contact page."; 26 | 27 | return View(); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/Controllers/ProductController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.Entity; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Web; 8 | using System.Web.Mvc; 9 | using InventoryManagementSystem.DAL; 10 | using InventoryManagementSystem.Models; 11 | using System.Data.Entity.Infrastructure; 12 | 13 | namespace InventoryManagementSystem.Controllers 14 | { 15 | public class ProductController : Controller 16 | { 17 | private StoreContext db = new StoreContext(); 18 | 19 | // GET: Product 20 | public ActionResult Index() 21 | { 22 | var products = db.Products.Include(c => c.Departments); 23 | return View(db.Products.ToList()); 24 | } 25 | 26 | // GET: Product/Details/5 27 | public ActionResult Details(int? id) 28 | { 29 | if (id == null) 30 | { 31 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 32 | } 33 | Product product = db.Products.Find(id); 34 | if (product == null) 35 | { 36 | return HttpNotFound(); 37 | } 38 | return View(product); 39 | } 40 | 41 | public ActionResult Create() 42 | { 43 | PopulateDepartmentsDropDownList(); 44 | return View(); 45 | } 46 | 47 | [HttpPost] 48 | [ValidateAntiForgeryToken] 49 | public ActionResult Create([Bind(Include = "ProductID,Title,Price,SectionID,InventoryNumber")]Product product) 50 | { 51 | try 52 | { 53 | if (ModelState.IsValid) 54 | { 55 | db.Products.Add(product); 56 | db.SaveChanges(); 57 | return RedirectToAction("Index"); 58 | } 59 | } 60 | catch (RetryLimitExceededException /* dex */) 61 | { 62 | //Log the error (uncomment dex variable name and add a line here to write a log.) 63 | ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists, see your system administrator."); 64 | } 65 | PopulateDepartmentsDropDownList(product.Departments); 66 | return View(product); 67 | } 68 | 69 | public ActionResult Edit(int? id) 70 | { 71 | if (id == null) 72 | { 73 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 74 | } 75 | Product product = db.Products.Find(id); 76 | if (product == null) 77 | { 78 | return HttpNotFound(); 79 | } 80 | PopulateDepartmentsDropDownList(product.Departments); 81 | return View(product); 82 | } 83 | 84 | [HttpPost, ActionName("Edit")] 85 | [ValidateAntiForgeryToken] 86 | public ActionResult EditPost(int? id) 87 | { 88 | if (id == null) 89 | { 90 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 91 | } 92 | var productToUpdate = db.Products.Find(id); 93 | if (TryUpdateModel(productToUpdate, "", 94 | new string[] { "Title", "Price", "SectionID", "InventoryNumber" })) 95 | { 96 | try 97 | { 98 | db.SaveChanges(); 99 | 100 | return RedirectToAction("Index"); 101 | } 102 | catch (RetryLimitExceededException /* dex */) 103 | { 104 | //Log the error (uncomment dex variable name and add a line here to write a log. 105 | ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists, see your system administrator."); 106 | } 107 | } 108 | PopulateDepartmentsDropDownList(productToUpdate.Departments); 109 | return View(productToUpdate); 110 | } 111 | 112 | private void PopulateDepartmentsDropDownList(object selectedDepartment = null) 113 | { 114 | var departmentsQuery = from d in db.Departments 115 | orderby d.Name 116 | select d; 117 | ViewBag.DepartmentID = new SelectList(departmentsQuery, "DepartmentID", "Name", selectedDepartment); 118 | } 119 | 120 | // GET: Product/Delete/5 121 | public ActionResult Delete(int? id) 122 | { 123 | if (id == null) 124 | { 125 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 126 | } 127 | Product product = db.Products.Find(id); 128 | if (product == null) 129 | { 130 | return HttpNotFound(); 131 | } 132 | return View(product); 133 | } 134 | 135 | // POST: Product/Delete/5 136 | [HttpPost, ActionName("Delete")] 137 | [ValidateAntiForgeryToken] 138 | public ActionResult DeleteConfirmed(int id) 139 | { 140 | Product product = db.Products.Find(id); 141 | db.Products.Remove(product); 142 | db.SaveChanges(); 143 | return RedirectToAction("Index"); 144 | } 145 | 146 | protected override void Dispose(bool disposing) 147 | { 148 | if (disposing) 149 | { 150 | db.Dispose(); 151 | } 152 | base.Dispose(disposing); 153 | } 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Controllers/PurchaseController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Data.Entity; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Web; 8 | using System.Web.Mvc; 9 | using InventoryManagementSystem.DAL; 10 | using InventoryManagementSystem.Models; 11 | 12 | namespace InventoryManagementSystem.Controllers 13 | { 14 | public class PurchaseController : Controller 15 | { 16 | private StoreContext db = new StoreContext(); 17 | 18 | // GET: Purchase 19 | public ActionResult Index() 20 | { 21 | var purchases = db.Purchases.Include(p => p.Customer).Include(p => p.Product); 22 | return View(purchases.ToList()); 23 | } 24 | 25 | // GET: Purchase/Details/5 26 | public ActionResult Details(int? id) 27 | { 28 | if (id == null) 29 | { 30 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 31 | } 32 | Purchase purchase = db.Purchases.Find(id); 33 | if (purchase == null) 34 | { 35 | return HttpNotFound(); 36 | } 37 | return View(purchase); 38 | } 39 | 40 | // GET: Purchase/Create 41 | public ActionResult Create() 42 | { 43 | ViewBag.CustomerID = new SelectList(db.Customers, "ID", "LastName"); 44 | ViewBag.ProductID = new SelectList(db.Products, "ProductID", "Title"); 45 | return View(); 46 | } 47 | 48 | // POST: Purchase/Create 49 | // To protect from overposting attacks, please enable the specific properties you want to bind to, for 50 | // more details see https://go.microsoft.com/fwlink/?LinkId=317598. 51 | [HttpPost] 52 | [ValidateAntiForgeryToken] 53 | public ActionResult Create([Bind(Include = "PurchaseID,ProductID,CustomerID")] Purchase purchase) 54 | { 55 | if (ModelState.IsValid) 56 | { 57 | db.Purchases.Add(purchase); 58 | db.SaveChanges(); 59 | return RedirectToAction("Index"); 60 | } 61 | 62 | ViewBag.CustomerID = new SelectList(db.Customers, "ID", "LastName", purchase.CustomerID); 63 | ViewBag.ProductID = new SelectList(db.Products, "ProductID", "Title", purchase.ProductID); 64 | return View(purchase); 65 | } 66 | 67 | // GET: Purchase/Edit/5 68 | public ActionResult Edit(int? id) 69 | { 70 | if (id == null) 71 | { 72 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 73 | } 74 | Purchase purchase = db.Purchases.Find(id); 75 | if (purchase == null) 76 | { 77 | return HttpNotFound(); 78 | } 79 | ViewBag.CustomerID = new SelectList(db.Customers, "ID", "LastName", purchase.CustomerID); 80 | ViewBag.ProductID = new SelectList(db.Products, "ProductID", "Title", purchase.ProductID); 81 | return View(purchase); 82 | } 83 | 84 | // POST: Purchase/Edit/5 85 | // To protect from overposting attacks, please enable the specific properties you want to bind to, for 86 | // more details see https://go.microsoft.com/fwlink/?LinkId=317598. 87 | [HttpPost] 88 | [ValidateAntiForgeryToken] 89 | public ActionResult Edit([Bind(Include = "PurchaseID,ProductID,CustomerID")] Purchase purchase) 90 | { 91 | if (ModelState.IsValid) 92 | { 93 | db.Entry(purchase).State = EntityState.Modified; 94 | db.SaveChanges(); 95 | return RedirectToAction("Index"); 96 | } 97 | ViewBag.CustomerID = new SelectList(db.Customers, "ID", "LastName", purchase.CustomerID); 98 | ViewBag.ProductID = new SelectList(db.Products, "ProductID", "Title", purchase.ProductID); 99 | return View(purchase); 100 | } 101 | 102 | // GET: Purchase/Delete/5 103 | public ActionResult Delete(int? id) 104 | { 105 | if (id == null) 106 | { 107 | return new HttpStatusCodeResult(HttpStatusCode.BadRequest); 108 | } 109 | Purchase purchase = db.Purchases.Find(id); 110 | if (purchase == null) 111 | { 112 | return HttpNotFound(); 113 | } 114 | return View(purchase); 115 | } 116 | 117 | // POST: Purchase/Delete/5 118 | [HttpPost, ActionName("Delete")] 119 | [ValidateAntiForgeryToken] 120 | public ActionResult DeleteConfirmed(int id) 121 | { 122 | Purchase purchase = db.Purchases.Find(id); 123 | db.Purchases.Remove(purchase); 124 | db.SaveChanges(); 125 | return RedirectToAction("Index"); 126 | } 127 | 128 | protected override void Dispose(bool disposing) 129 | { 130 | if (disposing) 131 | { 132 | db.Dispose(); 133 | } 134 | base.Dispose(disposing); 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /InventoryManagementSystem/DAL/StoreConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data.Entity; 4 | using System.Data.Entity.Infrastructure.Interception; 5 | using System.Data.Entity.SqlServer; 6 | using System.Linq; 7 | using System.Web; 8 | 9 | namespace InventoryManagementSystem.DAL 10 | { 11 | public class StoreConfiguration : DbConfiguration 12 | { 13 | public StoreConfiguration() 14 | { 15 | SetExecutionStrategy("System.Data.SqlClient", () => new SqlAzureExecutionStrategy()); 16 | DbInterception.Add(new StoreInterceptorTransientErrors()); 17 | DbInterception.Add(new StoreInterceptorLogging()); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/DAL/StoreContext.cs: -------------------------------------------------------------------------------- 1 | using InventoryManagementSystem.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Data.Entity; 5 | using System.Data.Entity.ModelConfiguration.Conventions; 6 | using System.Linq; 7 | using System.Web; 8 | 9 | namespace InventoryManagementSystem.DAL 10 | { 11 | public class StoreContext : DbContext 12 | { 13 | public StoreContext() : base("StoreContext") 14 | { 15 | } 16 | public DbSet Products { get; set; } 17 | public DbSet Departments { get; set; } 18 | public DbSet Purchases { get; set; } 19 | public DbSet Employees { get; set; } 20 | public DbSet Customers { get; set; } 21 | public DbSet Assignments { get; set; } 22 | 23 | 24 | 25 | protected override void OnModelCreating(DbModelBuilder modelBuilder) 26 | { 27 | modelBuilder.Conventions.Remove(); 28 | 29 | //modelBuilder.Entity() 30 | // .HasMany(c => c.Employees).WithMany(i => i.Products) 31 | // .Map(t => t.MapLeftKey("ProductID") 32 | // .MapRightKey("EmployeeID") 33 | // .ToTable("ProductEmployee")); 34 | } 35 | } 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /InventoryManagementSystem/DAL/StoreInitializer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Data.Entity; 6 | using InventoryManagementSystem.Models; 7 | 8 | namespace InventoryManagementSystem.DAL 9 | { 10 | public class StoreInitializer : System.Data.Entity. DropCreateDatabaseIfModelChanges 11 | { 12 | protected override void Seed(StoreContext context) 13 | { 14 | var customers = new List 15 | { 16 | new Customer{FirstMidName="Carson",LastName="Alexander",PurchaseDate=DateTime.Parse("2005-09-01")}, 17 | new Customer{FirstMidName="Meredith",LastName="Alonso",PurchaseDate=DateTime.Parse("2002-09-01")}, 18 | new Customer{FirstMidName="Arturo",LastName="Anand",PurchaseDate=DateTime.Parse("2003-09-01")}, 19 | new Customer{FirstMidName="Gytis",LastName="Barzdukas",PurchaseDate=DateTime.Parse("2002-09-01")}, 20 | new Customer{FirstMidName="Yan",LastName="Li",PurchaseDate=DateTime.Parse("2002-09-01")}, 21 | new Customer{FirstMidName="Peggy",LastName="Justice",PurchaseDate=DateTime.Parse("2001-09-01")}, 22 | new Customer{FirstMidName="Laura",LastName="Norman",PurchaseDate=DateTime.Parse("2003-09-01")}, 23 | new Customer{FirstMidName="Nino",LastName="Olivetto",PurchaseDate=DateTime.Parse("2005-09-01")} 24 | }; 25 | 26 | customers.ForEach(s => context.Customers.Add(s)); 27 | context.SaveChanges(); 28 | var products = new List 29 | { 30 | new Product{ProductID=1050,Title="Chemistry",InventoryNumber=3,}, 31 | new Product{ProductID=4022,Title="Microeconomics",InventoryNumber=3,}, 32 | new Product{ProductID=4041,Title="Macroeconomics",InventoryNumber=3,}, 33 | new Product{ProductID=1045,Title="Calculus",InventoryNumber=4,}, 34 | new Product{ProductID=3141,Title="Trigonometry",InventoryNumber=4,}, 35 | new Product{ProductID=2021,Title="Composition",InventoryNumber=3,}, 36 | new Product{ProductID=2042,Title="Literature",InventoryNumber=4,} 37 | }; 38 | products.ForEach(s => context.Products.Add(s)); 39 | context.SaveChanges(); 40 | var purchases = new List 41 | { 42 | new Purchase{CustomerID=1,ProductID=1050}, 43 | new Purchase{CustomerID=1,ProductID=4022}, 44 | new Purchase{CustomerID=1,ProductID=4041}, 45 | new Purchase{CustomerID=1,ProductID=1045}, 46 | new Purchase{CustomerID=1,ProductID=3141}, 47 | new Purchase{CustomerID=1,ProductID=2021} 48 | 49 | }; 50 | purchases.ForEach(s => context.Purchases.Add(s)); 51 | context.SaveChanges(); 52 | } 53 | 54 | } 55 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/DAL/StoreInterceptorErrors.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data.Common; 3 | using System.Data.Entity; 4 | using System.Data.Entity.Infrastructure.Interception; 5 | using System.Data.Entity.SqlServer; 6 | using System.Data.SqlClient; 7 | using System.Diagnostics; 8 | using System.Reflection; 9 | using System.Linq; 10 | using InventoryManagementSystem.Logging; 11 | 12 | namespace InventoryManagementSystem.DAL 13 | { 14 | public class StoreInterceptorTransientErrors : DbCommandInterceptor 15 | { 16 | private int _counter = 0; 17 | private ILogger _logger = new Logger(); 18 | 19 | public override void ReaderExecuting(DbCommand command, DbCommandInterceptionContext interceptionContext) 20 | { 21 | bool throwTransientErrors = false; 22 | if (command.Parameters.Count > 0 && command.Parameters[0].Value.ToString() == "%Throw%") 23 | { 24 | throwTransientErrors = true; 25 | command.Parameters[0].Value = "%an%"; 26 | command.Parameters[1].Value = "%an%"; 27 | } 28 | 29 | if (throwTransientErrors && _counter < 4) 30 | { 31 | _logger.Information("Returning transient error for command: {0}", command.CommandText); 32 | _counter++; 33 | interceptionContext.Exception = CreateDummySqlException(); 34 | } 35 | } 36 | 37 | private SqlException CreateDummySqlException() 38 | { 39 | // The instance of SQL Server you attempted to connect to does not support encryption 40 | var sqlErrorNumber = 20; 41 | 42 | var sqlErrorCtor = typeof(SqlError).GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic).Where(c => c.GetParameters().Count() == 7).Single(); 43 | var sqlError = sqlErrorCtor.Invoke(new object[] { sqlErrorNumber, (byte)0, (byte)0, "", "", "", 1 }); 44 | 45 | var errorCollection = Activator.CreateInstance(typeof(SqlErrorCollection), true); 46 | var addMethod = typeof(SqlErrorCollection).GetMethod("Add", BindingFlags.Instance | BindingFlags.NonPublic); 47 | addMethod.Invoke(errorCollection, new[] { sqlError }); 48 | 49 | var sqlExceptionCtor = typeof(SqlException).GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic).Where(c => c.GetParameters().Count() == 4).Single(); 50 | var sqlException = (SqlException)sqlExceptionCtor.Invoke(new object[] { "Dummy", errorCollection, null, Guid.NewGuid() }); 51 | 52 | return sqlException; 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/DAL/StoreInterceptorLogging.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data.Common; 3 | using System.Data.Entity; 4 | using System.Data.Entity.Infrastructure.Interception; 5 | using System.Data.Entity.SqlServer; 6 | using System.Data.SqlClient; 7 | using System.Diagnostics; 8 | using System.Reflection; 9 | using System.Linq; 10 | using InventoryManagementSystem.Logging; 11 | 12 | namespace InventoryManagementSystem.DAL 13 | { 14 | public class StoreInterceptorLogging : DbCommandInterceptor 15 | { 16 | private ILogger _logger = new Logger(); 17 | private readonly Stopwatch _stopwatch = new Stopwatch(); 18 | 19 | public override void ScalarExecuting(DbCommand command, DbCommandInterceptionContext interceptionContext) 20 | { 21 | base.ScalarExecuting(command, interceptionContext); 22 | _stopwatch.Restart(); 23 | } 24 | 25 | public override void ScalarExecuted(DbCommand command, DbCommandInterceptionContext interceptionContext) 26 | { 27 | _stopwatch.Stop(); 28 | if (interceptionContext.Exception != null) 29 | { 30 | _logger.Error(interceptionContext.Exception, "Error executing command: {0}", command.CommandText); 31 | } 32 | else 33 | { 34 | _logger.TraceApi("SQL Database", "StoreInterceptor.ScalarExecuted", _stopwatch.Elapsed, "Command: {0}: ", command.CommandText); 35 | } 36 | base.ScalarExecuted(command, interceptionContext); 37 | } 38 | 39 | public override void NonQueryExecuting(DbCommand command, DbCommandInterceptionContext interceptionContext) 40 | { 41 | base.NonQueryExecuting(command, interceptionContext); 42 | _stopwatch.Restart(); 43 | } 44 | 45 | public override void NonQueryExecuted(DbCommand command, DbCommandInterceptionContext interceptionContext) 46 | { 47 | _stopwatch.Stop(); 48 | if (interceptionContext.Exception != null) 49 | { 50 | _logger.Error(interceptionContext.Exception, "Error executing command: {0}", command.CommandText); 51 | } 52 | else 53 | { 54 | _logger.TraceApi("SQL Database", "StoreInterceptor.NonQueryExecuted", _stopwatch.Elapsed, "Command: {0}: ", command.CommandText); 55 | } 56 | base.NonQueryExecuted(command, interceptionContext); 57 | } 58 | 59 | public override void ReaderExecuting(DbCommand command, DbCommandInterceptionContext interceptionContext) 60 | { 61 | base.ReaderExecuting(command, interceptionContext); 62 | _stopwatch.Restart(); 63 | } 64 | public override void ReaderExecuted(DbCommand command, DbCommandInterceptionContext interceptionContext) 65 | { 66 | _stopwatch.Stop(); 67 | if (interceptionContext.Exception != null) 68 | { 69 | _logger.Error(interceptionContext.Exception, "Error executing command: {0}", command.CommandText); 70 | } 71 | else 72 | { 73 | _logger.TraceApi("SQL Database", "StoreInterceptor.ReaderExecuted", _stopwatch.Elapsed, "Command: {0}: ", command.CommandText); 74 | } 75 | base.ReaderExecuted(command, interceptionContext); 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/DAL/StoreInterceptorTransientErrors.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data.Common; 3 | using System.Data.Entity; 4 | using System.Data.Entity.Infrastructure.Interception; 5 | using System.Data.Entity.SqlServer; 6 | using System.Data.SqlClient; 7 | using System.Diagnostics; 8 | using System.Reflection; 9 | using System.Linq; 10 | using InventoryManagementSystem.Logging; 11 | 12 | namespace ContosoUniversity.DAL 13 | { 14 | public class SchoolInterceptorTransientErrors : DbCommandInterceptor 15 | { 16 | private int _counter = 0; 17 | private ILogger _logger = new Logger(); 18 | 19 | public override void ReaderExecuting(DbCommand command, DbCommandInterceptionContext interceptionContext) 20 | { 21 | bool throwTransientErrors = false; 22 | if (command.Parameters.Count > 0 && command.Parameters[0].Value.ToString() == "%Throw%") 23 | { 24 | throwTransientErrors = true; 25 | command.Parameters[0].Value = "%an%"; 26 | command.Parameters[1].Value = "%an%"; 27 | } 28 | 29 | if (throwTransientErrors && _counter < 4) 30 | { 31 | _logger.Information("Returning transient error for command: {0}", command.CommandText); 32 | _counter++; 33 | interceptionContext.Exception = CreateDummySqlException(); 34 | } 35 | } 36 | 37 | private SqlException CreateDummySqlException() 38 | { 39 | // The instance of SQL Server you attempted to connect to does not support encryption 40 | var sqlErrorNumber = 20; 41 | 42 | var sqlErrorCtor = typeof(SqlError).GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic).Where(c => c.GetParameters().Count() == 7).Single(); 43 | var sqlError = sqlErrorCtor.Invoke(new object[] { sqlErrorNumber, (byte)0, (byte)0, "", "", "", 1 }); 44 | 45 | var errorCollection = Activator.CreateInstance(typeof(SqlErrorCollection), true); 46 | var addMethod = typeof(SqlErrorCollection).GetMethod("Add", BindingFlags.Instance | BindingFlags.NonPublic); 47 | addMethod.Invoke(errorCollection, new[] { sqlError }); 48 | 49 | var sqlExceptionCtor = typeof(SqlException).GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic).Where(c => c.GetParameters().Count() == 4).Single(); 50 | var sqlException = (SqlException)sqlExceptionCtor.Invoke(new object[] { "Dummy", errorCollection, null, Guid.NewGuid() }); 51 | 52 | return sqlException; 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="InventoryManagementSystem.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Optimization; 7 | using System.Web.Routing; 8 | using InventoryManagementSystem.DAL; 9 | using System.Data.Entity.Infrastructure.Interception; 10 | 11 | namespace InventoryManagementSystem 12 | { 13 | public class MvcApplication : System.Web.HttpApplication 14 | { 15 | protected void Application_Start() 16 | { 17 | AreaRegistration.RegisterAllAreas(); 18 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 19 | RouteConfig.RegisterRoutes(RouteTable.Routes); 20 | BundleConfig.RegisterBundles(BundleTable.Bundles); 21 | DbInterception.Add(new StoreInterceptorTransientErrors()); 22 | DbInterception.Add(new StoreInterceptorLogging()); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Logging/ILogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace InventoryManagementSystem.Logging 4 | { 5 | public interface ILogger 6 | { 7 | void Information(string message); 8 | void Information(string fmt, params object[] vars); 9 | void Information(Exception exception, string fmt, params object[] vars); 10 | 11 | void Warning(string message); 12 | void Warning(string fmt, params object[] vars); 13 | void Warning(Exception exception, string fmt, params object[] vars); 14 | 15 | void Error(string message); 16 | void Error(string fmt, params object[] vars); 17 | void Error(Exception exception, string fmt, params object[] vars); 18 | 19 | void TraceApi(string componentName, string method, TimeSpan timespan); 20 | void TraceApi(string componentName, string method, TimeSpan timespan, string properties); 21 | void TraceApi(string componentName, string method, TimeSpan timespan, string fmt, params object[] vars); 22 | } 23 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/Logging/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Text; 4 | 5 | namespace InventoryManagementSystem.Logging 6 | { 7 | public class Logger : ILogger 8 | { 9 | public void Information(string message) 10 | { 11 | Trace.TraceInformation(message); 12 | } 13 | 14 | public void Information(string fmt, params object[] vars) 15 | { 16 | Trace.TraceInformation(fmt, vars); 17 | } 18 | 19 | public void Information(Exception exception, string fmt, params object[] vars) 20 | { 21 | Trace.TraceInformation(FormatExceptionMessage(exception, fmt, vars)); 22 | } 23 | 24 | public void Warning(string message) 25 | { 26 | Trace.TraceWarning(message); 27 | } 28 | 29 | public void Warning(string fmt, params object[] vars) 30 | { 31 | Trace.TraceWarning(fmt, vars); 32 | } 33 | 34 | public void Warning(Exception exception, string fmt, params object[] vars) 35 | { 36 | Trace.TraceWarning(FormatExceptionMessage(exception, fmt, vars)); 37 | } 38 | 39 | public void Error(string message) 40 | { 41 | Trace.TraceError(message); 42 | } 43 | 44 | public void Error(string fmt, params object[] vars) 45 | { 46 | Trace.TraceError(fmt, vars); 47 | } 48 | 49 | public void Error(Exception exception, string fmt, params object[] vars) 50 | { 51 | Trace.TraceError(FormatExceptionMessage(exception, fmt, vars)); 52 | } 53 | 54 | public void TraceApi(string componentName, string method, TimeSpan timespan) 55 | { 56 | TraceApi(componentName, method, timespan, ""); 57 | } 58 | 59 | public void TraceApi(string componentName, string method, TimeSpan timespan, string fmt, params object[] vars) 60 | { 61 | TraceApi(componentName, method, timespan, string.Format(fmt, vars)); 62 | } 63 | public void TraceApi(string componentName, string method, TimeSpan timespan, string properties) 64 | { 65 | string message = String.Concat("Component:", componentName, ";Method:", method, ";Timespan:", timespan.ToString(), ";Properties:", properties); 66 | Trace.TraceInformation(message); 67 | } 68 | 69 | private static string FormatExceptionMessage(Exception exception, string fmt, object[] vars) 70 | { 71 | // Simple exception formatting: for a more comprehensive version see 72 | // http://code.msdn.microsoft.com/windowsazure/Fix-It-app-for-Building-cdd80df4 73 | var sb = new StringBuilder(); 74 | sb.Append(string.Format(fmt, vars)); 75 | sb.Append(" Exception: "); 76 | sb.Append(exception.ToString()); 77 | return sb.ToString(); 78 | } 79 | } 80 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/Models/AccountViewModels.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace InventoryManagementSystem.Models 5 | { 6 | public class ExternalLoginConfirmationViewModel 7 | { 8 | [Required] 9 | [Display(Name = "Email")] 10 | public string Email { get; set; } 11 | } 12 | 13 | public class ExternalLoginListViewModel 14 | { 15 | public string ReturnUrl { get; set; } 16 | } 17 | 18 | public class SendCodeViewModel 19 | { 20 | public string SelectedProvider { get; set; } 21 | public ICollection Providers { get; set; } 22 | public string ReturnUrl { get; set; } 23 | public bool RememberMe { get; set; } 24 | } 25 | 26 | public class VerifyCodeViewModel 27 | { 28 | [Required] 29 | public string Provider { get; set; } 30 | 31 | [Required] 32 | [Display(Name = "Code")] 33 | public string Code { get; set; } 34 | public string ReturnUrl { get; set; } 35 | 36 | [Display(Name = "Remember this browser?")] 37 | public bool RememberBrowser { get; set; } 38 | 39 | public bool RememberMe { get; set; } 40 | } 41 | 42 | public class ForgotViewModel 43 | { 44 | [Required] 45 | [Display(Name = "Email")] 46 | public string Email { get; set; } 47 | } 48 | 49 | public class LoginViewModel 50 | { 51 | [Required] 52 | [Display(Name = "Email")] 53 | [EmailAddress] 54 | public string Email { get; set; } 55 | 56 | [Required] 57 | [DataType(DataType.Password)] 58 | [Display(Name = "Password")] 59 | public string Password { get; set; } 60 | 61 | [Display(Name = "Remember me?")] 62 | public bool RememberMe { get; set; } 63 | } 64 | 65 | public class RegisterViewModel 66 | { 67 | [Required] 68 | [EmailAddress] 69 | [Display(Name = "Email")] 70 | public string Email { get; set; } 71 | 72 | [Required] 73 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 74 | [DataType(DataType.Password)] 75 | [Display(Name = "Password")] 76 | public string Password { get; set; } 77 | 78 | [DataType(DataType.Password)] 79 | [Display(Name = "Confirm password")] 80 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] 81 | public string ConfirmPassword { get; set; } 82 | } 83 | 84 | public class ResetPasswordViewModel 85 | { 86 | [Required] 87 | [EmailAddress] 88 | [Display(Name = "Email")] 89 | public string Email { get; set; } 90 | 91 | [Required] 92 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 93 | [DataType(DataType.Password)] 94 | [Display(Name = "Password")] 95 | public string Password { get; set; } 96 | 97 | [DataType(DataType.Password)] 98 | [Display(Name = "Confirm password")] 99 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] 100 | public string ConfirmPassword { get; set; } 101 | 102 | public string Code { get; set; } 103 | } 104 | 105 | public class ForgotPasswordViewModel 106 | { 107 | [Required] 108 | [EmailAddress] 109 | [Display(Name = "Email")] 110 | public string Email { get; set; } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Models/Assignment.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | using System.Linq; 6 | using System.Web; 7 | 8 | namespace InventoryManagementSystem.Models 9 | { 10 | public class Assignment 11 | { 12 | [Key] 13 | [ForeignKey("Employee")] 14 | public int EmployeeID { get; set; } 15 | 16 | 17 | 18 | [Display(Name = "Department ID")] 19 | public int DepartmentID { get; set; } 20 | 21 | public virtual Employee Employee { get; set; } 22 | public virtual ICollection Department { get; set; } 23 | 24 | } 25 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/Models/Customer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | using System.Linq; 6 | using System.Web; 7 | 8 | namespace InventoryManagementSystem.Models 9 | { 10 | public class Customer 11 | { 12 | public int ID { get; set; } 13 | [Required] 14 | [StringLength(50)] 15 | [Display(Name = "Last Name")] 16 | public string LastName { get; set; } 17 | [Required] 18 | [StringLength(50, ErrorMessage = "First name cannot be longer than 50 characters.")] 19 | [Column("FirstName")] 20 | [Display(Name = "First Name")] 21 | public string FirstMidName { get; set; } 22 | [DataType(DataType.Date)] 23 | [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)] 24 | [Display(Name = "Purchase Date")] 25 | public DateTime PurchaseDate { get; set; } 26 | 27 | [Display(Name = "Full Name")] 28 | public string FullName 29 | { 30 | get 31 | { 32 | return LastName + ", " + FirstMidName; 33 | } 34 | } 35 | 36 | public virtual ICollection Purchase{ get; set; } 37 | } 38 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/Models/Department.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | 6 | namespace InventoryManagementSystem.Models 7 | { 8 | public class Department 9 | { 10 | public int DepartmentID { get; set; } 11 | 12 | [StringLength(50, MinimumLength = 3)] 13 | public string Name { get; set; } 14 | 15 | [DataType(DataType.Currency)] 16 | [Column(TypeName = "money")] 17 | [Display(Name = "Total Sales")] 18 | public decimal Budget { get; set; } 19 | 20 | [DataType(DataType.Date)] 21 | [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)] 22 | [Display(Name = "Start Date")] 23 | public DateTime StartDate { get; set; } 24 | 25 | public int? EmployeeID { get; set; } 26 | 27 | public virtual Employee Manager { get; set; } 28 | public virtual ICollection Assignment { get; set; } 29 | } 30 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/Models/Employee.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | 6 | namespace InventoryManagementSystem.Models 7 | { 8 | public class Employee 9 | { 10 | 11 | public int ID { get; set; } 12 | 13 | [Required] 14 | [Display(Name = "Last Name")] 15 | [StringLength(50)] 16 | public string LastName { get; set; } 17 | 18 | [Required] 19 | [Column("FirstName")] 20 | [Display(Name = "First Name")] 21 | [StringLength(50)] 22 | public string FirstMidName { get; set; } 23 | 24 | [DataType(DataType.Date)] 25 | [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)] 26 | [Display(Name = "Hire Date")] 27 | public DateTime HireDate { get; set; } 28 | 29 | [Display(Name = "Full Name")] 30 | public string FullName 31 | { 32 | get { return LastName + ", " + FirstMidName; } 33 | } 34 | 35 | public virtual ICollection Department { get; set; } 36 | public virtual Assignment Assignment { get; set; } 37 | //public virtual Department Department { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Models/IdentityModels.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Entity; 2 | using System.Security.Claims; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNet.Identity; 5 | using Microsoft.AspNet.Identity.EntityFramework; 6 | 7 | namespace InventoryManagementSystem.Models 8 | { 9 | // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit https://go.microsoft.com/fwlink/?LinkID=317594 to learn more. 10 | public class ApplicationUser : IdentityUser 11 | { 12 | public async Task GenerateUserIdentityAsync(UserManager manager) 13 | { 14 | // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType 15 | var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie); 16 | // Add custom user claims here 17 | return userIdentity; 18 | } 19 | } 20 | 21 | public class ApplicationDbContext : IdentityDbContext 22 | { 23 | public ApplicationDbContext() 24 | : base("DefaultConnection", throwIfV1Schema: false) 25 | { 26 | } 27 | 28 | public static ApplicationDbContext Create() 29 | { 30 | return new ApplicationDbContext(); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/Models/ManageViewModels.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.ComponentModel.DataAnnotations; 3 | using Microsoft.AspNet.Identity; 4 | using Microsoft.Owin.Security; 5 | 6 | namespace InventoryManagementSystem.Models 7 | { 8 | public class IndexViewModel 9 | { 10 | public bool HasPassword { get; set; } 11 | public IList Logins { get; set; } 12 | public string PhoneNumber { get; set; } 13 | public bool TwoFactor { get; set; } 14 | public bool BrowserRemembered { get; set; } 15 | } 16 | 17 | public class ManageLoginsViewModel 18 | { 19 | public IList CurrentLogins { get; set; } 20 | public IList OtherLogins { get; set; } 21 | } 22 | 23 | public class FactorViewModel 24 | { 25 | public string Purpose { get; set; } 26 | } 27 | 28 | public class SetPasswordViewModel 29 | { 30 | [Required] 31 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 32 | [DataType(DataType.Password)] 33 | [Display(Name = "New password")] 34 | public string NewPassword { get; set; } 35 | 36 | [DataType(DataType.Password)] 37 | [Display(Name = "Confirm new password")] 38 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] 39 | public string ConfirmPassword { get; set; } 40 | } 41 | 42 | public class ChangePasswordViewModel 43 | { 44 | [Required] 45 | [DataType(DataType.Password)] 46 | [Display(Name = "Current password")] 47 | public string OldPassword { get; set; } 48 | 49 | [Required] 50 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 51 | [DataType(DataType.Password)] 52 | [Display(Name = "New password")] 53 | public string NewPassword { get; set; } 54 | 55 | [DataType(DataType.Password)] 56 | [Display(Name = "Confirm new password")] 57 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] 58 | public string ConfirmPassword { get; set; } 59 | } 60 | 61 | public class AddPhoneNumberViewModel 62 | { 63 | [Required] 64 | [Phone] 65 | [Display(Name = "Phone Number")] 66 | public string Number { get; set; } 67 | } 68 | 69 | public class VerifyPhoneNumberViewModel 70 | { 71 | [Required] 72 | [Display(Name = "Code")] 73 | public string Code { get; set; } 74 | 75 | [Required] 76 | [Phone] 77 | [Display(Name = "Phone Number")] 78 | public string PhoneNumber { get; set; } 79 | } 80 | 81 | public class ConfigureTwoFactorViewModel 82 | { 83 | public string SelectedProvider { get; set; } 84 | public ICollection Providers { get; set; } 85 | } 86 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/Models/Product.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | using System.Linq; 6 | using System.Web; 7 | 8 | namespace InventoryManagementSystem.Models 9 | { 10 | public class Product 11 | { 12 | [DatabaseGenerated(DatabaseGeneratedOption.None)] 13 | [Display(Name = "UPC")] 14 | public int ProductID { get; set; } 15 | 16 | [StringLength(50, MinimumLength = 2)] 17 | public string Title { get; set; } 18 | 19 | public int InventoryNumber { get; set; } 20 | 21 | public decimal Price { get; set; } 22 | 23 | public virtual ICollection Purchases { get; set; } 24 | public virtual Department Departments { get; set; } 25 | public virtual Employee Employees { get; set; } 26 | 27 | } 28 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/Models/Purchase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace InventoryManagementSystem.Models 8 | { 9 | public class Purchase 10 | { 11 | [Display(Name = "Quantity")] 12 | public int PurchaseID { get; set; } 13 | [Display(Name = "Product Sold")] 14 | public int ProductID { get; set; } 15 | [Display(Name = "Customer Last Name")] 16 | public int CustomerID { get; set; } 17 | 18 | public virtual Product Product { get; set; } 19 | public virtual Customer Customer { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/Models/Transaction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace InventoryManagementSystem.Models 7 | { 8 | public class Transaction 9 | { 10 | public int TransactionID { get; set; } 11 | public DateTime TimeOfDay { get; set; } 12 | public string AnyIssues { get; set; } 13 | 14 | public virtual Employee Employee { get; set; } 15 | public virtual Customer customer { get; set; } 16 | 17 | } 18 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("InventoryManagementSystem")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Hewlett-Packard")] 12 | [assembly: AssemblyProduct("InventoryManagementSystem")] 13 | [assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("bcb25e97-0808-41fd-9cf9-daed1e69b074")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Scripts/jquery.validate.unobtrusive.min.js: -------------------------------------------------------------------------------- 1 | /* NUGET: BEGIN LICENSE TEXT 2 | * 3 | * Microsoft grants you the right to use these script files for the sole 4 | * purpose of either: (i) interacting through your browser with the Microsoft 5 | * website or online service, subject to the applicable licensing or use 6 | * terms; or (ii) using the files as included with a Microsoft product subject 7 | * to that product's license terms. Microsoft reserves all other rights to the 8 | * files not expressly granted by Microsoft, whether by implication, estoppel 9 | * or otherwise. Insofar as a script file is dual licensed under GPL, 10 | * Microsoft neither took the code under GPL nor distributes it thereunder but 11 | * under the terms set out in this paragraph. All notices and licenses 12 | * below are for informational purposes only. 13 | * 14 | * NUGET: END LICENSE TEXT */ 15 | /* 16 | ** Unobtrusive validation support library for jQuery and jQuery Validate 17 | ** Copyright (C) Microsoft Corporation. All rights reserved. 18 | */ 19 | (function(a){var d=a.validator,b,e="unobtrusiveValidation";function c(a,b,c){a.rules[b]=c;if(a.message)a.messages[b]=a.message}function j(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function f(a){return a.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function h(a){return a.substr(0,a.lastIndexOf(".")+1)}function g(a,b){if(a.indexOf("*.")===0)a=a.replace("*.",b);return a}function m(c,e){var b=a(this).find("[data-valmsg-for='"+f(e[0].name)+"']"),d=b.attr("data-valmsg-replace"),g=d?a.parseJSON(d)!==false:null;b.removeClass("field-validation-valid").addClass("field-validation-error");c.data("unobtrusiveContainer",b);if(g){b.empty();c.removeClass("input-validation-error").appendTo(b)}else c.hide()}function l(e,d){var c=a(this).find("[data-valmsg-summary=true]"),b=c.find("ul");if(b&&b.length&&d.errorList.length){b.empty();c.addClass("validation-summary-errors").removeClass("validation-summary-valid");a.each(d.errorList,function(){a("
  • ").html(this.message).appendTo(b)})}}function k(d){var b=d.data("unobtrusiveContainer"),c=b.attr("data-valmsg-replace"),e=c?a.parseJSON(c):null;if(b){b.addClass("field-validation-valid").removeClass("field-validation-error");d.removeData("unobtrusiveContainer");e&&b.empty()}}function n(){var b=a(this),c="__jquery_unobtrusive_validation_form_reset";if(b.data(c))return;b.data(c,true);try{b.data("validator").resetForm()}finally{b.removeData(c)}b.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors");b.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}function i(b){var c=a(b),f=c.data(e),i=a.proxy(n,b),g=d.unobtrusive.options||{},h=function(e,d){var c=g[e];c&&a.isFunction(c)&&c.apply(b,d)};if(!f){f={options:{errorClass:g.errorClass||"input-validation-error",errorElement:g.errorElement||"span",errorPlacement:function(){m.apply(b,arguments);h("errorPlacement",arguments)},invalidHandler:function(){l.apply(b,arguments);h("invalidHandler",arguments)},messages:{},rules:{},success:function(){k.apply(b,arguments);h("success",arguments)}},attachValidation:function(){c.off("reset."+e,i).on("reset."+e,i).validate(this.options)},validate:function(){c.validate();return c.valid()}};c.data(e,f)}return f}d.unobtrusive={adapters:[],parseElement:function(b,h){var d=a(b),f=d.parents("form")[0],c,e,g;if(!f)return;c=i(f);c.options.rules[b.name]=e={};c.options.messages[b.name]=g={};a.each(this.adapters,function(){var c="data-val-"+this.name,i=d.attr(c),h={};if(i!==undefined){c+="-";a.each(this.params,function(){h[this]=d.attr(c+this)});this.adapt({element:b,form:f,message:i,params:h,rules:e,messages:g})}});a.extend(e,{__dummy__:true});!h&&c.attachValidation()},parse:function(c){var b=a(c),e=b.parents().addBack().filter("form").add(b.find("form")).has("[data-val=true]");b.find("[data-val=true]").each(function(){d.unobtrusive.parseElement(this,true)});e.each(function(){var a=i(this);a&&a.attachValidation()})}};b=d.unobtrusive.adapters;b.add=function(c,a,b){if(!b){b=a;a=[]}this.push({name:c,params:a,adapt:b});return this};b.addBool=function(a,b){return this.add(a,function(d){c(d,b||a,true)})};b.addMinMax=function(e,g,f,a,d,b){return this.add(e,[d||"min",b||"max"],function(b){var e=b.params.min,d=b.params.max;if(e&&d)c(b,a,[e,d]);else if(e)c(b,g,e);else d&&c(b,f,d)})};b.addSingleVal=function(a,b,d){return this.add(a,[b||"val"],function(e){c(e,d||a,e.params[b])})};d.addMethod("__dummy__",function(){return true});d.addMethod("regex",function(b,c,d){var a;if(this.optional(c))return true;a=(new RegExp(d)).exec(b);return a&&a.index===0&&a[0].length===b.length});d.addMethod("nonalphamin",function(c,d,b){var a;if(b){a=c.match(/\W/g);a=a&&a.length>=b}return a});if(d.methods.extension){b.addSingleVal("accept","mimtype");b.addSingleVal("extension","extension")}else b.addSingleVal("extension","extension","accept");b.addSingleVal("regex","pattern");b.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");b.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range");b.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength");b.add("equalto",["other"],function(b){var i=h(b.element.name),j=b.params.other,d=g(j,i),e=a(b.form).find(":input").filter("[name='"+f(d)+"']")[0];c(b,"equalTo",e)});b.add("required",function(a){(a.element.tagName.toUpperCase()!=="INPUT"||a.element.type.toUpperCase()!=="CHECKBOX")&&c(a,"required",true)});b.add("remote",["url","type","additionalfields"],function(b){var d={url:b.params.url,type:b.params.type||"GET",data:{}},e=h(b.element.name);a.each(j(b.params.additionalfields||b.element.name),function(i,h){var c=g(h,e);d.data[c]=function(){var d=a(b.form).find(":input").filter("[name='"+f(c)+"']");return d.is(":checkbox")?d.filter(":checked").val()||d.filter(":hidden").val()||"":d.is(":radio")?d.filter(":checked").val()||"":d.val()}});c(b,"remote",d)});b.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&c(a,"minlength",a.params.min);a.params.nonalphamin&&c(a,"nonalphamin",a.params.nonalphamin);a.params.regex&&c(a,"regex",a.params.regex)});a(function(){d.unobtrusive.parse(document)})})(jQuery); -------------------------------------------------------------------------------- /InventoryManagementSystem/Scripts/respond.min.js: -------------------------------------------------------------------------------- 1 | /* NUGET: BEGIN LICENSE TEXT 2 | * 3 | * Microsoft grants you the right to use these script files for the sole 4 | * purpose of either: (i) interacting through your browser with the Microsoft 5 | * website or online service, subject to the applicable licensing or use 6 | * terms; or (ii) using the files as included with a Microsoft product subject 7 | * to that product's license terms. Microsoft reserves all other rights to the 8 | * files not expressly granted by Microsoft, whether by implication, estoppel 9 | * or otherwise. Insofar as a script file is dual licensed under GPL, 10 | * Microsoft neither took the code under GPL nor distributes it thereunder but 11 | * under the terms set out in this paragraph. All notices and licenses 12 | * below are for informational purposes only. 13 | * 14 | * NUGET: END LICENSE TEXT */ 15 | /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */ 16 | /*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */ 17 | window.matchMedia=window.matchMedia||(function(e,f){var c,a=e.documentElement,b=a.firstElementChild||a.firstChild,d=e.createElement("body"),g=e.createElement("div");g.id="mq-test-1";g.style.cssText="position:absolute;top:-100em";d.style.background="none";d.appendChild(g);return function(h){g.innerHTML='­';a.insertBefore(d,b);c=g.offsetWidth==42;a.removeChild(d);return{matches:c,media:h}}})(document); 18 | 19 | /*! Respond.js v1.2.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */ 20 | (function(e){e.respond={};respond.update=function(){};respond.mediaQueriesSupported=e.matchMedia&&e.matchMedia("only all").matches;if(respond.mediaQueriesSupported){return}var w=e.document,s=w.documentElement,i=[],k=[],q=[],o={},h=30,f=w.getElementsByTagName("head")[0]||s,g=w.getElementsByTagName("base")[0],b=f.getElementsByTagName("link"),d=[],a=function(){var D=b,y=D.length,B=0,A,z,C,x;for(;B-1,minw:F.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:F.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}}j()},l,r,v=function(){var z,A=w.createElement("div"),x=w.body,y=false;A.style.cssText="position:absolute;font-size:1em;width:1em";if(!x){x=y=w.createElement("body");x.style.background="none"}x.appendChild(A);s.insertBefore(x,s.firstChild);z=A.offsetWidth;if(y){s.removeChild(x)}else{x.removeChild(A)}z=p=parseFloat(z);return z},p,j=function(I){var x="clientWidth",B=s[x],H=w.compatMode==="CSS1Compat"&&B||w.body[x]||B,D={},G=b[b.length-1],z=(new Date()).getTime();if(I&&l&&z-l-1?(p||v()):1)}if(!!J){J=parseFloat(J)*(J.indexOf(y)>-1?(p||v()):1)}if(!K.hasquery||(!A||!L)&&(A||H>=C)&&(L||H<=J)){if(!D[K.media]){D[K.media]=[]}D[K.media].push(k[K.rules])}}for(var E in q){if(q[E]&&q[E].parentNode===f){f.removeChild(q[E])}}for(var E in D){var M=w.createElement("style"),F=D[E].join("\n");M.type="text/css";M.media=E;f.insertBefore(M,G.nextSibling);if(M.styleSheet){M.styleSheet.cssText=F}else{M.appendChild(w.createTextNode(F))}q.push(M)}},n=function(x,z){var y=c();if(!y){return}y.open("GET",x,true);y.onreadystatechange=function(){if(y.readyState!=4||y.status!=200&&y.status!=304){return}z(y.responseText)};if(y.readyState==4){return}y.send(null)},c=(function(){var x=false;try{x=new XMLHttpRequest()}catch(y){x=new ActiveXObject("Microsoft.XMLHTTP")}return function(){return x}})();a();respond.update=a;function t(){j(true)}if(e.addEventListener){e.addEventListener("resize",t,false)}else{if(e.attachEvent){e.attachEvent("onresize",t)}}})(this); -------------------------------------------------------------------------------- /InventoryManagementSystem/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Owin; 2 | using Owin; 3 | 4 | [assembly: OwinStartupAttribute(typeof(InventoryManagementSystem.Startup))] 5 | namespace InventoryManagementSystem 6 | { 7 | public partial class Startup 8 | { 9 | public void Configuration(IAppBuilder app) 10 | { 11 | ConfigureAuth(app); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /InventoryManagementSystem/ViewModels/EmployeeIndexData.cs: -------------------------------------------------------------------------------- 1 | using InventoryManagementSystem.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace InventoryManagementSystem.ViewModels 8 | { 9 | public class EmployeeIndexData 10 | { 11 | public IEnumerable Employees { get; set; } 12 | public IEnumerable Products { get; set; } 13 | public IEnumerable Purchases { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/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 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Account/ExternalLoginConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.ExternalLoginConfirmationViewModel 2 | @{ 3 | ViewBag.Title = "Register"; 4 | } 5 |

    @ViewBag.Title.

    6 |

    Associate your @ViewBag.LoginProvider account.

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

    Association Form

    13 |
    14 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 15 |

    16 | You've successfully authenticated with @ViewBag.LoginProvider. 17 | Please enter a user name for this site below and click the Register button to finish 18 | logging in. 19 |

    20 |
    21 | @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) 22 |
    23 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) 24 | @Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" }) 25 |
    26 |
    27 |
    28 |
    29 | 30 |
    31 |
    32 | } 33 | 34 | @section Scripts { 35 | @Scripts.Render("~/bundles/jqueryval") 36 | } 37 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Account/ExternalLoginFailure.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Login Failure"; 3 | } 4 | 5 |
    6 |

    @ViewBag.Title.

    7 |

    Unsuccessful login with service.

    8 |
    9 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Account/ForgotPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.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 | -------------------------------------------------------------------------------- /InventoryManagementSystem/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 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Account/Login.cshtml: -------------------------------------------------------------------------------- 1 | @using InventoryManagementSystem.Models 2 | @model LoginViewModel 3 | @{ 4 | ViewBag.Title = "Log in"; 5 | } 6 | 7 |

    @ViewBag.Title.

    8 |
    9 |
    10 |
    11 | @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 12 | { 13 | @Html.AntiForgeryToken() 14 |

    Use a local account to log in.

    15 |
    16 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 17 |
    18 | @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) 19 |
    20 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) 21 | @Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" }) 22 |
    23 |
    24 |
    25 | @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) 26 |
    27 | @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) 28 | @Html.ValidationMessageFor(m => m.Password, "", new { @class = "text-danger" }) 29 |
    30 |
    31 |
    32 |
    33 |
    34 | @Html.CheckBoxFor(m => m.RememberMe) 35 | @Html.LabelFor(m => m.RememberMe) 36 |
    37 |
    38 |
    39 |
    40 |
    41 | 42 |
    43 |
    44 |

    45 | @Html.ActionLink("Register as a new user", "Register") 46 |

    47 | @* Enable this once you have account confirmation enabled for password reset functionality 48 |

    49 | @Html.ActionLink("Forgot your password?", "ForgotPassword") 50 |

    *@ 51 | } 52 |
    53 |
    54 |
    55 |
    56 | @Html.Partial("_ExternalLoginsListPartial", new ExternalLoginListViewModel { ReturnUrl = ViewBag.ReturnUrl }) 57 |
    58 |
    59 |
    60 | 61 | @section Scripts { 62 | @Scripts.Render("~/bundles/jqueryval") 63 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Account/Register.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.RegisterViewModel 2 | @{ 3 | ViewBag.Title = "Register"; 4 | } 5 | 6 |

    @ViewBag.Title.

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

    Create a new account.

    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 | @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) 22 |
    23 | @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) 24 |
    25 |
    26 |
    27 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 28 |
    29 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 30 |
    31 |
    32 |
    33 |
    34 | 35 |
    36 |
    37 | } 38 | 39 | @section Scripts { 40 | @Scripts.Render("~/bundles/jqueryval") 41 | } 42 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Account/ResetPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.ResetPasswordViewModel 2 | @{ 3 | ViewBag.Title = "Reset password"; 4 | } 5 | 6 |

    @ViewBag.Title.

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

    Reset your password.

    12 |
    13 | @Html.ValidationSummary("", new { @class = "text-danger" }) 14 | @Html.HiddenFor(model => model.Code) 15 |
    16 | @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) 17 |
    18 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) 19 |
    20 |
    21 |
    22 | @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) 23 |
    24 | @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) 25 |
    26 |
    27 |
    28 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 29 |
    30 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 31 |
    32 |
    33 |
    34 |
    35 | 36 |
    37 |
    38 | } 39 | 40 | @section Scripts { 41 | @Scripts.Render("~/bundles/jqueryval") 42 | } 43 | -------------------------------------------------------------------------------- /InventoryManagementSystem/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 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Account/SendCode.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.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 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Account/VerifyCode.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.VerifyCodeViewModel 2 | @{ 3 | ViewBag.Title = "Verify"; 4 | } 5 | 6 |

    @ViewBag.Title.

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

    Enter verification code

    13 |
    14 | @Html.ValidationSummary("", new { @class = "text-danger" }) 15 |
    16 | @Html.LabelFor(m => m.Code, new { @class = "col-md-2 control-label" }) 17 |
    18 | @Html.TextBoxFor(m => m.Code, new { @class = "form-control" }) 19 |
    20 |
    21 |
    22 |
    23 |
    24 | @Html.CheckBoxFor(m => m.RememberBrowser) 25 | @Html.LabelFor(m => m.RememberBrowser) 26 |
    27 |
    28 |
    29 |
    30 |
    31 | 32 |
    33 |
    34 | } 35 | 36 | @section Scripts { 37 | @Scripts.Render("~/bundles/jqueryval") 38 | } 39 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Account/_ExternalLoginsListPartial.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.ExternalLoginListViewModel 2 | @using Microsoft.Owin.Security 3 | 4 |

    Use another service to log in.

    5 |
    6 | @{ 7 | var loginProviders = Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes(); 8 | if (loginProviders.Count() == 0) { 9 |
    10 |

    11 | There are no external authentication services configured. See this article 12 | for details on setting up this ASP.NET application to support logging in via external services. 13 |

    14 |
    15 | } 16 | else { 17 | using (Html.BeginForm("ExternalLogin", "Account", new { ReturnUrl = Model.ReturnUrl })) { 18 | @Html.AntiForgeryToken() 19 |
    20 |

    21 | @foreach (AuthenticationDescription p in loginProviders) { 22 | 23 | } 24 |

    25 |
    26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Assignment/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Assignment 2 | 3 | @{ 4 | ViewBag.Title = "Create"; 5 | } 6 | 7 |

    Create

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

    Assignment

    16 |
    17 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 18 |
    19 | @Html.LabelFor(model => model.EmployeeID, "EmployeeID", htmlAttributes: new { @class = "control-label col-md-2" }) 20 |
    21 | @Html.DropDownList("EmployeeID", null, htmlAttributes: new { @class = "form-control" }) 22 | @Html.ValidationMessageFor(model => model.EmployeeID, "", new { @class = "text-danger" }) 23 |
    24 |
    25 | 26 |
    27 | @Html.LabelFor(model => model.DepartmentID, "DepartmentID", htmlAttributes: new { @class = "control-label col-md-2" }) 28 |
    29 | @Html.DropDownList("DepartmentID", null, htmlAttributes: new { @class = "form-control" }) 30 | @Html.ValidationMessageFor(model => model.DepartmentID, "", new { @class = "text-danger" }) 31 |
    32 |
    33 | 34 |
    35 |
    36 | 37 |
    38 |
    39 |
    40 | } 41 | 42 |
    43 | @Html.ActionLink("Back to List", "Index") 44 |
    45 | 46 | @section Scripts { 47 | @Scripts.Render("~/bundles/jqueryval") 48 | } 49 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Assignment/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Assignment 2 | 3 | @{ 4 | ViewBag.Title = "Delete"; 5 | } 6 | 7 |

    Delete

    8 | 9 |

    Are you sure you want to delete this?

    10 |
    11 |

    Assignment

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

    Details

    8 | 9 |
    10 |

    Assignment

    11 |
    12 |
    13 |
    14 | @Html.DisplayNameFor(model => model.Department.Name) 15 |
    16 | 17 |
    18 | @Html.DisplayFor(model => model.Department.Name) 19 |
    20 | 21 |
    22 | @Html.DisplayNameFor(model => model.Employee.LastName) 23 |
    24 | 25 |
    26 | @Html.DisplayFor(model => model.Employee.LastName) 27 |
    28 | 29 |
    30 |
    31 |

    32 | @Html.ActionLink("Edit", "Edit", new { id = Model.EmployeeID }) | 33 | @Html.ActionLink("Back to List", "Index") 34 |

    35 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Assignment/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Assignment 2 | 3 | @{ 4 | ViewBag.Title = "Edit"; 5 | } 6 | 7 |

    Edit

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

    Assignment

    16 |
    17 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 18 | @Html.HiddenFor(model => model.EmployeeID) 19 | 20 |
    21 | @Html.LabelFor(model => model.DepartmentID, "DepartmentID", htmlAttributes: new { @class = "control-label col-md-2" }) 22 |
    23 | @Html.DropDownList("DepartmentID", null, htmlAttributes: new { @class = "form-control" }) 24 | @Html.ValidationMessageFor(model => model.DepartmentID, "", new { @class = "text-danger" }) 25 |
    26 |
    27 | 28 |
    29 |
    30 | 31 |
    32 |
    33 |
    34 | } 35 | 36 |
    37 | @Html.ActionLink("Back to List", "Index") 38 |
    39 | 40 | @section Scripts { 41 | @Scripts.Render("~/bundles/jqueryval") 42 | } 43 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Assignment/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "Index"; 5 | } 6 | 7 |

    Index

    8 | 9 |

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

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

    Create

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

    Customer

    16 |
    17 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 18 |
    19 | @Html.LabelFor(model => model.LastName, htmlAttributes: new { @class = "control-label col-md-2" }) 20 |
    21 | @Html.EditorFor(model => model.LastName, new { htmlAttributes = new { @class = "form-control" } }) 22 | @Html.ValidationMessageFor(model => model.LastName, "", new { @class = "text-danger" }) 23 |
    24 |
    25 | 26 |
    27 | @Html.LabelFor(model => model.FirstMidName, htmlAttributes: new { @class = "control-label col-md-2" }) 28 |
    29 | @Html.EditorFor(model => model.FirstMidName, new { htmlAttributes = new { @class = "form-control" } }) 30 | @Html.ValidationMessageFor(model => model.FirstMidName, "", new { @class = "text-danger" }) 31 |
    32 |
    33 | 34 |
    35 | @Html.LabelFor(model => model.PurchaseDate, htmlAttributes: new { @class = "control-label col-md-2" }) 36 |
    37 | @Html.EditorFor(model => model.PurchaseDate, new { htmlAttributes = new { @class = "form-control" } }) 38 | @Html.ValidationMessageFor(model => model.PurchaseDate, "", new { @class = "text-danger" }) 39 |
    40 |
    41 | 42 |
    43 |
    44 | 45 |
    46 |
    47 |
    48 | } 49 | 50 |
    51 | @Html.ActionLink("Back to List", "Index") 52 |
    53 | 54 | @section Scripts { 55 | @Scripts.Render("~/bundles/jqueryval") 56 | } 57 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Customer/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Customer 2 | 3 | @{ 4 | ViewBag.Title = "Delete"; 5 | } 6 | 7 |

    Delete

    8 | 9 |

    Are you sure you want to delete this?

    10 |
    11 |

    Customer

    12 |
    @Html.DisplayFor(model => model.FullName)
    13 |
    14 |
    15 |
    16 | @Html.DisplayNameFor(model => model.LastName) 17 |
    18 | 19 |
    20 | @Html.DisplayFor(model => model.LastName) 21 |
    22 | 23 |
    24 | @Html.DisplayNameFor(model => model.FirstMidName) 25 |
    26 | 27 |
    28 | @Html.DisplayFor(model => model.FirstMidName) 29 |
    30 | 31 |
    32 | @Html.DisplayNameFor(model => model.PurchaseDate) 33 |
    34 | 35 |
    36 | 37 | @using (Html.BeginForm()) { 38 | @Html.AntiForgeryToken() 39 | 40 |
    41 | | 42 | @Html.ActionLink("Back to List", "Index") 43 |
    44 | } 45 |
    46 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Customer/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Customer 2 | 3 | @{ 4 | ViewBag.Title = "Details"; 5 | } 6 | 7 |

    Details

    8 | 9 |
    10 |

    Customer

    11 |
    @Html.DisplayFor(model => model.FullName)
    12 |
    13 |
    14 |
    15 | @Html.DisplayNameFor(model => model.LastName) 16 |
    17 | 18 |
    19 | @Html.DisplayFor(model => model.LastName) 20 |
    21 | 22 |
    23 | @Html.DisplayNameFor(model => model.FirstMidName) 24 |
    25 | 26 |
    27 | @Html.DisplayFor(model => model.FirstMidName) 28 |
    29 | 30 |
    31 | @Html.DisplayNameFor(model => model.PurchaseDate) 32 |
    33 | 34 |
    35 | @Html.DisplayFor(model => model.PurchaseDate) 36 |
    37 |
    38 | @Html.DisplayFor(model => model.PurchaseDate) 39 |
    40 |
    41 | @Html.DisplayNameFor(model => model.Purchase) 42 |
    43 |
    44 | 45 | 46 | 47 | 48 | 49 | @foreach (var item in Model.Purchase) 50 | { 51 | 52 | 55 | @**@ 58 | 59 | } 60 |
    ProductPrice
    53 | @Html.DisplayFor(modelItem => item.Product.Title) 54 | 56 | @Html.DisplayFor(modelItem => item.Grade) 57 |
    61 |
    62 |
    63 |
    64 |

    65 | @Html.ActionLink("Edit", "Edit", new { id = Model.ID }) | 66 | @Html.ActionLink("Back to List", "Index") 67 |

    68 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Customer/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Customer 2 | 3 | @{ 4 | ViewBag.Title = "Edit"; 5 | } 6 | 7 |

    Edit

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

    Customer

    16 |
    @Html.DisplayFor(model => model.FullName)
    17 |
    18 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 19 | @Html.HiddenFor(model => model.ID) 20 | 21 |
    22 | @Html.LabelFor(model => model.LastName, htmlAttributes: new { @class = "control-label col-md-2" }) 23 |
    24 | @Html.EditorFor(model => model.LastName, new { htmlAttributes = new { @class = "form-control" } }) 25 | @Html.ValidationMessageFor(model => model.LastName, "", new { @class = "text-danger" }) 26 |
    27 |
    28 | 29 |
    30 | @Html.LabelFor(model => model.FirstMidName, htmlAttributes: new { @class = "control-label col-md-2" }) 31 |
    32 | @Html.EditorFor(model => model.FirstMidName, new { htmlAttributes = new { @class = "form-control" } }) 33 | @Html.ValidationMessageFor(model => model.FirstMidName, "", new { @class = "text-danger" }) 34 |
    35 |
    36 | 37 |
    38 | @Html.LabelFor(model => model.PurchaseDate, htmlAttributes: new { @class = "control-label col-md-2" }) 39 |
    40 | @Html.EditorFor(model => model.PurchaseDate, new { htmlAttributes = new { @class = "form-control" } }) 41 | @Html.ValidationMessageFor(model => model.PurchaseDate, "", new { @class = "text-danger" }) 42 |
    43 |
    44 | 45 |
    46 |
    47 | 48 |
    49 |
    50 |
    51 | } 52 | 53 |
    54 | @Html.ActionLink("Back to List", "Index") 55 |
    56 | 57 | @section Scripts { 58 | @Scripts.Render("~/bundles/jqueryval") 59 | } 60 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Customer/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model PagedList.IPagedList 2 | @using PagedList.Mvc; 3 | 4 | @{ 5 | ViewBag.Title = "Customers"; 6 | } 7 | 8 |

    Customers

    9 | 10 |

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

    13 | @using (Html.BeginForm("Index", "Customer", FormMethod.Get)) 14 | 15 | { 16 |

    17 | Find by name: @Html.TextBox("SearchString", ViewBag.CurrentFilter as string) 18 | 19 |

    20 | } 21 | 22 | 23 | 24 | 27 | 30 | 33 | 34 | 35 | 36 | @foreach (var item in Model) { 37 | 38 | 41 | 44 | 47 | 52 | 53 | } 54 | 55 |
    25 | @Html.ActionLink("Last Name", "Index", new { sortOrder = ViewBag.NameSortParm, currentFilter = ViewBag.CurrentFilter }) 26 | 28 | First Name 29 | 31 | @Html.ActionLink("Last Purchase Date", "Index", new { sortOrder = ViewBag.DateSortParm, currentFilter = ViewBag.CurrentFilter }) 32 |
    39 | @Html.DisplayFor(modelItem => item.LastName) 40 | 42 | @Html.DisplayFor(modelItem => item.FirstMidName) 43 | 45 | @Html.DisplayFor(modelItem => item.PurchaseDate) 46 | 48 | @Html.ActionLink("Edit", "Edit", new { id=item.ID }) | 49 | @Html.ActionLink("Details", "Details", new { id=item.ID }) | 50 | @Html.ActionLink("Delete", "Delete", new { id=item.ID }) 51 |
    56 |
    57 | Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount 58 | 59 | @Html.PagedListPager(Model, page => Url.Action("Index", 60 | new { page, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter })) 61 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Department/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Department 2 | 3 | @{ 4 | ViewBag.Title = "Create"; 5 | } 6 | 7 |

    Create

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

    Department

    16 |
    17 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 18 |
    19 | @Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "control-label col-md-2" }) 20 |
    21 | @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } }) 22 | @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" }) 23 |
    24 |
    25 | 26 |
    27 | @Html.LabelFor(model => model.Budget, htmlAttributes: new { @class = "control-label col-md-2" }) 28 |
    29 | @Html.EditorFor(model => model.Budget, new { htmlAttributes = new { @class = "form-control" } }) 30 | @Html.ValidationMessageFor(model => model.Budget, "", new { @class = "text-danger" }) 31 |
    32 |
    33 | 34 |
    35 | @Html.LabelFor(model => model.StartDate, htmlAttributes: new { @class = "control-label col-md-2" }) 36 |
    37 | @Html.EditorFor(model => model.StartDate, new { htmlAttributes = new { @class = "form-control" } }) 38 | @Html.ValidationMessageFor(model => model.StartDate, "", new { @class = "text-danger" }) 39 |
    40 |
    41 | 42 |
    43 | @Html.LabelFor(model => model.EmployeeID, "EmployeeID", htmlAttributes: new { @class = "control-label col-md-2" }) 44 |
    45 | @Html.DropDownList("EmployeeID", null, htmlAttributes: new { @class = "form-control" }) 46 | @Html.ValidationMessageFor(model => model.EmployeeID, "", new { @class = "text-danger" }) 47 |
    48 |
    49 | 50 |
    51 |
    52 | 53 |
    54 |
    55 |
    56 | } 57 | 58 |
    59 | @Html.ActionLink("Back to List", "Index") 60 |
    61 | 62 | @section Scripts { 63 | @Scripts.Render("~/bundles/jqueryval") 64 | } 65 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Department/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Department 2 | 3 | @{ 4 | ViewBag.Title = "Delete"; 5 | } 6 | 7 |

    Delete

    8 | 9 |

    Are you sure you want to delete this?

    10 |
    11 |

    Department

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

    Details

    8 | 9 |
    10 |

    Department

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

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

    51 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Department/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Department 2 | 3 | @{ 4 | ViewBag.Title = "Edit"; 5 | } 6 | 7 |

    Edit

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

    Department

    16 |
    17 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 18 | @Html.HiddenFor(model => model.DepartmentID) 19 | 20 |
    21 | @Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "control-label col-md-2" }) 22 |
    23 | @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } }) 24 | @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" }) 25 |
    26 |
    27 | 28 |
    29 | @Html.LabelFor(model => model.Budget, htmlAttributes: new { @class = "control-label col-md-2" }) 30 |
    31 | @Html.EditorFor(model => model.Budget, new { htmlAttributes = new { @class = "form-control" } }) 32 | @Html.ValidationMessageFor(model => model.Budget, "", new { @class = "text-danger" }) 33 |
    34 |
    35 | 36 |
    37 | @Html.LabelFor(model => model.StartDate, htmlAttributes: new { @class = "control-label col-md-2" }) 38 |
    39 | @Html.EditorFor(model => model.StartDate, new { htmlAttributes = new { @class = "form-control" } }) 40 | @Html.ValidationMessageFor(model => model.StartDate, "", new { @class = "text-danger" }) 41 |
    42 |
    43 | 44 |
    45 | @Html.LabelFor(model => model.EmployeeID, "EmployeeID", htmlAttributes: new { @class = "control-label col-md-2" }) 46 |
    47 | @Html.DropDownList("EmployeeID", null, htmlAttributes: new { @class = "form-control" }) 48 | @Html.ValidationMessageFor(model => model.EmployeeID, "", new { @class = "text-danger" }) 49 |
    50 |
    51 | 52 |
    53 |
    54 | 55 |
    56 |
    57 |
    58 | } 59 | 60 |
    61 | @Html.ActionLink("Back to List", "Index") 62 |
    63 | 64 | @section Scripts { 65 | @Scripts.Render("~/bundles/jqueryval") 66 | } 67 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Department/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "Index"; 5 | } 6 | 7 |

    Index

    8 | 9 |

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

    12 | 13 | 14 | 17 | 20 | 23 | 26 | 27 | 28 | 29 | @foreach (var item in Model) { 30 | 31 | 34 | 37 | 40 | 43 | 48 | 49 | } 50 | 51 |
    15 | @Html.DisplayNameFor(model => model.Manager.LastName) 16 | 18 | @Html.DisplayNameFor(model => model.Name) 19 | 21 | @Html.DisplayNameFor(model => model.Budget) 22 | 24 | @Html.DisplayNameFor(model => model.StartDate) 25 |
    32 | @Html.DisplayFor(modelItem => item.Manager.LastName) 33 | 35 | @Html.DisplayFor(modelItem => item.Name) 36 | 38 | @Html.DisplayFor(modelItem => item.Budget) 39 | 41 | @Html.DisplayFor(modelItem => item.StartDate) 42 | 44 | @Html.ActionLink("Edit", "Edit", new { id=item.DepartmentID }) | 45 | @Html.ActionLink("Details", "Details", new { id=item.DepartmentID }) | 46 | @Html.ActionLink("Delete", "Delete", new { id=item.DepartmentID }) 47 |
    52 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Employee/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Employee 2 | 3 | @{ 4 | ViewBag.Title = "Create"; 5 | } 6 | 7 |

    Create

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

    Employee

    16 |
    17 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 18 |
    19 | @Html.LabelFor(model => model.LastName, htmlAttributes: new { @class = "control-label col-md-2" }) 20 |
    21 | @Html.EditorFor(model => model.LastName, new { htmlAttributes = new { @class = "form-control" } }) 22 | @Html.ValidationMessageFor(model => model.LastName, "", new { @class = "text-danger" }) 23 |
    24 |
    25 | 26 |
    27 | @Html.LabelFor(model => model.FirstMidName, htmlAttributes: new { @class = "control-label col-md-2" }) 28 |
    29 | @Html.EditorFor(model => model.FirstMidName, new { htmlAttributes = new { @class = "form-control" } }) 30 | @Html.ValidationMessageFor(model => model.FirstMidName, "", new { @class = "text-danger" }) 31 |
    32 |
    33 | 34 |
    35 | @Html.LabelFor(model => model.HireDate, htmlAttributes: new { @class = "control-label col-md-2" }) 36 |
    37 | @Html.EditorFor(model => model.HireDate, new { htmlAttributes = new { @class = "form-control" } }) 38 | @Html.ValidationMessageFor(model => model.HireDate, "", new { @class = "text-danger" }) 39 |
    40 |
    41 | 42 |
    43 |
    44 | 45 |
    46 |
    47 |
    48 | } 49 | 50 |
    51 | @Html.ActionLink("Back to List", "Index") 52 |
    53 | 54 | @section Scripts { 55 | @Scripts.Render("~/bundles/jqueryval") 56 | } 57 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Employee/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Employee 2 | 3 | @{ 4 | ViewBag.Title = "Delete"; 5 | } 6 | 7 |

    Delete

    8 | 9 |

    Are you sure you want to delete this?

    10 |
    11 |

    Employee

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

    Details

    8 | 9 |
    10 |

    Employee

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

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

    51 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Employee/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Employee 2 | 3 | @{ 4 | ViewBag.Title = "Edit"; 5 | } 6 | 7 |

    Edit

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

    Employee

    16 |
    17 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 18 | @Html.HiddenFor(model => model.ID) 19 | 20 |
    21 | @Html.LabelFor(model => model.LastName, htmlAttributes: new { @class = "control-label col-md-2" }) 22 |
    23 | @Html.EditorFor(model => model.LastName, new { htmlAttributes = new { @class = "form-control" } }) 24 | @Html.ValidationMessageFor(model => model.LastName, "", new { @class = "text-danger" }) 25 |
    26 |
    27 | 28 |
    29 | @Html.LabelFor(model => model.FirstMidName, htmlAttributes: new { @class = "control-label col-md-2" }) 30 |
    31 | @Html.EditorFor(model => model.FirstMidName, new { htmlAttributes = new { @class = "form-control" } }) 32 | @Html.ValidationMessageFor(model => model.FirstMidName, "", new { @class = "text-danger" }) 33 |
    34 |
    35 | 36 |
    37 | @Html.LabelFor(model => model.HireDate, htmlAttributes: new { @class = "control-label col-md-2" }) 38 |
    39 | @Html.EditorFor(model => model.HireDate, new { htmlAttributes = new { @class = "form-control" } }) 40 | @Html.ValidationMessageFor(model => model.HireDate, "", new { @class = "text-danger" }) 41 |
    42 |
    43 | 44 |
    45 |
    46 | 47 |
    48 |
    49 |
    50 | } 51 | 52 |
    53 | @Html.ActionLink("Back to List", "Index") 54 |
    55 | 56 | @section Scripts { 57 | @Scripts.Render("~/bundles/jqueryval") 58 | } 59 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Employee/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "Index"; 5 | } 6 | 7 |

    Index

    8 | 9 |

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

    12 | 13 | 14 | @**@ 17 | 20 | 23 | 26 | 27 | 28 | 29 | @foreach (var item in Model) { 30 | 31 | @**@ 34 | 37 | 40 | 43 | 48 | 49 | } 50 | 51 |
    15 | @Html.DisplayNameFor(model => model.Assignment.EmployeeID) 16 | 18 | @Html.DisplayNameFor(model => model.LastName) 19 | 21 | @Html.DisplayNameFor(model => model.FirstMidName) 22 | 24 | @Html.DisplayNameFor(model => model.HireDate) 25 |
    32 | @Html.DisplayFor(modelItem => item.Assignment.EmployeeID) 33 | 35 | @Html.DisplayFor(modelItem => item.LastName) 36 | 38 | @Html.DisplayFor(modelItem => item.FirstMidName) 39 | 41 | @Html.DisplayFor(modelItem => item.HireDate) 42 | 44 | @Html.ActionLink("Edit", "Edit", new { id=item.ID }) | 45 | @Html.ActionLink("Details", "Details", new { id=item.ID }) | 46 | @Html.ActionLink("Delete", "Delete", new { id=item.ID }) 47 |
    52 | -------------------------------------------------------------------------------- /InventoryManagementSystem/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 | 9 | 10 | -------------------------------------------------------------------------------- /InventoryManagementSystem/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 |
    -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Manage/AddPhoneNumber.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.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 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Manage/ChangePassword.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.ChangePasswordViewModel 2 | @{ 3 | ViewBag.Title = "Change Password"; 4 | } 5 | 6 |

    @ViewBag.Title.

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

    Change Password Form

    12 |
    13 | @Html.ValidationSummary("", new { @class = "text-danger" }) 14 |
    15 | @Html.LabelFor(m => m.OldPassword, new { @class = "col-md-2 control-label" }) 16 |
    17 | @Html.PasswordFor(m => m.OldPassword, new { @class = "form-control" }) 18 |
    19 |
    20 |
    21 | @Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" }) 22 |
    23 | @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" }) 24 |
    25 |
    26 |
    27 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 28 |
    29 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 30 |
    31 |
    32 |
    33 |
    34 | 35 |
    36 |
    37 | } 38 | @section Scripts { 39 | @Scripts.Render("~/bundles/jqueryval") 40 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Manage/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.IndexViewModel 2 | @{ 3 | ViewBag.Title = "Manage"; 4 | } 5 | 6 |

    @ViewBag.Title.

    7 | 8 |

    @ViewBag.StatusMessage

    9 |
    10 |

    Change your account settings

    11 |
    12 |
    13 |
    Password:
    14 |
    15 | [ 16 | @if (Model.HasPassword) 17 | { 18 | @Html.ActionLink("Change your password", "ChangePassword") 19 | } 20 | else 21 | { 22 | @Html.ActionLink("Create", "SetPassword") 23 | } 24 | ] 25 |
    26 |
    External Logins:
    27 |
    28 | @Model.Logins.Count [ 29 | @Html.ActionLink("Manage", "ManageLogins") ] 30 |
    31 | @* 32 | Phone Numbers can used as a second factor of verification in a two-factor authentication system. 33 | 34 | See this article 35 | for details on setting up this ASP.NET application to support two-factor authentication using SMS. 36 | 37 | Uncomment the following block after you have set up two-factor authentication 38 | *@ 39 | @* 40 |
    Phone Number:
    41 |
    42 | @(Model.PhoneNumber ?? "None") 43 | @if (Model.PhoneNumber != null) 44 | { 45 |
    46 | [  @Html.ActionLink("Change", "AddPhoneNumber")  ] 47 | using (Html.BeginForm("RemovePhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 48 | { 49 | @Html.AntiForgeryToken() 50 | [] 51 | } 52 | } 53 | else 54 | { 55 | [  @Html.ActionLink("Add", "AddPhoneNumber") 56 | } 57 |
    58 | *@ 59 |
    Two-Factor Authentication:
    60 |
    61 |

    62 | There are no two-factor authentication providers configured. See this article 63 | for details on setting up this ASP.NET application to support two-factor authentication. 64 |

    65 | @*@if (Model.TwoFactor) 66 | { 67 | using (Html.BeginForm("DisableTwoFactorAuthentication", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 68 | { 69 | @Html.AntiForgeryToken() 70 | Enabled 71 | 72 | 73 | } 74 | } 75 | else 76 | { 77 | using (Html.BeginForm("EnableTwoFactorAuthentication", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 78 | { 79 | @Html.AntiForgeryToken() 80 | Disabled 81 | 82 | 83 | } 84 | }*@ 85 |
    86 |
    87 |
    88 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Manage/ManageLogins.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.ManageLoginsViewModel 2 | @using Microsoft.Owin.Security 3 | @{ 4 | ViewBag.Title = "Manage your external logins"; 5 | } 6 | 7 |

    @ViewBag.Title.

    8 | 9 |

    @ViewBag.StatusMessage

    10 | @{ 11 | var loginProviders = Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes(); 12 | if (loginProviders.Count() == 0) { 13 |
    14 |

    15 | There are no external authentication services configured. See this article 16 | for details on setting up this ASP.NET application to support logging in via external services. 17 |

    18 |
    19 | } 20 | else 21 | { 22 | if (Model.CurrentLogins.Count > 0) 23 | { 24 |

    Registered Logins

    25 | 26 | 27 | @foreach (var account in Model.CurrentLogins) 28 | { 29 | 30 | 31 | 49 | 50 | } 51 | 52 |
    @account.LoginProvider 32 | @if (ViewBag.ShowRemoveButton) 33 | { 34 | using (Html.BeginForm("RemoveLogin", "Manage")) 35 | { 36 | @Html.AntiForgeryToken() 37 |
    38 | @Html.Hidden("loginProvider", account.LoginProvider) 39 | @Html.Hidden("providerKey", account.ProviderKey) 40 | 41 |
    42 | } 43 | } 44 | else 45 | { 46 | @:   47 | } 48 |
    53 | } 54 | if (Model.OtherLogins.Count > 0) 55 | { 56 | using (Html.BeginForm("LinkLogin", "Manage")) 57 | { 58 | @Html.AntiForgeryToken() 59 |
    60 |

    61 | @foreach (AuthenticationDescription p in Model.OtherLogins) 62 | { 63 | 64 | } 65 |

    66 |
    67 | } 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Manage/SetPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.SetPasswordViewModel 2 | @{ 3 | ViewBag.Title = "Create Password"; 4 | } 5 | 6 |

    @ViewBag.Title.

    7 |

    8 | You do not have a local username/password for this site. Add a local 9 | account so you can log in without an external login. 10 |

    11 | 12 | @using (Html.BeginForm("SetPassword", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 13 | { 14 | @Html.AntiForgeryToken() 15 | 16 |

    Create Local Login

    17 |
    18 | @Html.ValidationSummary("", new { @class = "text-danger" }) 19 |
    20 | @Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" }) 21 |
    22 | @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" }) 23 |
    24 |
    25 |
    26 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 27 |
    28 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 29 |
    30 |
    31 |
    32 |
    33 | 34 |
    35 |
    36 | } 37 | @section Scripts { 38 | @Scripts.Render("~/bundles/jqueryval") 39 | } -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Manage/VerifyPhoneNumber.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.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 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Product/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Product 2 | 3 | @{ 4 | ViewBag.Title = "Create"; 5 | } 6 | 7 |

    Create

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

    Product

    16 |
    17 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 18 | 19 |
    20 | 21 |
    22 | @Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } }) 23 | @Html.ValidationMessageFor(model => model.Title, "", new { @class = "text-danger" }) 24 |
    25 |
    26 | 27 |
    28 | @Html.LabelFor(model => model.ProductID, htmlAttributes: new { @class = "control-label col-md-2" }) 29 |
    30 | @Html.EditorFor(model => model.ProductID, new { htmlAttributes = new { @class = "form-control" } }) 31 | @Html.ValidationMessageFor(model => model.ProductID, "", new { @class = "text-danger" }) 32 |
    33 |
    34 | @*
    35 | @Html.LabelFor(model => model.SectionID, htmlAttributes: new { @class = "control-label col-md-2" }) 36 |
    37 | @Html.EditorFor(model => model.SectionID, new { htmlAttributes = new { @class = "form-control" } }) 38 | @Html.ValidationMessageFor(model => model.SectionID, "", new { @class = "text-danger" }) 39 |
    40 |
    *@ 41 | 42 |
    43 | 44 |
    45 | @Html.EditorFor(model => model.Price, new { htmlAttributes = new { @class = "form-control" } }) 46 | @Html.ValidationMessageFor(model => model.Price, "", new { @class = "text-danger" }) 47 |
    48 |
    49 | 50 |
    51 | @Html.LabelFor(model => model.InventoryNumber, htmlAttributes: new { @class = "control-label col-md-2" }) 52 |
    53 | @Html.EditorFor(model => model.InventoryNumber, new { htmlAttributes = new { @class = "form-control" } }) 54 | @Html.ValidationMessageFor(model => model.InventoryNumber, "", new { @class = "text-danger" }) 55 |
    56 |
    57 | 58 |
    59 |
    60 | 61 |
    62 |
    63 |
    64 | } 65 | 66 |
    67 | @Html.ActionLink("Back to List", "Index") 68 |
    69 | 70 | @section Scripts { 71 | @Scripts.Render("~/bundles/jqueryval") 72 | } 73 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Product/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Product 2 | 3 | @{ 4 | ViewBag.Title = "Delete"; 5 | } 6 | 7 |

    Delete

    8 | 9 |

    Are you sure you want to delete this?

    10 |
    11 |

    Product

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

    Details

    8 | 9 |
    10 |

    Product

    11 |
    @Html.DisplayFor(model => model.Title)
    12 |
    13 |
    14 |
    15 | @Html.DisplayNameFor(model => model.Title) 16 |
    17 |
    18 | @Html.DisplayFor(model => model.Title) 19 |
    20 |
    21 | @Html.DisplayNameFor(model => model.ProductID) 22 |
    23 | 24 |
    25 | @Html.DisplayFor(model => model.ProductID) 26 |
    27 | 28 | @*
    29 | @Html.DisplayNameFor(model => model.SectionID) 30 |
    31 | 32 |
    33 | @Html.DisplayFor(model => model.SectionID) 34 |
    *@ 35 | 36 |
    37 | @Html.DisplayNameFor(model => model.Price) 38 |
    39 | 40 |
    41 | @Html.DisplayFor(model => model.Price) 42 |
    43 | 44 |
    45 | @Html.DisplayNameFor(model => model.InventoryNumber) 46 |
    47 | 48 |
    49 | @Html.DisplayFor(model => model.InventoryNumber) 50 |
    51 | 52 |
    53 |
    54 |

    55 | @Html.ActionLink("Edit", "Edit", new { id = Model.ProductID }) | 56 | @Html.ActionLink("Back to List", "Index") 57 |

    58 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Product/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Product 2 | 3 | @{ 4 | ViewBag.Title = "Edit"; 5 | } 6 | 7 |

    Edit

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

    Product

    16 |
    @Html.DisplayFor(model => model.Title)
    17 |
    18 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 19 | @Html.HiddenFor(model => model.ProductID) 20 | 21 |
    22 | 23 |
    24 | @Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } }) 25 | @Html.ValidationMessageFor(model => model.Title, "", new { @class = "text-danger" }) 26 |
    27 |
    28 | 29 |
    30 | 31 |
    32 | @Html.EditorFor(model => model.ProductID, new { htmlAttributes = new { @class = "form-control" } }) 33 | @Html.ValidationMessageFor(model => model.ProductID, "", new { @class = "text-danger" }) 34 |
    35 |
    36 | 37 | @*
    38 | 39 |
    40 | @Html.EditorFor(model => model.SectionID, new { htmlAttributes = new { @class = "form-control" } }) 41 | @Html.ValidationMessageFor(model => model.SectionID, "", new { @class = "text-danger" }) 42 |
    43 |
    *@ 44 | 45 |
    46 | 47 |
    48 | @Html.EditorFor(model => model.Price, new { htmlAttributes = new { @class = "form-control" } }) 49 | @Html.ValidationMessageFor(model => model.Price, "", new { @class = "text-danger" }) 50 |
    51 |
    52 |
    53 | 54 |
    55 | @Html.EditorFor(model => model.InventoryNumber, new { htmlAttributes = new { @class = "form-control" } }) 56 | @Html.ValidationMessageFor(model => model.InventoryNumber, "", new { @class = "text-danger" }) 57 |
    58 |
    59 | 60 |
    61 |
    62 | 63 |
    64 |
    65 |
    66 | } 67 | 68 |
    69 | @Html.ActionLink("Back to List", "Index") 70 |
    71 | 72 | @section Scripts { 73 | @Scripts.Render("~/bundles/jqueryval") 74 | } 75 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Product/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "Products"; 5 | } 6 | 7 |

    Products

    8 | 9 |

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

    12 | 13 | 14 | 17 | 20 | @**@ 23 | 24 | 27 | 28 | 31 | 32 | 33 | @foreach (var item in Model) { 34 | 35 | 38 | 41 | 42 | @**@ 45 | 46 | 49 | 52 | 57 | 58 | } 59 | 60 |
    15 | @Html.DisplayNameFor(model => model.Title) 16 | 18 | @Html.DisplayNameFor(model => model.ProductID) 19 | 21 | @Html.DisplayNameFor(model => model.SectionID) 22 | 25 | @Html.DisplayNameFor(model => model.Price) 26 | 29 | @Html.DisplayNameFor(model => model.InventoryNumber) 30 |
    36 | @Html.DisplayFor(modelItem => item.Title) 37 | 39 | @Html.DisplayFor(modelItem => item.ProductID) 40 | 43 | @Html.DisplayFor(modelItem => item.SectionID) 44 | 47 | @Html.DisplayFor(modelItem => item.Price) 48 | 50 | @Html.DisplayFor(modelItem => item.InventoryNumber) 51 | 53 | @Html.ActionLink("Edit", "Edit", new { id=item.ProductID }) | 54 | @Html.ActionLink("Details", "Details", new { id=item.ProductID }) | 55 | @Html.ActionLink("Delete", "Delete", new { id=item.ProductID }) 56 |
    61 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Purchase/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Purchase 2 | 3 | @{ 4 | ViewBag.Title = "Create"; 5 | } 6 | 7 |

    Create

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

    Purchase

    16 |
    17 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 18 |
    19 | @Html.LabelFor(model => model.ProductID, "Product", htmlAttributes: new { @class = "control-label col-md-2" }) 20 |
    21 | @Html.DropDownList("ProductID", null, htmlAttributes: new { @class = "form-control" }) 22 | @Html.ValidationMessageFor(model => model.ProductID, "", new { @class = "text-danger" }) 23 |
    24 |
    25 | 26 |
    27 | @Html.LabelFor(model => model.CustomerID, "Customer", htmlAttributes: new { @class = "control-label col-md-2" }) 28 |
    29 | @Html.DropDownList("CustomerID", null, htmlAttributes: new { @class = "form-control" }) 30 | @Html.ValidationMessageFor(model => model.CustomerID, "", new { @class = "text-danger" }) 31 |
    32 |
    33 | 34 |
    35 | @Html.LabelFor(model => model.PurchaseID, "Quantity", htmlAttributes: new { @class = "control-label col-md-2" }) 36 |
    37 | @Html.EditorFor(model => model.PurchaseID, new { htmlAttributes = new { @class = "form-control" } }) 38 | @Html.ValidationMessageFor(model => model.PurchaseID, "", new { @class = "text-danger" }) 39 |
    40 |
    41 | 42 |
    43 |
    44 | 45 |
    46 |
    47 |
    48 | } 49 | 50 |
    51 | @Html.ActionLink("Back to List", "Index") 52 |
    53 | 54 | @section Scripts { 55 | @Scripts.Render("~/bundles/jqueryval") 56 | } 57 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Purchase/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Purchase 2 | 3 | @{ 4 | ViewBag.Title = "Delete"; 5 | } 6 | 7 |

    Delete

    8 | 9 |

    Are you sure you want to delete this?

    10 |
    11 |

    Purchase

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

    Details

    8 | 9 |
    10 |

    Purchase

    11 |
    12 |
    13 |
    14 | Customer's Name 15 |
    16 | 17 |
    18 | @Html.DisplayFor(model => model.Customer.LastName) 19 |
    20 | 21 |
    22 | Product 23 |
    24 | 25 |
    26 | @Html.DisplayFor(model => model.Product) 27 |
    28 |
    Quantity
    29 |
    @Html.DisplayFor(model => model.PurchaseID)
    30 | 31 |
    32 |
    33 |

    34 | @Html.ActionLink("Edit", "Edit", new { id = Model.PurchaseID }) | 35 | @Html.ActionLink("Back to List", "Index") 36 |

    37 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Purchase/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model InventoryManagementSystem.Models.Purchase 2 | 3 | @{ 4 | ViewBag.Title = "Edit"; 5 | } 6 | 7 |

    Edit

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

    Purchase

    16 |
    17 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 18 | @Html.HiddenFor(model => model.PurchaseID) 19 | 20 |
    21 | @Html.LabelFor(model => model.ProductID, "ProductID", htmlAttributes: new { @class = "control-label col-md-2" }) 22 |
    23 | @Html.DropDownList("ProductID", null, htmlAttributes: new { @class = "form-control" }) 24 | @Html.ValidationMessageFor(model => model.ProductID, "", new { @class = "text-danger" }) 25 |
    26 |
    27 | 28 |
    29 | @Html.LabelFor(model => model.CustomerID, "CustomerID", htmlAttributes: new { @class = "control-label col-md-2" }) 30 |
    31 | @Html.DropDownList("CustomerID", null, htmlAttributes: new { @class = "form-control" }) 32 | @Html.ValidationMessageFor(model => model.CustomerID, "", new { @class = "text-danger" }) 33 |
    34 |
    35 | 36 |
    37 | @Html.LabelFor(model => model.PurchaseID, "PurchaseID", htmlAttributes: new { @class = "control-label col-md-2" }) 38 |
    39 | @Html.EditorFor(model => model.PurchaseID, new { htmlAttributes = new { @class = "form-control" } }) 40 | @Html.ValidationMessageFor(model => model.PurchaseID, "", new { @class = "text-danger" }) 41 |
    42 |
    43 | 44 |
    45 |
    46 | 47 |
    48 |
    49 |
    50 | } 51 | 52 |
    53 | @Html.ActionLink("Back to List", "Index") 54 |
    55 | 56 | @section Scripts { 57 | @Scripts.Render("~/bundles/jqueryval") 58 | } 59 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Purchase/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewBag.Title = "Index"; 5 | } 6 | 7 |

    Transaction

    8 | 9 |

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

    12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | @foreach (var item in Model) { 20 | 21 | 24 | 27 | 30 | 35 | 36 | } 37 | 38 |
    ProductCustomer's Last NameQuantity
    22 | @Html.DisplayFor(modelItem => item.Product.Title) 23 | 25 | @Html.DisplayFor(modelItem => item.Customer.LastName) 26 | 28 | @Html.DisplayFor(modelItem => item.PurchaseID) 29 | 31 | @Html.ActionLink("Edit", "Edit", new { id=item.PurchaseID }) | 32 | @Html.ActionLink("Details", "Details", new { id=item.PurchaseID }) | 33 | @Html.ActionLink("Delete", "Delete", new { id=item.PurchaseID }) 34 |
    39 | -------------------------------------------------------------------------------- /InventoryManagementSystem/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 | -------------------------------------------------------------------------------- /InventoryManagementSystem/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 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewBag.Title - The Store 7 | @Styles.Render("~/Content/css") 8 | @Scripts.Render("~/bundles/modernizr") 9 | 10 | 11 | 12 | 38 |
    39 | @RenderBody() 40 |
    41 |
    42 |

    © @DateTime.Now.Year - The Store

    43 |
    44 |
    45 | 46 | @Scripts.Render("~/bundles/jquery") 47 | @Scripts.Render("~/bundles/bootstrap") 48 | @RenderSection("scripts", required: false) 49 | 50 | 51 | -------------------------------------------------------------------------------- /InventoryManagementSystem/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 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 |
    7 |
    8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /InventoryManagementSystem/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 |
    10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /InventoryManagementSystem/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/favicon.ico -------------------------------------------------------------------------------- /InventoryManagementSystem/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /InventoryManagementSystem/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /InventoryManagementSystem/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mggacm/InventoryManagementSystem/7101a28ba9b56a8ef6f3f6a2a63684a58f02a093/InventoryManagementSystem/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /InventoryManagementSystem/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Banner Page.jpg](https://s13.postimg.org/6ca95xujb/Capture1.png)](https://postimg.org/image/fmvptj4mj/) 2 | 3 | InventoryManagementSystem is an MVC service web application with database read and write functionality, user purchase logging using Entity Framework. The scope of the application was a basic store management system where anyone could create items. This app was used to solve common MVC problems inlcuding displaying unique data gathered from a database into various views using Razor syntax, and assigning departments customers, purchases. 4 | 5 | ## Libraries and Resources Used 6 | 7 | - [Contoso University](https://docs.microsoft.com/en-us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application) - A great MVC 5 and Entity Framework sample project / walkthrough 8 | 9 | 10 | 11 | ## How to run locally 12 | 13 | 1. Clone the repo 14 | 15 | 2. Open the project and set up Home/Index as the start up file in not already 16 | 17 | 3. Start running the application. 18 | 19 | 4. Regester and create a customer and work left to right on the nav bar creating new items in each list. 20 | 21 | 6. When it is populated it should be a basic management system. 22 | --------------------------------------------------------------------------------