@ -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()); | |||
} | |||
} | |||
} |
@ -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<string>("Id"); | |||
b.Property<string>("ConcurrencyStamp") | |||
.IsConcurrencyToken(); | |||
b.Property<string>("Name") | |||
.HasAnnotation("MaxLength", 256); | |||
b.Property<string>("NormalizedName") | |||
.HasAnnotation("MaxLength", 256); | |||
b.HasKey("Id"); | |||
b.HasIndex("NormalizedName") | |||
.HasName("RoleNameIndex"); | |||
b.ToTable("AspNetRoles"); | |||
}); | |||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b => | |||
{ | |||
b.Property<int>("Id") | |||
.ValueGeneratedOnAdd(); | |||
b.Property<string>("ClaimType"); | |||
b.Property<string>("ClaimValue"); | |||
b.Property<string>("RoleId") | |||
.IsRequired(); | |||
b.HasKey("Id"); | |||
b.HasIndex("RoleId"); | |||
b.ToTable("AspNetRoleClaims"); | |||
}); | |||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b => | |||
{ | |||
b.Property<int>("Id") | |||
.ValueGeneratedOnAdd(); | |||
b.Property<string>("ClaimType"); | |||
b.Property<string>("ClaimValue"); | |||
b.Property<string>("UserId") | |||
.IsRequired(); | |||
b.HasKey("Id"); | |||
b.HasIndex("UserId"); | |||
b.ToTable("AspNetUserClaims"); | |||
}); | |||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b => | |||
{ | |||
b.Property<string>("LoginProvider"); | |||
b.Property<string>("ProviderKey"); | |||
b.Property<string>("ProviderDisplayName"); | |||
b.Property<string>("UserId") | |||
.IsRequired(); | |||
b.HasKey("LoginProvider", "ProviderKey"); | |||
b.HasIndex("UserId"); | |||
b.ToTable("AspNetUserLogins"); | |||
}); | |||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b => | |||
{ | |||
b.Property<string>("UserId"); | |||
b.Property<string>("RoleId"); | |||
b.HasKey("UserId", "RoleId"); | |||
b.HasIndex("RoleId"); | |||
b.HasIndex("UserId"); | |||
b.ToTable("AspNetUserRoles"); | |||
}); | |||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken<string>", b => | |||
{ | |||
b.Property<string>("UserId"); | |||
b.Property<string>("LoginProvider"); | |||
b.Property<string>("Name"); | |||
b.Property<string>("Value"); | |||
b.HasKey("UserId", "LoginProvider", "Name"); | |||
b.ToTable("AspNetUserTokens"); | |||
}); | |||
modelBuilder.Entity("Microsoft.eShopOnContainers.WebMVC.Models.ApplicationUser", b => | |||
{ | |||
b.Property<string>("Id"); | |||
b.Property<int>("AccessFailedCount"); | |||
b.Property<string>("CardHolderName"); | |||
b.Property<string>("CardNumber"); | |||
b.Property<int>("CardType"); | |||
b.Property<string>("City"); | |||
b.Property<string>("ConcurrencyStamp") | |||
.IsConcurrencyToken(); | |||
b.Property<string>("Country"); | |||
b.Property<string>("CountryCode"); | |||
b.Property<string>("Email") | |||
.HasAnnotation("MaxLength", 256); | |||
b.Property<bool>("EmailConfirmed"); | |||
b.Property<string>("Expiration"); | |||
b.Property<string>("LastName"); | |||
b.Property<double>("Latitude"); | |||
b.Property<bool>("LockoutEnabled"); | |||
b.Property<DateTimeOffset?>("LockoutEnd"); | |||
b.Property<double>("Longitude"); | |||
b.Property<string>("Name"); | |||
b.Property<string>("NormalizedEmail") | |||
.HasAnnotation("MaxLength", 256); | |||
b.Property<string>("NormalizedUserName") | |||
.HasAnnotation("MaxLength", 256); | |||
b.Property<string>("PasswordHash"); | |||
b.Property<string>("PhoneNumber"); | |||
b.Property<bool>("PhoneNumberConfirmed"); | |||
b.Property<string>("SecurityNumber"); | |||
b.Property<string>("SecurityStamp"); | |||
b.Property<string>("State"); | |||
b.Property<string>("StateCode"); | |||
b.Property<string>("Street"); | |||
b.Property<bool>("TwoFactorEnabled"); | |||
b.Property<string>("UserName") | |||
.HasAnnotation("MaxLength", 256); | |||
b.Property<string>("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<string>", b => | |||
{ | |||
b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") | |||
.WithMany("Claims") | |||
.HasForeignKey("RoleId") | |||
.OnDelete(DeleteBehavior.Cascade); | |||
}); | |||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b => | |||
{ | |||
b.HasOne("Microsoft.eShopOnContainers.WebMVC.Models.ApplicationUser") | |||
.WithMany("Claims") | |||
.HasForeignKey("UserId") | |||
.OnDelete(DeleteBehavior.Cascade); | |||
}); | |||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b => | |||
{ | |||
b.HasOne("Microsoft.eShopOnContainers.WebMVC.Models.ApplicationUser") | |||
.WithMany("Logins") | |||
.HasForeignKey("UserId") | |||
.OnDelete(DeleteBehavior.Cascade); | |||
}); | |||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", 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); | |||
}); | |||
} | |||
} | |||
} |
@ -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<string>( | |||
name: "LastName", | |||
table: "AspNetUsers", | |||
nullable: true); | |||
migrationBuilder.AddColumn<string>( | |||
name: "Name", | |||
table: "AspNetUsers", | |||
nullable: true); | |||
} | |||
protected override void Down(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.DropColumn( | |||
name: "LastName", | |||
table: "AspNetUsers"); | |||
migrationBuilder.DropColumn( | |||
name: "Name", | |||
table: "AspNetUsers"); | |||
} | |||
} | |||
} |
@ -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<CatalogItem> CatalogItems { get; set; } | |||
public IEnumerable<SelectListItem> Brands { get; set; } | |||
public IEnumerable<SelectListItem> Types { get; set; } | |||
public int BrandFilterApplied { get; set; } | |||
public int TypesFilterApplied { get; set; } | |||
} | |||
} |
@ -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 | |||
} | |||
} |
@ -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<OrderItem>(); | |||
_order.OrderItems.Add(new OrderItem() | |||
{ | |||
ProductName = "Cart product" | |||
}); | |||
} | |||
public void AddItemToOrder(CatalogItem item) | |||
{ | |||
throw new NotImplementedException(); | |||
} | |||
public int GetItemCountFromOrderInProgress() | |||
{ | |||
throw new NotImplementedException(); | |||
} | |||
public Task<Order> GetOrderInProgress() | |||
{ | |||
return Task.Run(() => { return _order; }); | |||
} | |||
public void RemoveItemFromOrder(Guid itemIdentifier) | |||
{ | |||
throw new NotImplementedException(); | |||
} | |||
} | |||
} |
@ -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<CatalogItem> _items; | |||
public CatalogService() { | |||
_items = new List<CatalogItem>() | |||
{ | |||
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<List<CatalogItem>> GetCatalogItems() | |||
{ | |||
return Task.Run(() => { return _items; }); | |||
} | |||
} | |||
} |
@ -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<Order> GetOrderInProgress(); | |||
} | |||
} |
@ -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<List<CatalogItem>> GetCatalogItems(); | |||
CatalogItem GetCatalogItem(Guid Id); | |||
} | |||
} |
@ -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<Order> GetOrders(); | |||
Order GetOrder(Guid Id); | |||
void AddOrder(Order Order); | |||
} | |||
} |
@ -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<Order> _orders; | |||
public OrderingService() | |||
{ | |||
_orders = new List<Order>() | |||
{ | |||
new Order() | |||
{ | |||
BuyerId = Guid.NewGuid(), OrderDate = DateTime.Now, | |||
OrderItems = new List<OrderItem>() | |||
{ | |||
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<Order> GetOrders() | |||
{ | |||
return _orders; | |||
} | |||
} | |||
} |
@ -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<IViewComponentResult> InvokeAsync() | |||
{ | |||
var item = await GetItemsAsync(); | |||
return View(item); | |||
} | |||
private Task<Order> GetItemsAsync() | |||
{ | |||
return _cartSvc.GetOrderInProgress(); | |||
} | |||
} | |||
} |
@ -1,7 +0,0 @@ | |||
@{ | |||
ViewData["Title"] = "About"; | |||
} | |||
<h2>@ViewData["Title"].</h2> | |||
<h3>@ViewData["Message"]</h3> | |||
<p>Use this area to provide additional information.</p> |
@ -1,17 +0,0 @@ | |||
@{ | |||
ViewData["Title"] = "Contact"; | |||
} | |||
<h2>@ViewData["Title"].</h2> | |||
<h3>@ViewData["Message"]</h3> | |||
<address> | |||
One Microsoft Way<br /> | |||
Redmond, WA 98052-6399<br /> | |||
<abbr title="Phone">P:</abbr> | |||
425.555.0100 | |||
</address> | |||
<address> | |||
<strong>Support:</strong> <a href="mailto:Support@example.com">Support@example.com</a><br /> | |||
<strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a> | |||
</address> |
@ -1,16 +1,67 @@ | |||
@{ | |||
ViewData["Title"] = "Home Page"; | |||
@model IEnumerable<CatalogItem> | |||
@model Microsoft.eShopOnContainers.WebMVC.Models.HomeViewModels.IndexViewModel | |||
} | |||
@foreach (var catalogItem in Model) | |||
{ | |||
<div class="panel panel-default"> | |||
<div class="panel-heading"> | |||
<h3 class="panel-title">@catalogItem.Name</h3> | |||
</div> | |||
<div class="panel-body"> | |||
@catalogItem.Description | |||
<div class="container-fluid"> | |||
<div class="row home-banner"> | |||
<div class="container home-banner-text"><img src="~/images/main_banner_text.png" /></div> | |||
</div> | |||
<div class="home-catalog-filter-container"> | |||
<div class="container"> | |||
@*<ul class="nav navbar-nav col-sm-6 home-catalog-filter-brands"> | |||
<li><a asp-area="" asp-controller="Home" asp-action="Index" class="btn-bracketed">ALL</a></li> | |||
<li><a asp-area="" asp-controller="Home" asp-action="About" class="btn-bracketed">AZURE</a></li> | |||
<li><a asp-area="" asp-controller="Home" asp-action="Contact" class="btn-bracketed">.NET</a></li> | |||
<li><a asp-area="" asp-controller="Home" asp-action="Orders" class="btn-bracketed">LOREM</a></li> | |||
<li><a asp-area="" asp-controller="Home" asp-action="Orders" class="btn-bracketed">IPSUM</a></li> | |||
</ul> | |||
<ul class="nav navbar-nav col-sm-6 home-catalog-filter-types"> | |||
<li><a asp-area="" asp-controller="Home" asp-action="Index" class="btn-bracketed">ALL</a></li> | |||
<li><a asp-area="" asp-controller="Home" asp-action="About" class="btn-bracketed">T-SHIRT</a></li> | |||
<li><a asp-area="" asp-controller="Home" asp-action="Contact" class="btn-bracketed">STICKER</a></li> | |||
<li><a asp-area="" asp-controller="Home" asp-action="Orders" class="btn-bracketed">MUGS</a></li> | |||
<li><a asp-area="" asp-controller="Home" asp-action="Orders" class="btn-bracketed">SWEATSHIRT</a></li> | |||
</ul>*@ | |||
<div data-name="brand" class="select-filter-wrapper"> | |||
<img src="~/images/arrow-down.png" class="select-filter-arrow" /> | |||
<select asp-for="BrandFilterApplied" asp-items="Model.Brands" class="select-filter" > | |||
<option>ALL</option> | |||
</select> | |||
</div> | |||
<div data-name="type" class="select-filter-wrapper"> | |||
<img src="~/images/arrow-down.png" class="select-filter-arrow" /> | |||
<select asp-for="TypesFilterApplied" asp-items="Model.Types" class="select-filter"> | |||
<option>ALL</option> | |||
</select> | |||
</div> | |||
<a asp-area="" asp-controller="Home" asp-action="About" class="btn-brand btn-brand-small btn-brand-small-filter"> | |||
APPLY | |||
</a> | |||
</div> | |||
</div> | |||
} | |||
</div> | |||
<div class="container home-catalog-container"> | |||
<div class="row"> | |||
@foreach (var catalogItem in Model.CatalogItems) | |||
{ | |||
<div class="col-sm-4 home-catalog-item"> | |||
<div class="home-catalog-item-image" > | |||
<img src="~/images/product_temp.PNG" /> | |||
<a asp-area="" asp-controller="Home" asp-action="About" class="btn-brand home-catalog-item-image-addCart"> | |||
ADD TO CART | |||
</a> | |||
</div> | |||
<div class="home-catalog-item-title"> | |||
<span>@catalogItem.Name</span> | |||
</div> | |||
<div class="home-catalog-item-price"> | |||
<span>@catalogItem.Price.ToString("N2")</span> | |||
</div> | |||
</div> | |||
} | |||
</div> | |||
</div> | |||
@ -0,0 +1,54 @@ | |||
@model Microsoft.eShopOnContainers.WebMVC.Models.Order | |||
@{ | |||
ViewData["Title"] = "My Cart"; | |||
} | |||
<div class="brand-header-block"> | |||
<ul class="container"> | |||
<li class="brand-header-back"><a asp-area="" asp-controller="Home" asp-action="Index">Back to list</a></li> | |||
</ul> | |||
</div> | |||
<div class="container cart-index-container"> | |||
<div class="row"> | |||
<div class="col-md-offset-8 col-md-4"> | |||
<a asp-controller="Home" asp-action="Index" class="btn btn-default btn-brand btn-brand-dark btn-cart"> Continue Shopping </a> | |||
</div> | |||
<br /><br /><br /><br /> | |||
<div class="col-md-12"> | |||
<section> | |||
<table class="table"> | |||
<thead> | |||
<tr> | |||
<th> | |||
PRODUCT | |||
</th> | |||
<th> | |||
</th> | |||
<th> | |||
BRAND | |||
</th> | |||
<th> | |||
PRICE | |||
</th> | |||
<th> | |||
QUANTITY | |||
</th> | |||
<th> | |||
FINAL PRICE | |||
</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
@await Component.InvokeAsync("Cart") | |||
</tbody> | |||
</table> | |||
</section> | |||
</div> | |||
<br /><br /><br /><br /><br /><br /> | |||
<div class="col-md-offset-8 col-md-4"> | |||
<a asp-controller="Order" asp-action="Create" class="btn btn-default btn-brand btn-cart"> CheckOut </a> | |||
</div> | |||
</div> | |||
</div> |
@ -0,0 +1,112 @@ | |||
@model Microsoft.eShopOnContainers.WebMVC.Models.Order | |||
@{ | |||
ViewData["Title"] = "View"; | |||
} | |||
<div class="brand-header-block"> | |||
<ul class="container"> | |||
<li class="brand-header-back"><a asp-area="" asp-controller="Order" asp-action="Cart">Back to list</a></li> | |||
</ul> | |||
</div> | |||
<div class="container cart-index-container"> | |||
<form asp-action="View"> | |||
<h4 class="order-create-section-title">SHIPPING ADDRESS</h4> | |||
<div class="form-horizontal row"> | |||
<div class="form-group col-sm-6"> | |||
<label asp-for="OrderNumber" class="control-label form-label">order number</label> | |||
<input asp-for="OrderNumber" class="form-control form-input" /> | |||
<span asp-validation-for="OrderNumber" class="text-danger" /> | |||
</div> | |||
<div class="form-group col-sm-6"> | |||
<label asp-for="SequenceNumber" class="control-label form-label"></label> | |||
<input asp-for="SequenceNumber" class="form-control form-input" /> | |||
<span asp-validation-for="SequenceNumber" class="text-danger" /> | |||
</div> | |||
<div class="form-group col-sm-6"> | |||
<label asp-for="BuyerId" class="control-label form-label"></label> | |||
<input asp-for="BuyerId" class="form-control form-input" /> | |||
<span asp-validation-for="BuyerId" class="text-danger" /> | |||
</div> | |||
<div class="form-group col-sm-6"> | |||
<label asp-for="OrderDate" class="control-label form-label"></label> | |||
<input asp-for="OrderDate" class="form-control form-input" /> | |||
<span asp-validation-for="OrderDate" class="text-danger" /> | |||
</div> | |||
</div> | |||
<br /><br /> | |||
<div class="order-create-section-payment"> | |||
<h4 class="order-create-section-title">PAYMENT METHOD</h4> | |||
<div class="form-horizontal row"> | |||
<div class="form-group col-sm-6"> | |||
<label asp-for="OrderNumber" class="control-label form-label">Card Number</label> | |||
<input asp-for="OrderNumber" class="form-control form-input" /> | |||
<span asp-validation-for="OrderNumber" class="text-danger" /> | |||
</div> | |||
<div class="form-group col-sm-6"> | |||
<label asp-for="OrderNumber" class="control-label form-label">Cardholder Name</label> | |||
<input asp-for="OrderNumber" class="form-control form-input" /> | |||
<span asp-validation-for="OrderNumber" class="text-danger" /> | |||
</div> | |||
</div> | |||
<div class="form-horizontal row"> | |||
<div class="form-group col-sm-6"> | |||
<label asp-for="OrderNumber" class="control-label form-label">Expiration Date</label> | |||
<select asp-for="OrderNumber" class="form-control form-select" /> | |||
<span asp-validation-for="OrderNumber" class="text-danger" /> | |||
<br /> | |||
<label asp-for="OrderDate" class="control-label form-label">hhh</label> | |||
<select asp-for="OrderDate" class="form-control form-select" /> | |||
<span asp-validation-for="OrderDate" class="text-danger" /> | |||
</div> | |||
<div class="form-group col-sm-6"> | |||
<label asp-for="OrderNumber" class="control-label form-label">Security Code</label> | |||
<input asp-for="OrderNumber" class="form-control form-input form-input-small" /> | |||
<span asp-validation-for="OrderNumber" class="text-danger" /> | |||
</div> | |||
</div> | |||
</div> | |||
<br /><br /> | |||
<div class="col-md-12 order-create-section-items"> | |||
<section> | |||
<table class="table"> | |||
<thead> | |||
<tr> | |||
<th> | |||
PRODUCT | |||
</th> | |||
<th> | |||
</th> | |||
<th> | |||
BRAND | |||
</th> | |||
<th> | |||
PRICE | |||
</th> | |||
<th> | |||
QUANTITY | |||
</th> | |||
<th> | |||
FINAL PRICE | |||
</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
@await Component.InvokeAsync("Cart") | |||
</tbody> | |||
</table> | |||
</section> | |||
</div> | |||
<br /><br /><br /><br /><br /><br /> | |||
<div class="form-group"> | |||
<div class="col-md-offset-8 col-md-4"> | |||
@*<input type="submit" value="[ PLACE ORDER ]" class="btn btn-default btn-brand" />*@ | |||
<a asp-controller="Order" asp-action="Index" class="btn btn-default btn-brand">[ PLACE ORDER ]</a> | |||
</div> | |||
</div> | |||
<br /><br /><br /><br /><br /><br /> | |||
</form> | |||
</div> | |||
@section Scripts { | |||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");} | |||
} |
@ -0,0 +1,56 @@ | |||
@model IEnumerable<Microsoft.eShopOnContainers.WebMVC.Models.Order> | |||
@{ | |||
ViewData["Title"] = "View"; | |||
} | |||
<div class="brand-header-block"> | |||
<ul class="container"> | |||
<li class="brand-header-back"><a asp-area="" asp-controller="Home" asp-action="Index">Back to home</a></li> | |||
</ul> | |||
</div> | |||
<div class="container cart-index-container"> | |||
<table class="table"> | |||
<thead> | |||
<tr> | |||
<th> | |||
@Html.DisplayNameFor(model => model.OrderNumber) | |||
</th> | |||
<th> | |||
@Html.DisplayNameFor(model => model.OrderDate) | |||
@*@Html.DisplayNameFor(model => model.SequenceNumber)*@ | |||
</th> | |||
<th> | |||
@Html.DisplayNameFor(model => model.BuyerId) | |||
</th> | |||
<th> | |||
@Html.DisplayNameFor(model => model.OrderDate) | |||
</th> | |||
<th></th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
@foreach (var item in Model) { | |||
<tr> | |||
<td> | |||
@Html.DisplayFor(modelItem => item.OrderNumber) | |||
</td> | |||
<td> | |||
@Html.DisplayFor(modelItem => item.OrderDate) | |||
@*@Html.DisplayFor(modelItem => item.SequenceNumber)*@ | |||
</td> | |||
<td> | |||
@Html.DisplayFor(modelItem => item.BuyerId) | |||
</td> | |||
<td> | |||
@Html.DisplayFor(modelItem => item.OrderDate) | |||
</td> | |||
<td> | |||
@Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) | | |||
@Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) | | |||
@Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ }) | |||
</td> | |||
</tr> | |||
} | |||
</tbody> | |||
</table> | |||
</div> |
@ -0,0 +1,20 @@ | |||
@model Microsoft.eShopOnContainers.WebMVC.Models.Order | |||
@{ | |||
ViewData["Title"] = "My Cart"; | |||
} | |||
@foreach (var item in Model.OrderItems) | |||
{ | |||
<tr> | |||
<td>@*image*@</td> | |||
<td>@item.ProductName</td> | |||
<td>ROSLYN</td> | |||
<td>$ @item.UnitPrice</td> | |||
<td>@item.Quantity</td> | |||
<td>$ @item.Quantity * @item.UnitPrice</td> | |||
</tr> | |||
} | |||