From c424f0816a5f785047d8ca087e147e21ca5f7488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Ca=C3=B1izares=20Est=C3=A9vez?= Date: Fri, 21 Oct 2016 05:46:30 +0200 Subject: [PATCH] Web MVC site UI apperance --- .gitignore | 2 + docker-compose.yml | 8 +- .../WebMVC/Controllers/AccountController.cs | 19 +- src/Web/WebMVC/Controllers/HomeController.cs | 32 +- .../WebMVC/Controllers/ManageController.cs | 39 +- src/Web/WebMVC/Controllers/OrderController.cs | 35 + .../20161019122215_Init_Scheme.Designer.cs} | 40 +- .../20161019122215_Init_Scheme.cs} | 24 +- .../20161020101725_extendProfile.Designer.cs | 246 +++ .../20161020101725_extendProfile.cs | 33 + .../ApplicationDbContextModelSnapshot.cs | 40 +- .../AccountViewModels/RegisterViewModel.cs | 2 + src/Web/WebMVC/Models/Address.cs | 2 +- src/Web/WebMVC/Models/ApplicationUser.cs | 19 + .../Models/HomeViewModels/IndexViewModel.cs | 17 + .../Models/ManageViewModels/IndexViewModel.cs | 2 + src/Web/WebMVC/Models/Order.cs | 5 +- src/Web/WebMVC/Models/PaymentInfo.cs | 24 + src/Web/WebMVC/Properties/launchSettings.json | 2 +- src/Web/WebMVC/Services/CartService.cs | 41 + src/Web/WebMVC/Services/CatalogService.cs | 33 + src/Web/WebMVC/Services/ICartService.cs | 16 + src/Web/WebMVC/Services/ICatalogService.cs | 14 + src/Web/WebMVC/Services/IOrderingService.cs | 15 + src/Web/WebMVC/Services/OrderingService.cs | 43 + src/Web/WebMVC/Startup.cs | 3 + src/Web/WebMVC/ViewComponents/Cart.cs | 30 + src/Web/WebMVC/Views/Account/Login.cshtml | 98 +- src/Web/WebMVC/Views/Account/Register.cshtml | 131 +- src/Web/WebMVC/Views/Home/About.cshtml | 7 - src/Web/WebMVC/Views/Home/Contact.cshtml | 17 - src/Web/WebMVC/Views/Home/Index.cshtml | 71 +- .../WebMVC/Views/Manage/ChangePassword.cshtml | 2 +- src/Web/WebMVC/Views/Manage/Index.cshtml | 147 +- src/Web/WebMVC/Views/Order/Cart.cshtml | 54 + src/Web/WebMVC/Views/Order/Create.cshtml | 112 + src/Web/WebMVC/Views/Order/Index.cshtml | 56 + .../Shared/Components/Cart/Default.cshtml | 20 + src/Web/WebMVC/Views/Shared/_Layout.cshtml | 50 +- .../WebMVC/Views/Shared/_LoginPartial.cshtml | 13 +- src/Web/WebMVC/Views/_ViewImports.cshtml | 1 - src/Web/WebMVC/appsettings.json | 7 +- src/Web/WebMVC/project.json | 11 +- src/Web/WebMVC/web.config | 1 - src/Web/WebMVC/wwwroot/css/site.css | 519 ++++- src/Web/WebMVC/wwwroot/css/site.min.css | 2 +- src/Web/WebMVC/wwwroot/favicon.ico | Bin 32038 -> 15086 bytes .../WebMVC/wwwroot/fonts/Montserrat-Bold.eot | Bin 0 -> 29744 bytes .../WebMVC/wwwroot/fonts/Montserrat-Bold.svg | 1933 +++++++++++++++++ .../WebMVC/wwwroot/fonts/Montserrat-Bold.ttf | Bin 0 -> 29560 bytes .../WebMVC/wwwroot/fonts/Montserrat-Bold.woff | Bin 0 -> 17348 bytes .../wwwroot/fonts/Montserrat-Bold.woff2 | Bin 0 -> 12112 bytes .../wwwroot/fonts/Montserrat-Regular.eot | Bin 0 -> 29212 bytes .../wwwroot/fonts/Montserrat-Regular.svg | 1743 +++++++++++++++ .../wwwroot/fonts/Montserrat-Regular.ttf | Bin 0 -> 29016 bytes .../wwwroot/fonts/Montserrat-Regular.woff | Bin 0 -> 17284 bytes .../wwwroot/fonts/Montserrat-Regular.woff2 | Bin 0 -> 12080 bytes src/Web/WebMVC/wwwroot/images/arrow-down.png | Bin 0 -> 1045 bytes src/Web/WebMVC/wwwroot/images/brand.PNG | Bin 0 -> 5225 bytes src/Web/WebMVC/wwwroot/images/brand_dark.PNG | Bin 0 -> 5239 bytes src/Web/WebMVC/wwwroot/images/cart.png | Bin 0 -> 1532 bytes src/Web/WebMVC/wwwroot/images/main_banner.png | Bin 0 -> 729906 bytes .../wwwroot/images/main_banner_text.png | Bin 0 -> 8828 bytes .../wwwroot/images/main_banner_text.svg | 6 + .../WebMVC/wwwroot/images/product_temp.PNG | Bin 0 -> 133397 bytes 65 files changed, 5497 insertions(+), 290 deletions(-) create mode 100644 src/Web/WebMVC/Controllers/OrderController.cs rename src/Web/WebMVC/{Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs => Migrations/20161019122215_Init_Scheme.Designer.cs} (88%) rename src/Web/WebMVC/{Data/Migrations/00000000000000_CreateIdentitySchema.cs => Migrations/20161019122215_Init_Scheme.cs} (89%) create mode 100644 src/Web/WebMVC/Migrations/20161020101725_extendProfile.Designer.cs create mode 100644 src/Web/WebMVC/Migrations/20161020101725_extendProfile.cs rename src/Web/WebMVC/{Data => }/Migrations/ApplicationDbContextModelSnapshot.cs (88%) create mode 100644 src/Web/WebMVC/Models/HomeViewModels/IndexViewModel.cs create mode 100644 src/Web/WebMVC/Models/PaymentInfo.cs create mode 100644 src/Web/WebMVC/Services/CartService.cs create mode 100644 src/Web/WebMVC/Services/CatalogService.cs create mode 100644 src/Web/WebMVC/Services/ICartService.cs create mode 100644 src/Web/WebMVC/Services/ICatalogService.cs create mode 100644 src/Web/WebMVC/Services/IOrderingService.cs create mode 100644 src/Web/WebMVC/Services/OrderingService.cs create mode 100644 src/Web/WebMVC/ViewComponents/Cart.cs delete mode 100644 src/Web/WebMVC/Views/Home/About.cshtml delete mode 100644 src/Web/WebMVC/Views/Home/Contact.cshtml create mode 100644 src/Web/WebMVC/Views/Order/Cart.cshtml create mode 100644 src/Web/WebMVC/Views/Order/Create.cshtml create mode 100644 src/Web/WebMVC/Views/Order/Index.cshtml create mode 100644 src/Web/WebMVC/Views/Shared/Components/Cart/Default.cshtml create mode 100644 src/Web/WebMVC/wwwroot/fonts/Montserrat-Bold.eot create mode 100644 src/Web/WebMVC/wwwroot/fonts/Montserrat-Bold.svg create mode 100644 src/Web/WebMVC/wwwroot/fonts/Montserrat-Bold.ttf create mode 100644 src/Web/WebMVC/wwwroot/fonts/Montserrat-Bold.woff create mode 100644 src/Web/WebMVC/wwwroot/fonts/Montserrat-Bold.woff2 create mode 100644 src/Web/WebMVC/wwwroot/fonts/Montserrat-Regular.eot create mode 100644 src/Web/WebMVC/wwwroot/fonts/Montserrat-Regular.svg create mode 100644 src/Web/WebMVC/wwwroot/fonts/Montserrat-Regular.ttf create mode 100644 src/Web/WebMVC/wwwroot/fonts/Montserrat-Regular.woff create mode 100644 src/Web/WebMVC/wwwroot/fonts/Montserrat-Regular.woff2 create mode 100644 src/Web/WebMVC/wwwroot/images/arrow-down.png create mode 100644 src/Web/WebMVC/wwwroot/images/brand.PNG create mode 100644 src/Web/WebMVC/wwwroot/images/brand_dark.PNG create mode 100644 src/Web/WebMVC/wwwroot/images/cart.png create mode 100644 src/Web/WebMVC/wwwroot/images/main_banner.png create mode 100644 src/Web/WebMVC/wwwroot/images/main_banner_text.png create mode 100644 src/Web/WebMVC/wwwroot/images/main_banner_text.svg create mode 100644 src/Web/WebMVC/wwwroot/images/product_temp.PNG diff --git a/.gitignore b/.gitignore index 3ab113252..ae719625c 100644 --- a/.gitignore +++ b/.gitignore @@ -251,3 +251,5 @@ paket-files/ .idea/ *.sln.iml pub/ +/src/Web/WebMVC/Properties/PublishProfiles/eShopOnContainersWebMVC2016 - Web Deploy-publish.ps1 +/src/Web/WebMVC/Properties/PublishProfiles/publish-module.psm1 diff --git a/docker-compose.yml b/docker-compose.yml index f78a08fdb..93c8c9347 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: - CatalogUrl=http://catalog.api - OrderingUrl=http://ordering.api ports: - - "80:80" + - "800:80" depends_on: - catalog.api @@ -31,10 +31,10 @@ services: - "81:80" # (Go to Production): For secured/final deployment, remove Ports mapping and # leave just the internal expose section -# expose: -# - "80" + expose: + - "800" extra_hosts: - - "CESARDLBOOKVHD:10.0.75.1" + - "DESKTOP-1HNACCH:192.168.1.39" depends_on: - ordering.data diff --git a/src/Web/WebMVC/Controllers/AccountController.cs b/src/Web/WebMVC/Controllers/AccountController.cs index 402a87e10..f48b6e884 100644 --- a/src/Web/WebMVC/Controllers/AccountController.cs +++ b/src/Web/WebMVC/Controllers/AccountController.cs @@ -105,7 +105,24 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers ViewData["ReturnUrl"] = returnUrl; if (ModelState.IsValid) { - var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; + var user = new ApplicationUser + { + UserName = model.Email, + Email = model.Email, + CardHolderName = model.User.CardHolderName, + CardNumber = model.User.CardNumber, + CardType = model.User.CardType, + City = model.User.City, + Country = model.User.Country, + Expiration = model.User.Expiration, + LastName = model.User.LastName, + Name = model.User.Name, + Street = model.User.Street, + State = model.User.State, + ZipCode = model.User.ZipCode, + PhoneNumber = model.User.PhoneNumber, + SecurityNumber = model.User.SecurityNumber + }; var result = await _userManager.CreateAsync(user, model.Password); if (result.Succeeded) { diff --git a/src/Web/WebMVC/Controllers/HomeController.cs b/src/Web/WebMVC/Controllers/HomeController.cs index e92eb1f37..402243dae 100644 --- a/src/Web/WebMVC/Controllers/HomeController.cs +++ b/src/Web/WebMVC/Controllers/HomeController.cs @@ -7,6 +7,8 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.eShopOnContainers.WebMVC.Models; using Microsoft.Extensions.Options; using Newtonsoft.Json; +using Microsoft.eShopOnContainers.WebMVC.Services; +using Microsoft.eShopOnContainers.WebMVC.Models.HomeViewModels; namespace Microsoft.eShopOnContainers.WebMVC.Controllers { @@ -14,31 +16,25 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers { private HttpClient _http; private AppSettings _settings; + private ICatalogService _catalogSvc; - public HomeController(IOptions options) + public HomeController(IOptions options, ICatalogService catalogSvc) { _http = new HttpClient(); _settings = options.Value; + _catalogSvc = catalogSvc; } public async Task Index() { - var dataString = await _http.GetStringAsync(_settings.CatalogUrl); - var items = JsonConvert.DeserializeObject>(dataString); - return View(items); - } - - public IActionResult About() - { - ViewData["Message"] = "Your application description page."; - - return View(); - } - - public IActionResult Contact() - { - ViewData["Message"] = "Your contact page."; - - return View(); + //var dataString = await _http.GetStringAsync(_settings.CatalogUrl); + //var items = JsonConvert.DeserializeObject>(dataString); + //items.AddRange(items); + var items = await _catalogSvc.GetCatalogItems(); + var vm = new IndexViewModel() + { + CatalogItems = items + }; + return View(vm); } public async Task Orders() diff --git a/src/Web/WebMVC/Controllers/ManageController.cs b/src/Web/WebMVC/Controllers/ManageController.cs index 645890327..a8b629c9b 100644 --- a/src/Web/WebMVC/Controllers/ManageController.cs +++ b/src/Web/WebMVC/Controllers/ManageController.cs @@ -60,11 +60,45 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers PhoneNumber = await _userManager.GetPhoneNumberAsync(user), TwoFactor = await _userManager.GetTwoFactorEnabledAsync(user), Logins = await _userManager.GetLoginsAsync(user), - BrowserRemembered = await _signInManager.IsTwoFactorClientRememberedAsync(user) + BrowserRemembered = await _signInManager.IsTwoFactorClientRememberedAsync(user), + User = user }; return View(model); } + [HttpPost] + [ValidateAntiForgeryToken] + public async Task Index(IndexViewModel model) + { + if (!ModelState.IsValid) + { + return View(model); + } + + var user = await _userManager.GetUserAsync(HttpContext.User); + + user.CardHolderName = model.User.CardHolderName; + user.CardNumber = model.User.CardNumber; + //user.CardType = model.User.CardType; + user.City = model.User.City; + user.Country = model.User.Country; + user.Expiration = model.User.Expiration; + user.State = model.User.State; + user.Street = model.User.Street; + user.ZipCode = model.User.ZipCode; + + var result = await _userManager.UpdateAsync(user); + + if (result.Succeeded) + { + _logger.LogInformation(99, "User changed his address and payment method information."); + return RedirectToAction(nameof(Index), new { Message = ManageMessageId.ProfileUpdated }); + } + + AddErrors(result); + return View(model); + } + // // POST: /Manage/RemoveLogin [HttpPost] @@ -347,7 +381,8 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers SetPasswordSuccess, RemoveLoginSuccess, RemovePhoneSuccess, - Error + Error, + ProfileUpdated } private Task GetCurrentUserAsync() diff --git a/src/Web/WebMVC/Controllers/OrderController.cs b/src/Web/WebMVC/Controllers/OrderController.cs new file mode 100644 index 000000000..d1818d1e3 --- /dev/null +++ b/src/Web/WebMVC/Controllers/OrderController.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Microsoft.eShopOnContainers.WebMVC.Services; +using Microsoft.eShopOnContainers.WebMVC.Models; + +namespace Microsoft.eShopOnContainers.WebMVC.Controllers +{ + public class OrderController : Controller + { + private IOrderingService _orderSvc; + public OrderController(IOrderingService orderSvc) + { + _orderSvc = orderSvc; + } + + public IActionResult Cart() + { + return View(); + } + + public IActionResult Create() + { + return View(); + } + + public IActionResult Index(Order item) + { + _orderSvc.AddOrder(item); + return View(_orderSvc.GetOrders()); + } + } +} \ No newline at end of file diff --git a/src/Web/WebMVC/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs b/src/Web/WebMVC/Migrations/20161019122215_Init_Scheme.Designer.cs similarity index 88% rename from src/Web/WebMVC/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs rename to src/Web/WebMVC/Migrations/20161019122215_Init_Scheme.Designer.cs index 9887e1357..844e45dc0 100644 --- a/src/Web/WebMVC/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs +++ b/src/Web/WebMVC/Migrations/20161019122215_Init_Scheme.Designer.cs @@ -1,22 +1,20 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.eShopOnContainers.WebMVC.Data; -namespace Microsoft.eShopOnContainers.WebMVC.Data.Migrations +namespace WebMVC.Migrations { [DbContext(typeof(ApplicationDbContext))] - [Migration("00000000000000_CreateIdentitySchema")] - partial class CreateIdentitySchema + [Migration("20161019122215_Init_Scheme")] + partial class Init_Scheme { protected override void BuildTargetModel(ModelBuilder modelBuilder) { modelBuilder - .HasAnnotation("ProductVersion", "1.0.0-rc3") + .HasAnnotation("ProductVersion", "1.0.0-rtm-21431") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b => @@ -132,18 +130,36 @@ namespace Microsoft.eShopOnContainers.WebMVC.Data.Migrations b.Property("AccessFailedCount"); + b.Property("CardHolderName"); + + b.Property("CardNumber"); + + b.Property("CardType"); + + b.Property("City"); + b.Property("ConcurrencyStamp") .IsConcurrencyToken(); + b.Property("Country"); + + b.Property("CountryCode"); + b.Property("Email") .HasAnnotation("MaxLength", 256); b.Property("EmailConfirmed"); + b.Property("Expiration"); + + b.Property("Latitude"); + b.Property("LockoutEnabled"); b.Property("LockoutEnd"); + b.Property("Longitude"); + b.Property("NormalizedEmail") .HasAnnotation("MaxLength", 256); @@ -156,13 +172,23 @@ namespace Microsoft.eShopOnContainers.WebMVC.Data.Migrations b.Property("PhoneNumberConfirmed"); + b.Property("SecurityNumber"); + b.Property("SecurityStamp"); + b.Property("State"); + + b.Property("StateCode"); + + b.Property("Street"); + b.Property("TwoFactorEnabled"); b.Property("UserName") .HasAnnotation("MaxLength", 256); + b.Property("ZipCode"); + b.HasKey("Id"); b.HasIndex("NormalizedEmail") diff --git a/src/Web/WebMVC/Data/Migrations/00000000000000_CreateIdentitySchema.cs b/src/Web/WebMVC/Migrations/20161019122215_Init_Scheme.cs similarity index 89% rename from src/Web/WebMVC/Data/Migrations/00000000000000_CreateIdentitySchema.cs rename to src/Web/WebMVC/Migrations/20161019122215_Init_Scheme.cs index bdd36731f..8e9d6f205 100644 --- a/src/Web/WebMVC/Data/Migrations/00000000000000_CreateIdentitySchema.cs +++ b/src/Web/WebMVC/Migrations/20161019122215_Init_Scheme.cs @@ -1,13 +1,11 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Metadata; -namespace Microsoft.eShopOnContainers.WebMVC.Data.Migrations +namespace WebMVC.Migrations { - public partial class CreateIdentitySchema : Migration + public partial class Init_Scheme : Migration { protected override void Up(MigrationBuilder migrationBuilder) { @@ -45,19 +43,33 @@ namespace Microsoft.eShopOnContainers.WebMVC.Data.Migrations { Id = table.Column(nullable: false), AccessFailedCount = table.Column(nullable: false), + CardHolderName = table.Column(nullable: true), + CardNumber = table.Column(nullable: true), + CardType = table.Column(nullable: false), + City = table.Column(nullable: true), ConcurrencyStamp = table.Column(nullable: true), + Country = table.Column(nullable: true), + CountryCode = table.Column(nullable: true), Email = table.Column(maxLength: 256, nullable: true), EmailConfirmed = table.Column(nullable: false), + Expiration = table.Column(nullable: true), + Latitude = table.Column(nullable: false), LockoutEnabled = table.Column(nullable: false), LockoutEnd = table.Column(nullable: true), + Longitude = table.Column(nullable: false), NormalizedEmail = table.Column(maxLength: 256, nullable: true), NormalizedUserName = table.Column(maxLength: 256, nullable: true), PasswordHash = table.Column(nullable: true), PhoneNumber = table.Column(nullable: true), PhoneNumberConfirmed = table.Column(nullable: false), + SecurityNumber = table.Column(nullable: true), SecurityStamp = table.Column(nullable: true), + State = table.Column(nullable: true), + StateCode = table.Column(nullable: true), + Street = table.Column(nullable: true), TwoFactorEnabled = table.Column(nullable: false), - UserName = table.Column(maxLength: 256, nullable: true) + UserName = table.Column(maxLength: 256, nullable: true), + ZipCode = table.Column(nullable: true) }, constraints: table => { diff --git a/src/Web/WebMVC/Migrations/20161020101725_extendProfile.Designer.cs b/src/Web/WebMVC/Migrations/20161020101725_extendProfile.Designer.cs new file mode 100644 index 000000000..03cf1d7fc --- /dev/null +++ b/src/Web/WebMVC/Migrations/20161020101725_extendProfile.Designer.cs @@ -0,0 +1,246 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.eShopOnContainers.WebMVC.Data; + +namespace WebMVC.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20161020101725_extendProfile")] + partial class extendProfile + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { + modelBuilder + .HasAnnotation("ProductVersion", "1.0.0-rtm-21431") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b => + { + b.Property("Id"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Name") + .HasAnnotation("MaxLength", 256); + + b.Property("NormalizedName") + .HasAnnotation("MaxLength", 256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .HasName("RoleNameIndex"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("RoleId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => + { + b.Property("LoginProvider"); + + b.Property("ProviderKey"); + + b.Property("ProviderDisplayName"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => + { + b.Property("UserId"); + + b.Property("RoleId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken", b => + { + b.Property("UserId"); + + b.Property("LoginProvider"); + + b.Property("Name"); + + b.Property("Value"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("Microsoft.eShopOnContainers.WebMVC.Models.ApplicationUser", b => + { + b.Property("Id"); + + b.Property("AccessFailedCount"); + + b.Property("CardHolderName"); + + b.Property("CardNumber"); + + b.Property("CardType"); + + b.Property("City"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Country"); + + b.Property("CountryCode"); + + b.Property("Email") + .HasAnnotation("MaxLength", 256); + + b.Property("EmailConfirmed"); + + b.Property("Expiration"); + + b.Property("LastName"); + + b.Property("Latitude"); + + b.Property("LockoutEnabled"); + + b.Property("LockoutEnd"); + + b.Property("Longitude"); + + b.Property("Name"); + + b.Property("NormalizedEmail") + .HasAnnotation("MaxLength", 256); + + b.Property("NormalizedUserName") + .HasAnnotation("MaxLength", 256); + + b.Property("PasswordHash"); + + b.Property("PhoneNumber"); + + b.Property("PhoneNumberConfirmed"); + + b.Property("SecurityNumber"); + + b.Property("SecurityStamp"); + + b.Property("State"); + + b.Property("StateCode"); + + b.Property("Street"); + + b.Property("TwoFactorEnabled"); + + b.Property("UserName") + .HasAnnotation("MaxLength", 256); + + b.Property("ZipCode"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => + { + b.HasOne("Microsoft.eShopOnContainers.WebMVC.Models.ApplicationUser") + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => + { + b.HasOne("Microsoft.eShopOnContainers.WebMVC.Models.ApplicationUser") + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Microsoft.eShopOnContainers.WebMVC.Models.ApplicationUser") + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + } + } +} diff --git a/src/Web/WebMVC/Migrations/20161020101725_extendProfile.cs b/src/Web/WebMVC/Migrations/20161020101725_extendProfile.cs new file mode 100644 index 000000000..46dfceb9a --- /dev/null +++ b/src/Web/WebMVC/Migrations/20161020101725_extendProfile.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace WebMVC.Migrations +{ + public partial class extendProfile : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "LastName", + table: "AspNetUsers", + nullable: true); + + migrationBuilder.AddColumn( + name: "Name", + table: "AspNetUsers", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "LastName", + table: "AspNetUsers"); + + migrationBuilder.DropColumn( + name: "Name", + table: "AspNetUsers"); + } + } +} diff --git a/src/Web/WebMVC/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/src/Web/WebMVC/Migrations/ApplicationDbContextModelSnapshot.cs similarity index 88% rename from src/Web/WebMVC/Data/Migrations/ApplicationDbContextModelSnapshot.cs rename to src/Web/WebMVC/Migrations/ApplicationDbContextModelSnapshot.cs index 62708ab26..9a1bcadde 100644 --- a/src/Web/WebMVC/Data/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/src/Web/WebMVC/Migrations/ApplicationDbContextModelSnapshot.cs @@ -1,13 +1,11 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.eShopOnContainers.WebMVC.Data; -namespace Microsoft.eShopOnContainers.WebMVC.Data.Migrations +namespace WebMVC.Migrations { [DbContext(typeof(ApplicationDbContext))] partial class ApplicationDbContextModelSnapshot : ModelSnapshot @@ -15,7 +13,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Data.Migrations protected override void BuildModel(ModelBuilder modelBuilder) { modelBuilder - .HasAnnotation("ProductVersion", "1.0.0-rc3") + .HasAnnotation("ProductVersion", "1.0.0-rtm-21431") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b => @@ -131,18 +129,40 @@ namespace Microsoft.eShopOnContainers.WebMVC.Data.Migrations b.Property("AccessFailedCount"); + b.Property("CardHolderName"); + + b.Property("CardNumber"); + + b.Property("CardType"); + + b.Property("City"); + b.Property("ConcurrencyStamp") .IsConcurrencyToken(); + b.Property("Country"); + + b.Property("CountryCode"); + b.Property("Email") .HasAnnotation("MaxLength", 256); b.Property("EmailConfirmed"); + b.Property("Expiration"); + + b.Property("LastName"); + + b.Property("Latitude"); + b.Property("LockoutEnabled"); b.Property("LockoutEnd"); + b.Property("Longitude"); + + b.Property("Name"); + b.Property("NormalizedEmail") .HasAnnotation("MaxLength", 256); @@ -155,13 +175,23 @@ namespace Microsoft.eShopOnContainers.WebMVC.Data.Migrations b.Property("PhoneNumberConfirmed"); + b.Property("SecurityNumber"); + b.Property("SecurityStamp"); + b.Property("State"); + + b.Property("StateCode"); + + b.Property("Street"); + b.Property("TwoFactorEnabled"); b.Property("UserName") .HasAnnotation("MaxLength", 256); + b.Property("ZipCode"); + b.HasKey("Id"); b.HasIndex("NormalizedEmail") diff --git a/src/Web/WebMVC/Models/AccountViewModels/RegisterViewModel.cs b/src/Web/WebMVC/Models/AccountViewModels/RegisterViewModel.cs index 77127d86b..4c863b652 100644 --- a/src/Web/WebMVC/Models/AccountViewModels/RegisterViewModel.cs +++ b/src/Web/WebMVC/Models/AccountViewModels/RegisterViewModel.cs @@ -23,5 +23,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Models.AccountViewModels [Display(Name = "Confirm password")] [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] public string ConfirmPassword { get; set; } + + public ApplicationUser User { get; set; } } } diff --git a/src/Web/WebMVC/Models/Address.cs b/src/Web/WebMVC/Models/Address.cs index 268279aa0..c1f542b20 100644 --- a/src/Web/WebMVC/Models/Address.cs +++ b/src/Web/WebMVC/Models/Address.cs @@ -7,7 +7,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Models { public class Address { - public Guid ID { get; set; } + public Guid Id { get; set; } public string Street { get; set; } public string City { get; set; } public string State { get; set; } diff --git a/src/Web/WebMVC/Models/ApplicationUser.cs b/src/Web/WebMVC/Models/ApplicationUser.cs index ba6a2914a..7a27e7084 100644 --- a/src/Web/WebMVC/Models/ApplicationUser.cs +++ b/src/Web/WebMVC/Models/ApplicationUser.cs @@ -3,11 +3,30 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; namespace Microsoft.eShopOnContainers.WebMVC.Models { // Add profile data for application users by adding properties to the ApplicationUser class public class ApplicationUser : IdentityUser { + public string CardNumber { get; set; } + public string SecurityNumber { get; set; } + public string Expiration { get; set; } + public string CardHolderName { get; set; } + public int CardType { get; set; } + public string Street { get; set; } + public string City { get; set; } + public string State { get; set; } + public string StateCode { get; set; } + public string Country { get; set; } + public string CountryCode { get; set; } + public string ZipCode { get; set; } + public double Latitude { get; set; } + public double Longitude { get; set; } + [Required] + public string Name { get; set; } + [Required] + public string LastName { get; set; } } } diff --git a/src/Web/WebMVC/Models/HomeViewModels/IndexViewModel.cs b/src/Web/WebMVC/Models/HomeViewModels/IndexViewModel.cs new file mode 100644 index 000000000..f5ba57dad --- /dev/null +++ b/src/Web/WebMVC/Models/HomeViewModels/IndexViewModel.cs @@ -0,0 +1,17 @@ +using Microsoft.AspNetCore.Mvc.Rendering; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.eShopOnContainers.WebMVC.Models.HomeViewModels +{ + public class IndexViewModel + { + public IEnumerable CatalogItems { get; set; } + public IEnumerable Brands { get; set; } + public IEnumerable Types { get; set; } + public int BrandFilterApplied { get; set; } + public int TypesFilterApplied { get; set; } + } +} diff --git a/src/Web/WebMVC/Models/ManageViewModels/IndexViewModel.cs b/src/Web/WebMVC/Models/ManageViewModels/IndexViewModel.cs index 33771c140..87091c61c 100644 --- a/src/Web/WebMVC/Models/ManageViewModels/IndexViewModel.cs +++ b/src/Web/WebMVC/Models/ManageViewModels/IndexViewModel.cs @@ -17,5 +17,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Models.ManageViewModels public bool TwoFactor { get; set; } public bool BrowserRemembered { get; set; } + + public ApplicationUser User { get; set; } } } diff --git a/src/Web/WebMVC/Models/Order.cs b/src/Web/WebMVC/Models/Order.cs index 9d0e6d1cc..d10b9ab1e 100644 --- a/src/Web/WebMVC/Models/Order.cs +++ b/src/Web/WebMVC/Models/Order.cs @@ -19,11 +19,10 @@ namespace Microsoft.eShopOnContainers.WebMVC.Models public int SequenceNumber { get; set; } public virtual Guid BuyerId { get; set; } public virtual Address ShippingAddress { get; set; } - public virtual Address BillingAddress { get; set; } + public virtual DateTime OrderDate { get; set; } + //(CCE) public virtual Address BillingAddress { get; set; } //(CDLTLL) public virtual OrderStatus Status { get; set; } - - } } diff --git a/src/Web/WebMVC/Models/PaymentInfo.cs b/src/Web/WebMVC/Models/PaymentInfo.cs new file mode 100644 index 000000000..2f840b38d --- /dev/null +++ b/src/Web/WebMVC/Models/PaymentInfo.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.eShopOnContainers.WebMVC.Models +{ + public class PaymentInfo + { + public Guid Id { get; set; } + public string CardNumber {get;set;} + public string SecurityNumber { get; set; } + public int ExpirationMonth { get; set; } + public int ExpirationYear { get; set; } + public string CardHolderName { get; set; } + public CardType CardType { get; set; } + } + + public enum CardType:int + { + AMEX, + VISA + } +} diff --git a/src/Web/WebMVC/Properties/launchSettings.json b/src/Web/WebMVC/Properties/launchSettings.json index 1078a2bf0..2cbe5bbbd 100644 --- a/src/Web/WebMVC/Properties/launchSettings.json +++ b/src/Web/WebMVC/Properties/launchSettings.json @@ -3,7 +3,7 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:2113/", + "applicationUrl": "http://localhost:2114/", "sslPort": 0 } }, diff --git a/src/Web/WebMVC/Services/CartService.cs b/src/Web/WebMVC/Services/CartService.cs new file mode 100644 index 000000000..aeb59cfaa --- /dev/null +++ b/src/Web/WebMVC/Services/CartService.cs @@ -0,0 +1,41 @@ +using System; +using System.Threading.Tasks; +using Microsoft.eShopOnContainers.WebMVC.Models; + +namespace Microsoft.eShopOnContainers.WebMVC.Services +{ + public class CartService : ICartService + { + Order _order; + + public CartService() + { + _order = new Order(); + _order.OrderItems = new System.Collections.Generic.List(); + _order.OrderItems.Add(new OrderItem() + { + ProductName = "Cart product" + }); + } + + public void AddItemToOrder(CatalogItem item) + { + throw new NotImplementedException(); + } + + public int GetItemCountFromOrderInProgress() + { + throw new NotImplementedException(); + } + + public Task GetOrderInProgress() + { + return Task.Run(() => { return _order; }); + } + + public void RemoveItemFromOrder(Guid itemIdentifier) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/Web/WebMVC/Services/CatalogService.cs b/src/Web/WebMVC/Services/CatalogService.cs new file mode 100644 index 000000000..0a600747e --- /dev/null +++ b/src/Web/WebMVC/Services/CatalogService.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.eShopOnContainers.WebMVC.Models; + +namespace Microsoft.eShopOnContainers.WebMVC.Services +{ + public class CatalogService : ICatalogService + { + List _items; + + public CatalogService() { + _items = new List() + { + new CatalogItem() { Id = Guid.NewGuid(), Description = "Roslyn Red T-Shirt", Name = "Roslyn Red T-Shirt", Price = 12 }, + new CatalogItem() { Id = Guid.NewGuid(), Description = "Cupt Black & White Mug", Name = "Cupt Black & White Mug", Price= 17 }, + new CatalogItem() { Id = Guid.NewGuid(), Description = "Prism White T-Shirt", Name = "Prism White T-Shirt", Price = 12 }, + new CatalogItem() { Id = Guid.NewGuid(), Description = ".NET Bot Black Sweatshirt", Name = ".NET Bot Black Sweatshirt", Price = decimal.Parse("19.5") } + }; + } + + public CatalogItem GetCatalogItem(Guid Id) + { + return _items.Where(x => x.Id == Id).FirstOrDefault(); + } + + public Task> GetCatalogItems() + { + return Task.Run(() => { return _items; }); + } + } +} diff --git a/src/Web/WebMVC/Services/ICartService.cs b/src/Web/WebMVC/Services/ICartService.cs new file mode 100644 index 000000000..233dea570 --- /dev/null +++ b/src/Web/WebMVC/Services/ICartService.cs @@ -0,0 +1,16 @@ +using Microsoft.eShopOnContainers.WebMVC.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.eShopOnContainers.WebMVC.Services +{ + public interface ICartService + { + void AddItemToOrder(CatalogItem item); + void RemoveItemFromOrder(Guid itemIdentifier); + int GetItemCountFromOrderInProgress(); + Task GetOrderInProgress(); + } +} diff --git a/src/Web/WebMVC/Services/ICatalogService.cs b/src/Web/WebMVC/Services/ICatalogService.cs new file mode 100644 index 000000000..bf6b90ff7 --- /dev/null +++ b/src/Web/WebMVC/Services/ICatalogService.cs @@ -0,0 +1,14 @@ +using Microsoft.eShopOnContainers.WebMVC.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.eShopOnContainers.WebMVC.Services +{ + public interface ICatalogService + { + Task> GetCatalogItems(); + CatalogItem GetCatalogItem(Guid Id); + } +} diff --git a/src/Web/WebMVC/Services/IOrderingService.cs b/src/Web/WebMVC/Services/IOrderingService.cs new file mode 100644 index 000000000..b637847f5 --- /dev/null +++ b/src/Web/WebMVC/Services/IOrderingService.cs @@ -0,0 +1,15 @@ +using Microsoft.eShopOnContainers.WebMVC.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.eShopOnContainers.WebMVC.Services +{ + public interface IOrderingService + { + List GetOrders(); + Order GetOrder(Guid Id); + void AddOrder(Order Order); + } +} diff --git a/src/Web/WebMVC/Services/OrderingService.cs b/src/Web/WebMVC/Services/OrderingService.cs new file mode 100644 index 000000000..06ae93b1d --- /dev/null +++ b/src/Web/WebMVC/Services/OrderingService.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.eShopOnContainers.WebMVC.Models; + +namespace Microsoft.eShopOnContainers.WebMVC.Services +{ + public class OrderingService : IOrderingService + { + private List _orders; + + public OrderingService() + { + _orders = new List() + { + new Order() + { + BuyerId = Guid.NewGuid(), OrderDate = DateTime.Now, + OrderItems = new List() + { + new OrderItem() { UnitPrice = 12 } + } + } + }; + } + + public void AddOrder(Order Order) + { + _orders.Add(Order); + } + + public Order GetOrder(Guid Id) + { + return _orders.Where(x => x.BuyerId == Id).FirstOrDefault(); + } + + public List GetOrders() + { + return _orders; + } + } +} diff --git a/src/Web/WebMVC/Startup.cs b/src/Web/WebMVC/Startup.cs index e9ff825aa..dbf614716 100644 --- a/src/Web/WebMVC/Startup.cs +++ b/src/Web/WebMVC/Startup.cs @@ -52,6 +52,9 @@ namespace Microsoft.eShopOnContainers.WebMVC // Add application services. services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.Configure(Configuration); } diff --git a/src/Web/WebMVC/ViewComponents/Cart.cs b/src/Web/WebMVC/ViewComponents/Cart.cs new file mode 100644 index 000000000..dd59738bf --- /dev/null +++ b/src/Web/WebMVC/ViewComponents/Cart.cs @@ -0,0 +1,30 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.eShopOnContainers.WebMVC.Models; +using Microsoft.eShopOnContainers.WebMVC.Services; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.eShopOnContainers.WebMVC.ViewComponents +{ + public class Cart : ViewComponent + { + private readonly ICartService _cartSvc; + + public Cart(ICartService cartSvc) + { + _cartSvc = cartSvc; + } + + public async Task InvokeAsync() + { + var item = await GetItemsAsync(); + return View(item); + } + private Task GetItemsAsync() + { + return _cartSvc.GetOrderInProgress(); + } + } +} diff --git a/src/Web/WebMVC/Views/Account/Login.cshtml b/src/Web/WebMVC/Views/Account/Login.cshtml index d80381934..480b0a4ef 100644 --- a/src/Web/WebMVC/Views/Account/Login.cshtml +++ b/src/Web/WebMVC/Views/Account/Login.cshtml @@ -7,83 +7,49 @@ @{ ViewData["Title"] = "Log in"; } - -

@ViewData["Title"].

-
-
-
-
-

Use a local account to log in.

-
-
-
- -
- +
+ +
+
-
-
-
-

Use another service to log in.

-
- @{ - var loginProviders = SignInManager.GetExternalAuthenticationSchemes().ToList(); - if (loginProviders.Count == 0) - { -
-

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

-
- } - else - { -
-
-

- @foreach (var provider in loginProviders) - { - - } -

-
-
- } - } -
+

+ Register as a new user? +

+

+ @*Forgot your password?*@ +

+ + +
diff --git a/src/Web/WebMVC/Views/Account/Register.cshtml b/src/Web/WebMVC/Views/Account/Register.cshtml index dad5ea2fb..a4f5cbbb9 100644 --- a/src/Web/WebMVC/Views/Account/Register.cshtml +++ b/src/Web/WebMVC/Views/Account/Register.cshtml @@ -2,41 +2,106 @@ @{ ViewData["Title"] = "Register"; } - -

@ViewData["Title"].

- -
-

Create a new account.

-
-
-
- -
- - -
-
-
- -
- - +
+ +
+
+ @*

@ViewData["Title"].

*@ +

CREATE NEW ACCOUNT

+ + @*
*@ +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
-
-
- -
- - +

+
+
+ + + +
+
+
+ + + +
+
+ + + +
+
+

+
+
-
-
-
- -
-
- - +

+ +
@section Scripts { @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } } + diff --git a/src/Web/WebMVC/Views/Home/About.cshtml b/src/Web/WebMVC/Views/Home/About.cshtml deleted file mode 100644 index 50476d1fb..000000000 --- a/src/Web/WebMVC/Views/Home/About.cshtml +++ /dev/null @@ -1,7 +0,0 @@ -@{ - ViewData["Title"] = "About"; -} -

@ViewData["Title"].

-

@ViewData["Message"]

- -

Use this area to provide additional information.

diff --git a/src/Web/WebMVC/Views/Home/Contact.cshtml b/src/Web/WebMVC/Views/Home/Contact.cshtml deleted file mode 100644 index 15c12c6d1..000000000 --- a/src/Web/WebMVC/Views/Home/Contact.cshtml +++ /dev/null @@ -1,17 +0,0 @@ -@{ - ViewData["Title"] = "Contact"; -} -

@ViewData["Title"].

-

@ViewData["Message"]

- -
- One Microsoft Way
- Redmond, WA 98052-6399
- P: - 425.555.0100 -
- -
- Support: Support@example.com
- Marketing: Marketing@example.com -
diff --git a/src/Web/WebMVC/Views/Home/Index.cshtml b/src/Web/WebMVC/Views/Home/Index.cshtml index e2bf357e5..792599621 100644 --- a/src/Web/WebMVC/Views/Home/Index.cshtml +++ b/src/Web/WebMVC/Views/Home/Index.cshtml @@ -1,16 +1,67 @@ @{ ViewData["Title"] = "Home Page"; - @model IEnumerable + @model Microsoft.eShopOnContainers.WebMVC.Models.HomeViewModels.IndexViewModel } -@foreach (var catalogItem in Model) -{ -
-
-

@catalogItem.Name

-
-
- @catalogItem.Description +
+
+
+
+ +
+
+ @* + *@ +
+ + +
+
+ + +
+ + APPLY +
-} \ No newline at end of file +
+ +
+
+ @foreach (var catalogItem in Model.CatalogItems) + { +
+ +
+ @catalogItem.Name +
+
+ @catalogItem.Price.ToString("N2") +
+
+ } +
+
+ diff --git a/src/Web/WebMVC/Views/Manage/ChangePassword.cshtml b/src/Web/WebMVC/Views/Manage/ChangePassword.cshtml index d19ef1dd0..6f2e79d3f 100644 --- a/src/Web/WebMVC/Views/Manage/ChangePassword.cshtml +++ b/src/Web/WebMVC/Views/Manage/ChangePassword.cshtml @@ -3,7 +3,7 @@ ViewData["Title"] = "Change Password"; } -

@ViewData["Title"].

+

Change Password Form

diff --git a/src/Web/WebMVC/Views/Manage/Index.cshtml b/src/Web/WebMVC/Views/Manage/Index.cshtml index 9882d1445..3ac7148a8 100644 --- a/src/Web/WebMVC/Views/Manage/Index.cshtml +++ b/src/Web/WebMVC/Views/Manage/Index.cshtml @@ -3,69 +3,98 @@ ViewData["Title"] = "Manage your account"; } -

@ViewData["Title"].

+@*

@ViewData["Title"].

*@

@ViewData["StatusMessage"]

- -
-

Change your account settings

-
-
-
Password:
-
- @if (Model.HasPassword) - { - Change - } - else - { - Create - } -
-
External Logins:
-
- - @Model.Logins.Count Manage -
-
Phone Number:
-
-

- Phone Numbers can used as a second factor of verification in two-factor authentication. - See this article - for details on setting up this ASP.NET application to support two-factor authentication using SMS. -

- @*@(Model.PhoneNumber ?? "None") - @if (Model.PhoneNumber != null) +
+ +
+
+ +
+
+ +
+
+

SHIPPING ADDRESS

+
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+

+
+

PAYMENT METHOD

+
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+
+

+

Change your account settings

+
+
+ +
+ @if (Model.HasPassword) { -
- Change - - [] - + Change } else { - Add - }*@ -
- -
Two-Factor Authentication:
-
-

- There are no two-factor authentication providers configured. See this article - for setting up this application to support two-factor authentication. -

- @*@if (Model.TwoFactor) - { -
- Enabled -
+ Create } - else - { -
- Disabled -
- }*@ -
-
+
+
+

+
+
+ +
+
+

+
+ + diff --git a/src/Web/WebMVC/Views/Order/Cart.cshtml b/src/Web/WebMVC/Views/Order/Cart.cshtml new file mode 100644 index 000000000..afbb48436 --- /dev/null +++ b/src/Web/WebMVC/Views/Order/Cart.cshtml @@ -0,0 +1,54 @@ +@model Microsoft.eShopOnContainers.WebMVC.Models.Order + +@{ + ViewData["Title"] = "My Cart"; +} + +
+ +
+
+
+ +



+
+
+ + + + + + + + + + + + + @await Component.InvokeAsync("Cart") + +
+ PRODUCT + + + + BRAND + + PRICE + + QUANTITY + + FINAL PRICE +
+
+
+





+ +
+
diff --git a/src/Web/WebMVC/Views/Order/Create.cshtml b/src/Web/WebMVC/Views/Order/Create.cshtml new file mode 100644 index 000000000..599888589 --- /dev/null +++ b/src/Web/WebMVC/Views/Order/Create.cshtml @@ -0,0 +1,112 @@ +@model Microsoft.eShopOnContainers.WebMVC.Models.Order + +@{ + ViewData["Title"] = "View"; +} +
+ +
+
+
+

SHIPPING ADDRESS

+
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+

+
+

PAYMENT METHOD

+
+
+ + + +
+
+ + + +
+
+
+
+ + + +
+
+ + + +
+
+
+

+
+
+ + + + + + + + + + + + + @await Component.InvokeAsync("Cart") + +
+ PRODUCT + + + + BRAND + + PRICE + + QUANTITY + + FINAL PRICE +
+
+
+





+
+
+ @**@ + [ PLACE ORDER ] +
+
+





+
+
+@section Scripts { + @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} +} diff --git a/src/Web/WebMVC/Views/Order/Index.cshtml b/src/Web/WebMVC/Views/Order/Index.cshtml new file mode 100644 index 000000000..a98239f36 --- /dev/null +++ b/src/Web/WebMVC/Views/Order/Index.cshtml @@ -0,0 +1,56 @@ +@model IEnumerable + +@{ + ViewData["Title"] = "View"; +} +
+ +
+
+ + + + + + + + + + + + @foreach (var item in Model) { + + + + + + + + } + +
+ @Html.DisplayNameFor(model => model.OrderNumber) + + @Html.DisplayNameFor(model => model.OrderDate) + @*@Html.DisplayNameFor(model => model.SequenceNumber)*@ + + @Html.DisplayNameFor(model => model.BuyerId) + + @Html.DisplayNameFor(model => model.OrderDate) +
+ @Html.DisplayFor(modelItem => item.OrderNumber) + + @Html.DisplayFor(modelItem => item.OrderDate) + @*@Html.DisplayFor(modelItem => item.SequenceNumber)*@ + + @Html.DisplayFor(modelItem => item.BuyerId) + + @Html.DisplayFor(modelItem => item.OrderDate) + + @Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) | + @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) | + @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ }) +
+
\ No newline at end of file diff --git a/src/Web/WebMVC/Views/Shared/Components/Cart/Default.cshtml b/src/Web/WebMVC/Views/Shared/Components/Cart/Default.cshtml new file mode 100644 index 000000000..ccd1a7f7f --- /dev/null +++ b/src/Web/WebMVC/Views/Shared/Components/Cart/Default.cshtml @@ -0,0 +1,20 @@ +@model Microsoft.eShopOnContainers.WebMVC.Models.Order + +@{ + ViewData["Title"] = "My Cart"; +} + +@foreach (var item in Model.OrderItems) +{ + + @*image*@ + @item.ProductName + ROSLYN + $ @item.UnitPrice + @item.Quantity + $ @item.Quantity * @item.UnitPrice + +} + + + diff --git a/src/Web/WebMVC/Views/Shared/_Layout.cshtml b/src/Web/WebMVC/Views/Shared/_Layout.cshtml index 45247c70f..ab274a9ad 100644 --- a/src/Web/WebMVC/Views/Shared/_Layout.cshtml +++ b/src/Web/WebMVC/Views/Shared/_Layout.cshtml @@ -19,31 +19,41 @@