From 9cf42a1d795888f516d8fce7d44e9efce3e440a5 Mon Sep 17 00:00:00 2001 From: Brett Hargreaves Date: Wed, 10 Jan 2018 15:35:10 +0000 Subject: [PATCH 01/13] Added Order Creation --- .../MyShop.Core/Contracts/IBasketService.cs | 1 + MyShop/MyShop.Core/Contracts/IOrderService.cs | 15 +++ MyShop/MyShop.Core/Models/Order.cs | 25 ++++ MyShop/MyShop.Core/Models/OrderItem.cs | 18 +++ MyShop/MyShop.Core/MyShop.Core.csproj | 3 + MyShop/MyShop.DataAccess.SQL/DataContext.cs | 2 + .../201801101446455_AddedOrders.Designer.cs | 29 ++++ .../Migrations/201801101446455_AddedOrders.cs | 54 ++++++++ .../201801101446455_AddedOrders.resx | 126 ++++++++++++++++++ .../MyShop.DataAccess.SQL.csproj | 7 + MyShop/MyShop.Services/BasketService.cs | 6 + MyShop/MyShop.Services/MyShop.Services.csproj | 1 + MyShop/MyShop.Services/OrderService.cs | 36 +++++ .../Controllers/BasketControllerTests.cs | 49 ++++++- MyShop/MyShop.WebUI/App_Start/UnityConfig.cs | 3 + .../Controllers/BasketController.cs | 29 +++- MyShop/MyShop.WebUI/MyShop.WebUI.csproj | 2 + .../MyShop.WebUI/Views/Basket/Checkout.cshtml | 79 +++++++++++ MyShop/MyShop.WebUI/Views/Basket/Index.cshtml | 1 + .../MyShop.WebUI/Views/Basket/ThankYou.cshtml | 7 + 20 files changed, 489 insertions(+), 4 deletions(-) create mode 100644 MyShop/MyShop.Core/Contracts/IOrderService.cs create mode 100644 MyShop/MyShop.Core/Models/Order.cs create mode 100644 MyShop/MyShop.Core/Models/OrderItem.cs create mode 100644 MyShop/MyShop.DataAccess.SQL/Migrations/201801101446455_AddedOrders.Designer.cs create mode 100644 MyShop/MyShop.DataAccess.SQL/Migrations/201801101446455_AddedOrders.cs create mode 100644 MyShop/MyShop.DataAccess.SQL/Migrations/201801101446455_AddedOrders.resx create mode 100644 MyShop/MyShop.Services/OrderService.cs create mode 100644 MyShop/MyShop.WebUI/Views/Basket/Checkout.cshtml create mode 100644 MyShop/MyShop.WebUI/Views/Basket/ThankYou.cshtml diff --git a/MyShop/MyShop.Core/Contracts/IBasketService.cs b/MyShop/MyShop.Core/Contracts/IBasketService.cs index 21a7a40..bd3b7ea 100644 --- a/MyShop/MyShop.Core/Contracts/IBasketService.cs +++ b/MyShop/MyShop.Core/Contracts/IBasketService.cs @@ -14,6 +14,7 @@ public interface IBasketService void RemoveFromBasket(HttpContextBase httpContext, string itemId); List GetBasketItems(HttpContextBase httpContext); BasketSummaryViewModel GetBasketSummary(HttpContextBase httpContext); + void ClearBasket(HttpContextBase httpContext); } } diff --git a/MyShop/MyShop.Core/Contracts/IOrderService.cs b/MyShop/MyShop.Core/Contracts/IOrderService.cs new file mode 100644 index 0000000..e6db503 --- /dev/null +++ b/MyShop/MyShop.Core/Contracts/IOrderService.cs @@ -0,0 +1,15 @@ +using MyShop.Core.Models; +using MyShop.Core.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MyShop.Core.Contracts +{ + public interface IOrderService + { + void CreateOrder(Order baseOrder, List basketItems); + } +} diff --git a/MyShop/MyShop.Core/Models/Order.cs b/MyShop/MyShop.Core/Models/Order.cs new file mode 100644 index 0000000..3e6fb3d --- /dev/null +++ b/MyShop/MyShop.Core/Models/Order.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MyShop.Core.Models +{ + public class Order : BaseEntity + { + public Order() { + this.OrderItems = new List(); + } + + public string FirstName { get; set; } + public string Surname { get; set; } + public string Email { get; set; } + public string Street { get; set; } + public string City { get; set; } + public string State { get; set; } + public string ZipCode { get; set; } + public string OrderStatus { get; set; } + public virtual ICollection OrderItems { get; set; } + } +} diff --git a/MyShop/MyShop.Core/Models/OrderItem.cs b/MyShop/MyShop.Core/Models/OrderItem.cs new file mode 100644 index 0000000..e0ae2a4 --- /dev/null +++ b/MyShop/MyShop.Core/Models/OrderItem.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MyShop.Core.Models +{ + public class OrderItem : BaseEntity + { + public string OrderId { get; set; } + public string ProductId { get; set; } + public string ProductName { get; set; } + public decimal Price { get; set; } + public string Image { get; set; } + public int Quanity { get; set; } + } +} diff --git a/MyShop/MyShop.Core/MyShop.Core.csproj b/MyShop/MyShop.Core/MyShop.Core.csproj index d710ecc..26b77f3 100644 --- a/MyShop/MyShop.Core/MyShop.Core.csproj +++ b/MyShop/MyShop.Core/MyShop.Core.csproj @@ -43,11 +43,14 @@ + + + diff --git a/MyShop/MyShop.DataAccess.SQL/DataContext.cs b/MyShop/MyShop.DataAccess.SQL/DataContext.cs index b269b5b..b26d07c 100644 --- a/MyShop/MyShop.DataAccess.SQL/DataContext.cs +++ b/MyShop/MyShop.DataAccess.SQL/DataContext.cs @@ -20,5 +20,7 @@ public DataContext() public DbSet Baskets { get; set; } public DbSet BasketItems { get; set; } public DbSet Customers { get; set; } + public DbSet Orders { get; set; } + public DbSet OrderItems { get; set; } } } diff --git a/MyShop/MyShop.DataAccess.SQL/Migrations/201801101446455_AddedOrders.Designer.cs b/MyShop/MyShop.DataAccess.SQL/Migrations/201801101446455_AddedOrders.Designer.cs new file mode 100644 index 0000000..9140edf --- /dev/null +++ b/MyShop/MyShop.DataAccess.SQL/Migrations/201801101446455_AddedOrders.Designer.cs @@ -0,0 +1,29 @@ +// +namespace MyShop.DataAccess.SQL.Migrations +{ + using System.CodeDom.Compiler; + using System.Data.Entity.Migrations; + using System.Data.Entity.Migrations.Infrastructure; + using System.Resources; + + [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")] + public sealed partial class AddedOrders : IMigrationMetadata + { + private readonly ResourceManager Resources = new ResourceManager(typeof(AddedOrders)); + + string IMigrationMetadata.Id + { + get { return "201801101446455_AddedOrders"; } + } + + string IMigrationMetadata.Source + { + get { return null; } + } + + string IMigrationMetadata.Target + { + get { return Resources.GetString("Target"); } + } + } +} diff --git a/MyShop/MyShop.DataAccess.SQL/Migrations/201801101446455_AddedOrders.cs b/MyShop/MyShop.DataAccess.SQL/Migrations/201801101446455_AddedOrders.cs new file mode 100644 index 0000000..e5cf09d --- /dev/null +++ b/MyShop/MyShop.DataAccess.SQL/Migrations/201801101446455_AddedOrders.cs @@ -0,0 +1,54 @@ +namespace MyShop.DataAccess.SQL.Migrations +{ + using System; + using System.Data.Entity.Migrations; + + public partial class AddedOrders : DbMigration + { + public override void Up() + { + CreateTable( + "dbo.OrderItems", + c => new + { + Id = c.String(nullable: false, maxLength: 128), + OrderId = c.String(maxLength: 128), + ProductId = c.String(), + ProductName = c.String(), + Price = c.Decimal(nullable: false, precision: 18, scale: 2), + Image = c.String(), + Quanity = c.Int(nullable: false), + CreatedAt = c.DateTimeOffset(nullable: false, precision: 7), + }) + .PrimaryKey(t => t.Id) + .ForeignKey("dbo.Orders", t => t.OrderId) + .Index(t => t.OrderId); + + CreateTable( + "dbo.Orders", + c => new + { + Id = c.String(nullable: false, maxLength: 128), + FirstName = c.String(), + Surname = c.String(), + Email = c.String(), + Street = c.String(), + City = c.String(), + State = c.String(), + ZipCode = c.String(), + OrderStatus = c.String(), + CreatedAt = c.DateTimeOffset(nullable: false, precision: 7), + }) + .PrimaryKey(t => t.Id); + + } + + public override void Down() + { + DropForeignKey("dbo.OrderItems", "OrderId", "dbo.Orders"); + DropIndex("dbo.OrderItems", new[] { "OrderId" }); + DropTable("dbo.Orders"); + DropTable("dbo.OrderItems"); + } + } +} diff --git a/MyShop/MyShop.DataAccess.SQL/Migrations/201801101446455_AddedOrders.resx b/MyShop/MyShop.DataAccess.SQL/Migrations/201801101446455_AddedOrders.resx new file mode 100644 index 0000000..683873b --- /dev/null +++ b/MyShop/MyShop.DataAccess.SQL/Migrations/201801101446455_AddedOrders.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + H4sIAAAAAAAEAO1cW2/bNhR+H7D/IOhpG1LLSR/WBXaL1GkGY7k1TophLwUj0Y4widJEKrAx7JftYT9pf2FHN4oSdbVlxc6MvsQU+R2S50rynP779z+jD0vbUp6xR02HjNXjwVBVMNEdwySLseqz+Zt36of3334z+mTYS+VL0u9t0A9GEjpWnxhzTzWN6k/YRnRgm7rnUGfOBrpja8hwtJPh8Cft+FjDAKEClqKM7nzCTBuHP+DnxCE6dpmPrCvHwBaN2+HLLERVrpGNqYt0PFavVrMnxx2cI4bOdB1TOph9vlSVM8tEMJkZtuaqgghxGGIw1dMHimfMc8hi5kIDsu5XLoZ+c2RRHC/hNO3edDXDk2A1WjowgdJ9yhy7JeDx23h7tPzwtTZZ5dsHG/gJNpqtglWHmzhWPyL6O2ZThm1VyZM7nVhe0JXv8sTx8CDiySAdeKQIn4+4VIDwBP+OlIlvMd/DY4J95iHrSLn1Hy1T/wWv7p3fMRkT37LEScI04VumAZpuPcfFHlvd4Xk89amhKlp2nJYfyIcJY6IlgRiAUKvKFVpeYrJgTyDuJ+9U5cJcYiNpieXigZigAzCIeT78vIYJo0cL8+9aJc14p7qgXE0Ifhq+Xk0J/uyA0mcfEZCjhM6UsLcnrfdl4mHEsHHGEhhQYnwPduBmPqeY1eCNtFSWG0j4WtJ9kOxtchDwrtGzuQi5UawzYF2oqtxhK+xDn0w3sukxf75mul14jn3nWHy0+PXrzPE9HSZw75R2uUfeIpj0WlI2CaULey3lLBl2kLRqSQO/7fVg1y5Mj7Lgz61TukQ9EfpkI9PaOhUAxphtncxEcDpbXAtYsa1T+c10J9B5+1vWj5e98QzQ0PZhJB93sIDVfIw26jUFkTGlXqzgrWfqnM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TD69SqeWLr831O39R1l7TaxG2dHbhV3sZtpVc+L0uCeiQ8eszvC9Gy3a9rUnPvCyLQJkP/cY13YlvFxHSzqmAdI+a78Kp8/vU3L3pKL7DrC/UlC41oy5BPoDzbBrBheZsReFsEKrQYPaHNbFMWG/a4QpCyTmmLEoGUU+Gxye5Qs/dKbrUKDWsgjvg4srLLMd6yGkhz8jTn5AnZ7VsWNuYAkuvelNi4OVY/TMceapMf02eSIwjJYwqTpWh8lfVjNZKX09m9J2Nlt+3RculXJukQYpgXV6HAT+DamcnzusQ8mF+7LjmcX/l6kV2rfjaca/2LVsnt5HsS5nmG6Hl6902AsukjG+ElE0L3whKTP3ecE5CevdGSLkU7s2W9xIaWXJhuFcqmSvcauUh47G76yALarg2xBNSRo2t1mn9LwODggvDvVKmbp1SrsTp4JMq5rSLPqmgdGj/fFzlzd5eKWc+I39vebHHPCiyjVIVSTtOFJSM7LCP71QIuwsY+hDnDoo9uqrsiDKU+y/l6K9uoyQFYs8LNbopy5C430shRm9lF41Z//KFFnIqcckLmHwpXV1JEd3egxl7dIDTkamqymkvJlRRaVFOoB48LbWoqMIoIiDUbzQt0qiu0SgiUpHyXkilvISjFL0eWSrdqC/uKKJWUCXSjHBVCUgFIRm/3wKRghqOBsUgopzk0993s/hDrtGor/SQVlleq9RJaYf89AjmU/ifZMF4U3ORQgT/ryzBesZw8j5TMncSA56bUdIlF9FdYYaM4LXfY+Yc6Qw+B8/+YXXwF2T54Z3AIzam5MZnrs9gydh+tDKvzoEfqKIf1q9k5zy6CSNx2sUSYJpmEIfekI++aRl83hcFMWcJROBgfsbQHvES/BVYghVHunZIQ6B4+7hfvMe2awEYvSEz9IzXmdsDxZd4gfRV8oJcDlLPiOy2j85NtPCQTWOMdDz8BBk27OX7/wBaThdHUFkAAA== + + + dbo + + \ No newline at end of file diff --git a/MyShop/MyShop.DataAccess.SQL/MyShop.DataAccess.SQL.csproj b/MyShop/MyShop.DataAccess.SQL/MyShop.DataAccess.SQL.csproj index 56b077e..eddc306 100644 --- a/MyShop/MyShop.DataAccess.SQL/MyShop.DataAccess.SQL.csproj +++ b/MyShop/MyShop.DataAccess.SQL/MyShop.DataAccess.SQL.csproj @@ -60,6 +60,10 @@ 201801032024566_AddCustomer.cs + + + 201801101446455_AddedOrders.cs + @@ -84,6 +88,9 @@ 201801032024566_AddCustomer.cs + + 201801101446455_AddedOrders.cs + \ No newline at end of file diff --git a/MyShop/MyShop.Services/BasketService.cs b/MyShop/MyShop.Services/BasketService.cs index 64c7651..6c8bb60 100644 --- a/MyShop/MyShop.Services/BasketService.cs +++ b/MyShop/MyShop.Services/BasketService.cs @@ -143,5 +143,11 @@ join p in productContext.Collection() on item.ProductId equals p.Id return model; } } + + public void ClearBasket(HttpContextBase httpContext) { + Basket basket = GetBasket(httpContext, false); + basket.BasketItems.Clear(); + basketContext.Commit(); + } } } diff --git a/MyShop/MyShop.Services/MyShop.Services.csproj b/MyShop/MyShop.Services/MyShop.Services.csproj index 3948ccc..9708073 100644 --- a/MyShop/MyShop.Services/MyShop.Services.csproj +++ b/MyShop/MyShop.Services/MyShop.Services.csproj @@ -42,6 +42,7 @@ + diff --git a/MyShop/MyShop.Services/OrderService.cs b/MyShop/MyShop.Services/OrderService.cs new file mode 100644 index 0000000..25c0a9d --- /dev/null +++ b/MyShop/MyShop.Services/OrderService.cs @@ -0,0 +1,36 @@ +using MyShop.Core.Contracts; +using MyShop.Core.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using MyShop.Core.ViewModels; + +namespace MyShop.Services +{ + public class OrderService : IOrderService + { + IRepository orderContext; + public OrderService(IRepository OrderContext) { + this.orderContext = OrderContext; + } + + public void CreateOrder(Order baseOrder, List basketItems) + { + foreach (var item in basketItems) { + baseOrder.OrderItems.Add(new OrderItem() + { + ProductId = item.Id, + Image = item.Image, + Price = item.Price, + ProductName = item.ProductName, + Quanity = item.Quanity + }); + } + + orderContext.Insert(baseOrder); + orderContext.Commit(); + } + } +} diff --git a/MyShop/MyShop.WebUI.Tests/Controllers/BasketControllerTests.cs b/MyShop/MyShop.WebUI.Tests/Controllers/BasketControllerTests.cs index 435b879..15dfba9 100644 --- a/MyShop/MyShop.WebUI.Tests/Controllers/BasketControllerTests.cs +++ b/MyShop/MyShop.WebUI.Tests/Controllers/BasketControllerTests.cs @@ -20,12 +20,14 @@ public void CanAddBasketItem() //setup IRepository baskets = new MockContext(); IRepository products = new MockContext(); + IRepository orders = new MockContext(); var httpContext = new MockHttpContext(); IBasketService basketService = new BasketService(products, baskets); - var controller = new BasketController(basketService); + IOrderService orderService = new OrderService(orders); + var controller = new BasketController(basketService, orderService); controller.ControllerContext = new System.Web.Mvc.ControllerContext(httpContext, new System.Web.Routing.RouteData(), controller); //Act @@ -45,6 +47,7 @@ public void CanAddBasketItem() public void CanGetSummaryViewModel() { IRepository baskets = new MockContext(); IRepository products = new MockContext(); + IRepository orders = new MockContext(); products.Insert(new Product() { Id = "1", Price = 10.00m }); products.Insert(new Product() { Id = "2", Price = 5.00m }); @@ -55,9 +58,9 @@ public void CanGetSummaryViewModel() { baskets.Insert(basket); IBasketService basketService = new BasketService(products, baskets); + IOrderService orderService = new OrderService(orders); + var controller = new BasketController(basketService, orderService); - - var controller = new BasketController(basketService); var httpContext = new MockHttpContext(); httpContext.Request.Cookies.Add(new System.Web.HttpCookie("eCommerceBasket") { Value = basket.Id }); controller.ControllerContext = new System.Web.Mvc.ControllerContext(httpContext, new System.Web.Routing.RouteData(), controller); @@ -71,5 +74,45 @@ public void CanGetSummaryViewModel() { } + + [TestMethod] + public void CanCheckoutAndCreateOrder() { + IRepository products = new MockContext(); + products.Insert(new Product() { Id = "1", Price = 10.00m }); + products.Insert(new Product() { Id = "2", Price = 5.00m }); + + IRepository baskets = new MockContext(); + Basket basket = new Basket(); + basket.BasketItems.Add(new BasketItem() { ProductId = "1", Quanity = 2, BasketId = basket.Id }); + basket.BasketItems.Add(new BasketItem() { ProductId = "1", Quanity = 1, BasketId = basket.Id }); + + baskets.Insert(basket); + + IBasketService basketService = new BasketService(products, baskets); + + IRepository orders = new MockContext(); + IOrderService orderService = new OrderService(orders); + + var controller = new BasketController(basketService, orderService); + var httpContext = new MockHttpContext(); + httpContext.Request.Cookies.Add(new System.Web.HttpCookie("eCommerceBasket") + { + Value = basket.Id + }); + + controller.ControllerContext = new ControllerContext(httpContext, new System.Web.Routing.RouteData(), controller); + + //Act + Order order = new Order(); + controller.Checkout(order); + + //assert + Assert.AreEqual(2, order.OrderItems.Count); + Assert.AreEqual(0, basket.BasketItems.Count); + + Order orderInRep = orders.Find(order.Id); + Assert.AreEqual(2, orderInRep.OrderItems.Count); + + } } } diff --git a/MyShop/MyShop.WebUI/App_Start/UnityConfig.cs b/MyShop/MyShop.WebUI/App_Start/UnityConfig.cs index 0bc1f73..548fed8 100644 --- a/MyShop/MyShop.WebUI/App_Start/UnityConfig.cs +++ b/MyShop/MyShop.WebUI/App_Start/UnityConfig.cs @@ -52,7 +52,10 @@ public static void RegisterTypes(IUnityContainer container) container.RegisterType, SQLRepository>(); container.RegisterType, SQLRepository>(); container.RegisterType, SQLRepository>(); + container.RegisterType, SQLRepository>(); + container.RegisterType(); + container.RegisterType(); } } } \ No newline at end of file diff --git a/MyShop/MyShop.WebUI/Controllers/BasketController.cs b/MyShop/MyShop.WebUI/Controllers/BasketController.cs index 6dc4347..db78e4b 100644 --- a/MyShop/MyShop.WebUI/Controllers/BasketController.cs +++ b/MyShop/MyShop.WebUI/Controllers/BasketController.cs @@ -1,4 +1,5 @@ using MyShop.Core.Contracts; +using MyShop.Core.Models; using System; using System.Collections.Generic; using System.Linq; @@ -10,9 +11,11 @@ namespace MyShop.WebUI.Controllers public class BasketController : Controller { IBasketService basketService; + IOrderService orderService; - public BasketController(IBasketService BasketService) { + public BasketController(IBasketService BasketService, IOrderService OrderService) { this.basketService = BasketService; + this.orderService = OrderService; } // GET: Basket2 public ActionResult Index() @@ -40,5 +43,29 @@ public PartialViewResult BasketSummary() { return PartialView(basketSummary); } + + public ActionResult Checkout() { + return View(); + } + + [HttpPost] + public ActionResult Checkout(Order order) { + + var basketItems = basketService.GetBasketItems(this.HttpContext); + order.OrderStatus = "Order Created"; + + //process payment + + order.OrderStatus = "Payment Processed"; + orderService.CreateOrder(order, basketItems); + basketService.ClearBasket(this.HttpContext); + + return RedirectToAction("Thankyou", new { OrderId = order.Id }); + } + + public ActionResult ThankYou(string OrderId) { + ViewBag.OrderId = OrderId; + return View(); + } } } \ No newline at end of file diff --git a/MyShop/MyShop.WebUI/MyShop.WebUI.csproj b/MyShop/MyShop.WebUI/MyShop.WebUI.csproj index cbb36a2..4013151 100644 --- a/MyShop/MyShop.WebUI/MyShop.WebUI.csproj +++ b/MyShop/MyShop.WebUI/MyShop.WebUI.csproj @@ -304,6 +304,8 @@ + + diff --git a/MyShop/MyShop.WebUI/Views/Basket/Checkout.cshtml b/MyShop/MyShop.WebUI/Views/Basket/Checkout.cshtml new file mode 100644 index 0000000..175c806 --- /dev/null +++ b/MyShop/MyShop.WebUI/Views/Basket/Checkout.cshtml @@ -0,0 +1,79 @@ +@model MyShop.Core.Models.Order + +@using (Html.BeginForm()) +{ + @Html.AntiForgeryToken() + +
+

Order

+
+ @Html.ValidationSummary(true, "", new { @class = "text-danger" }) + + +
+ @Html.LabelFor(model => model.FirstName, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.FirstName, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.FirstName, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.Surname, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.Surname, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.Surname, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.Email, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.Email, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.Street, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.Street, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.Street, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.City, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.City, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.City, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.State, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.State, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.State, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.ZipCode, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.ZipCode, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.ZipCode, "", new { @class = "text-danger" }) +
+
+ +
+
+ +
+
+
+} + +
+ @Html.ActionLink("Back to Basket", "Index") +
diff --git a/MyShop/MyShop.WebUI/Views/Basket/Index.cshtml b/MyShop/MyShop.WebUI/Views/Basket/Index.cshtml index 3e1eb82..78d19c5 100644 --- a/MyShop/MyShop.WebUI/Views/Basket/Index.cshtml +++ b/MyShop/MyShop.WebUI/Views/Basket/Index.cshtml @@ -48,6 +48,7 @@ Basket Total @String.Format("{0:c}", (from p in Model select p.Price * p.Quanity).Sum()) + Checkout diff --git a/MyShop/MyShop.WebUI/Views/Basket/ThankYou.cshtml b/MyShop/MyShop.WebUI/Views/Basket/ThankYou.cshtml new file mode 100644 index 0000000..238d088 --- /dev/null +++ b/MyShop/MyShop.WebUI/Views/Basket/ThankYou.cshtml @@ -0,0 +1,7 @@ +@{ + ViewBag.Title = "Thank You"; +} + +

Thank You

+Thank you for your order.

+Your Order Id = @ViewBag.OrderId From f596b8dc5caead862c456d6a6bfeb1f11ee90b2a Mon Sep 17 00:00:00 2001 From: Brett Hargreaves Date: Wed, 10 Jan 2018 17:19:42 +0000 Subject: [PATCH 02/13] linked customer to orders --- .../Controllers/BasketControllerTests.cs | 16 ++++++++-- .../Mocks/MockHttpContext.cs | 12 ++++++++ .../Controllers/BasketController.cs | 29 +++++++++++++++++-- .../MyShop.WebUI/Views/Basket/Checkout.cshtml | 8 ----- 4 files changed, 52 insertions(+), 13 deletions(-) diff --git a/MyShop/MyShop.WebUI.Tests/Controllers/BasketControllerTests.cs b/MyShop/MyShop.WebUI.Tests/Controllers/BasketControllerTests.cs index 15dfba9..91016c7 100644 --- a/MyShop/MyShop.WebUI.Tests/Controllers/BasketControllerTests.cs +++ b/MyShop/MyShop.WebUI.Tests/Controllers/BasketControllerTests.cs @@ -8,6 +8,7 @@ using MyShop.WebUI.Controllers; using System.Web.Mvc; using MyShop.Core.ViewModels; +using System.Security.Principal; namespace MyShop.WebUI.Tests.Controllers { @@ -21,13 +22,14 @@ public void CanAddBasketItem() IRepository baskets = new MockContext(); IRepository products = new MockContext(); IRepository orders = new MockContext(); + IRepository customers = new MockContext(); var httpContext = new MockHttpContext(); IBasketService basketService = new BasketService(products, baskets); IOrderService orderService = new OrderService(orders); - var controller = new BasketController(basketService, orderService); + var controller = new BasketController(basketService, orderService, customers); controller.ControllerContext = new System.Web.Mvc.ControllerContext(httpContext, new System.Web.Routing.RouteData(), controller); //Act @@ -48,6 +50,7 @@ public void CanGetSummaryViewModel() { IRepository baskets = new MockContext(); IRepository products = new MockContext(); IRepository orders = new MockContext(); + IRepository customers = new MockContext(); products.Insert(new Product() { Id = "1", Price = 10.00m }); products.Insert(new Product() { Id = "2", Price = 5.00m }); @@ -59,7 +62,7 @@ public void CanGetSummaryViewModel() { IBasketService basketService = new BasketService(products, baskets); IOrderService orderService = new OrderService(orders); - var controller = new BasketController(basketService, orderService); + var controller = new BasketController(basketService, orderService, customers); var httpContext = new MockHttpContext(); httpContext.Request.Cookies.Add(new System.Web.HttpCookie("eCommerceBasket") { Value = basket.Id }); @@ -77,6 +80,7 @@ public void CanGetSummaryViewModel() { [TestMethod] public void CanCheckoutAndCreateOrder() { + IRepository customers = new MockContext(); IRepository products = new MockContext(); products.Insert(new Product() { Id = "1", Price = 10.00m }); products.Insert(new Product() { Id = "2", Price = 5.00m }); @@ -93,8 +97,14 @@ public void CanCheckoutAndCreateOrder() { IRepository orders = new MockContext(); IOrderService orderService = new OrderService(orders); - var controller = new BasketController(basketService, orderService); + customers.Insert(new Customer() { Id = "1", Email = "brett.hargreaves@gmail.com", ZipCode = "90210" }); + + IPrincipal FakeUser = new GenericPrincipal(new GenericIdentity("brett.hargreaves@gmail.com", "Forms"), null); + + + var controller = new BasketController(basketService, orderService, customers); var httpContext = new MockHttpContext(); + httpContext.User = FakeUser; httpContext.Request.Cookies.Add(new System.Web.HttpCookie("eCommerceBasket") { Value = basket.Id diff --git a/MyShop/MyShop.WebUI.Tests/Mocks/MockHttpContext.cs b/MyShop/MyShop.WebUI.Tests/Mocks/MockHttpContext.cs index 6c0d3c2..694b847 100644 --- a/MyShop/MyShop.WebUI.Tests/Mocks/MockHttpContext.cs +++ b/MyShop/MyShop.WebUI.Tests/Mocks/MockHttpContext.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Security.Principal; using System.Text; using System.Threading.Tasks; using System.Web; @@ -12,6 +13,7 @@ public class MockHttpContext : HttpContextBase private MockRequest request; private MockResponse response; private HttpCookieCollection cookies; + private IPrincipal FakeUser; public MockHttpContext() { cookies = new HttpCookieCollection(); @@ -19,6 +21,16 @@ public MockHttpContext() { this.response = new MockResponse(cookies); } + public override IPrincipal User { + get { + return this.FakeUser; + } + set { + this.FakeUser = value; + } + + } + public override HttpRequestBase Request { get { return request; diff --git a/MyShop/MyShop.WebUI/Controllers/BasketController.cs b/MyShop/MyShop.WebUI/Controllers/BasketController.cs index db78e4b..69898ff 100644 --- a/MyShop/MyShop.WebUI/Controllers/BasketController.cs +++ b/MyShop/MyShop.WebUI/Controllers/BasketController.cs @@ -10,12 +10,14 @@ namespace MyShop.WebUI.Controllers { public class BasketController : Controller { + IRepository customers; IBasketService basketService; IOrderService orderService; - public BasketController(IBasketService BasketService, IOrderService OrderService) { + public BasketController(IBasketService BasketService, IOrderService OrderService, IRepository Customers) { this.basketService = BasketService; this.orderService = OrderService; + this.customers = Customers; } // GET: Basket2 public ActionResult Index() @@ -44,15 +46,38 @@ public PartialViewResult BasketSummary() { return PartialView(basketSummary); } + [Authorize] public ActionResult Checkout() { - return View(); + Customer customer = customers.Collection().FirstOrDefault(c => c.Email == User.Identity.Name); + + if (customer != null) + { + Order order = new Order() + { + Email = customer.Email, + City = customer.City, + State = customer.State, + Street = customer.Street, + FirstName = customer.FirstName, + Surname = customer.LastName, + ZipCode = customer.ZipCode + }; + + return View(order); + } + else { + return RedirectToAction("Error"); + } + } [HttpPost] + [Authorize] public ActionResult Checkout(Order order) { var basketItems = basketService.GetBasketItems(this.HttpContext); order.OrderStatus = "Order Created"; + order.Email = User.Identity.Name; //process payment diff --git a/MyShop/MyShop.WebUI/Views/Basket/Checkout.cshtml b/MyShop/MyShop.WebUI/Views/Basket/Checkout.cshtml index 175c806..68e90b9 100644 --- a/MyShop/MyShop.WebUI/Views/Basket/Checkout.cshtml +++ b/MyShop/MyShop.WebUI/Views/Basket/Checkout.cshtml @@ -26,14 +26,6 @@ -
- @Html.LabelFor(model => model.Email, htmlAttributes: new { @class = "control-label col-md-2" }) -
- @Html.EditorFor(model => model.Email, new { htmlAttributes = new { @class = "form-control" } }) - @Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" }) -
-
-
@Html.LabelFor(model => model.Street, htmlAttributes: new { @class = "control-label col-md-2" })
From 71d5afbd787ab454ce29841c9a2e0840f1cb95e6 Mon Sep 17 00:00:00 2001 From: Brett Hargreaves Date: Thu, 11 Jan 2018 20:31:20 +0000 Subject: [PATCH 03/13] Added Order Manager --- MyShop/MyShop.Core/Contracts/IOrderService.cs | 3 + MyShop/MyShop.Services/OrderService.cs | 13 +++ .../Controllers/AdminController.cs | 17 ++++ .../Controllers/OrderManagerController.cs | 47 ++++++++++ MyShop/MyShop.WebUI/MyShop.WebUI.csproj | 6 ++ MyShop/MyShop.WebUI/Views/Admin/Index.cshtml | 20 ++++ .../Views/OrderManager/Index.cshtml | 48 ++++++++++ .../Views/OrderManager/OrderItems.cshtml | 45 +++++++++ .../Views/OrderManager/UpdateOrder.cshtml | 91 +++++++++++++++++++ .../MyShop.WebUI/Views/Shared/_Layout.cshtml | 3 +- 10 files changed, 291 insertions(+), 2 deletions(-) create mode 100644 MyShop/MyShop.WebUI/Controllers/AdminController.cs create mode 100644 MyShop/MyShop.WebUI/Controllers/OrderManagerController.cs create mode 100644 MyShop/MyShop.WebUI/Views/Admin/Index.cshtml create mode 100644 MyShop/MyShop.WebUI/Views/OrderManager/Index.cshtml create mode 100644 MyShop/MyShop.WebUI/Views/OrderManager/OrderItems.cshtml create mode 100644 MyShop/MyShop.WebUI/Views/OrderManager/UpdateOrder.cshtml diff --git a/MyShop/MyShop.Core/Contracts/IOrderService.cs b/MyShop/MyShop.Core/Contracts/IOrderService.cs index e6db503..d98847a 100644 --- a/MyShop/MyShop.Core/Contracts/IOrderService.cs +++ b/MyShop/MyShop.Core/Contracts/IOrderService.cs @@ -11,5 +11,8 @@ namespace MyShop.Core.Contracts public interface IOrderService { void CreateOrder(Order baseOrder, List basketItems); + List GetOrderList(); + Order GetOrder(string Id); + void UpdateOrder(Order updatedOrder); } } diff --git a/MyShop/MyShop.Services/OrderService.cs b/MyShop/MyShop.Services/OrderService.cs index 25c0a9d..6b43726 100644 --- a/MyShop/MyShop.Services/OrderService.cs +++ b/MyShop/MyShop.Services/OrderService.cs @@ -32,5 +32,18 @@ public void CreateOrder(Order baseOrder, List basketItems) orderContext.Insert(baseOrder); orderContext.Commit(); } + + public List GetOrderList() { + return orderContext.Collection().ToList(); + } + + public Order GetOrder(string Id) { + return orderContext.Find(Id); + } + + public void UpdateOrder(Order updatedOrder) { + orderContext.Update(updatedOrder); + orderContext.Commit(); + } } } diff --git a/MyShop/MyShop.WebUI/Controllers/AdminController.cs b/MyShop/MyShop.WebUI/Controllers/AdminController.cs new file mode 100644 index 0000000..7b4f512 --- /dev/null +++ b/MyShop/MyShop.WebUI/Controllers/AdminController.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; + +namespace MyShop.WebUI.Controllers +{ + public class AdminController : Controller + { + // GET: Admin + public ActionResult Index() + { + return View(); + } + } +} \ No newline at end of file diff --git a/MyShop/MyShop.WebUI/Controllers/OrderManagerController.cs b/MyShop/MyShop.WebUI/Controllers/OrderManagerController.cs new file mode 100644 index 0000000..becd9d1 --- /dev/null +++ b/MyShop/MyShop.WebUI/Controllers/OrderManagerController.cs @@ -0,0 +1,47 @@ +using MyShop.Core.Contracts; +using MyShop.Core.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; + +namespace MyShop.WebUI.Controllers +{ + public class OrderManagerController : Controller + { + IOrderService orderService; + + public OrderManagerController(IOrderService OrderService) { + this.orderService = OrderService; + } + // GET: OrderManager + public ActionResult Index() + { + List orders = orderService.GetOrderList(); + + return View(orders); + } + + public ActionResult UpdateOrder(string Id) { + ViewBag.StatusList = new List() { + "Order Created", + "Payment Processed", + "Order Shipped", + "Order Complete" + }; + Order order = orderService.GetOrder(Id); + return View(order); + } + + [HttpPost] + public ActionResult UpdateOrder(Order updatedOrder, string Id) { + Order order = orderService.GetOrder(Id); + + order.OrderStatus = updatedOrder.OrderStatus; + orderService.UpdateOrder(order); + + return RedirectToAction("Index"); + } + } +} \ No newline at end of file diff --git a/MyShop/MyShop.WebUI/MyShop.WebUI.csproj b/MyShop/MyShop.WebUI/MyShop.WebUI.csproj index 4013151..028bf63 100644 --- a/MyShop/MyShop.WebUI/MyShop.WebUI.csproj +++ b/MyShop/MyShop.WebUI/MyShop.WebUI.csproj @@ -208,9 +208,11 @@ + + @@ -306,6 +308,10 @@ + + + + diff --git a/MyShop/MyShop.WebUI/Views/Admin/Index.cshtml b/MyShop/MyShop.WebUI/Views/Admin/Index.cshtml new file mode 100644 index 0000000..8138965 --- /dev/null +++ b/MyShop/MyShop.WebUI/Views/Admin/Index.cshtml @@ -0,0 +1,20 @@ +@{ + ViewBag.Title = "Admin"; +} + +

Admin Pages

+ +
+

Product Management

+
+ @Html.ActionLink("Product Categories", "Index", "ProductCategoryManager", null, new { @class="list-group-item" }) + @Html.ActionLink("Product", "Index", "ProductManager", null, new { @class = "list-group-item" }) +
+
+
+

Order Management

+
+ @Html.ActionLink("Orders", "Index", "OrderManager", null, new { @class = "list-group-item" }) +
+
+
diff --git a/MyShop/MyShop.WebUI/Views/OrderManager/Index.cshtml b/MyShop/MyShop.WebUI/Views/OrderManager/Index.cshtml new file mode 100644 index 0000000..66c0497 --- /dev/null +++ b/MyShop/MyShop.WebUI/Views/OrderManager/Index.cshtml @@ -0,0 +1,48 @@ +@model IEnumerable + + + + + + + + + + + + +@foreach (var item in Model) { + + + + + + + + + +} + +
+ @Html.DisplayNameFor(model => model.CreatedAt) + + @Html.DisplayNameFor(model => model.FirstName) + + @Html.DisplayNameFor(model => model.Surname) + + @Html.DisplayNameFor(model => model.Email) + + @Html.DisplayNameFor(model => model.OrderStatus) +
+ @Html.DisplayFor(modelItem => item.CreatedAt) + + @Html.DisplayFor(modelItem => item.FirstName) + + @Html.DisplayFor(modelItem => item.Surname) + + @Html.DisplayFor(modelItem => item.Email) + + @Html.DisplayFor(modelItem => item.OrderStatus) + + @Html.ActionLink("Manage Order", "UpdateOrder", new { id=item.Id }) +
diff --git a/MyShop/MyShop.WebUI/Views/OrderManager/OrderItems.cshtml b/MyShop/MyShop.WebUI/Views/OrderManager/OrderItems.cshtml new file mode 100644 index 0000000..76b0f4b --- /dev/null +++ b/MyShop/MyShop.WebUI/Views/OrderManager/OrderItems.cshtml @@ -0,0 +1,45 @@ +@model IEnumerable + + + + + + + + + + +@foreach (var item in Model) { + + + + + + + +} + + + + + + +
+ @Html.DisplayNameFor(model => model.ProductName) + + @Html.DisplayNameFor(model => model.Price) + + @Html.DisplayNameFor(model => model.Quanity) + Line Order
+ @Html.DisplayFor(modelItem => item.ProductName) + + @Html.DisplayFor(modelItem => item.Price) + + @Html.DisplayFor(modelItem => item.Quanity) + + @String.Format("{0:c}", item.Price * item.Quanity) +
+ Order Total + + @String.Format("{0:c}", (from p in Model select p.Quanity * p.Price).Sum()) +
diff --git a/MyShop/MyShop.WebUI/Views/OrderManager/UpdateOrder.cshtml b/MyShop/MyShop.WebUI/Views/OrderManager/UpdateOrder.cshtml new file mode 100644 index 0000000..5ef5889 --- /dev/null +++ b/MyShop/MyShop.WebUI/Views/OrderManager/UpdateOrder.cshtml @@ -0,0 +1,91 @@ +@model MyShop.Core.Models.Order + +@using (Html.BeginForm()) +{ + @Html.AntiForgeryToken() + +
+

Order

+
+ @Html.HiddenFor(model => model.Id) + +
+
+ @Html.LabelFor(model => model.OrderStatus, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.DropDownListFor(model => model.OrderStatus, new SelectList(ViewBag.StatusList), new { @class = "form-control" }) +
+
+ +
+ @Html.LabelFor(model => model.CreatedAt, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.DisplayFor(model => model.CreatedAt, new { htmlAttributes = new { @class = "form-control" } }) +
+
+ +
+ @Html.LabelFor(model => model.FirstName, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.DisplayFor(model => model.FirstName, new { htmlAttributes = new { @class = "form-control" } }) +
+
+ +
+ @Html.LabelFor(model => model.Surname, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.DisplayFor(model => model.Surname, new { htmlAttributes = new { @class = "form-control" } }) +
+
+ +
+ @Html.LabelFor(model => model.Email, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.DisplayFor(model => model.Email, new { htmlAttributes = new { @class = "form-control" } }) +
+
+ +
+
+
+ @Html.LabelFor(model => model.Street, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.DisplayFor(model => model.Street, new { htmlAttributes = new { @class = "form-control" } }) +
+
+ +
+ @Html.LabelFor(model => model.City, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.DisplayFor(model => model.City, new { htmlAttributes = new { @class = "form-control" } }) +
+
+ +
+ @Html.LabelFor(model => model.State, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.DisplayFor(model => model.State, new { htmlAttributes = new { @class = "form-control" } }) +
+
+ +
+ @Html.LabelFor(model => model.ZipCode, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.DisplayFor(model => model.ZipCode, new { htmlAttributes = new { @class = "form-control" } }) +
+
+
+ +
+
+ +
+
+
+ + @Html.Partial("OrderItems", Model.OrderItems) +} + +
+ @Html.ActionLink("Back to List", "Index") +
diff --git a/MyShop/MyShop.WebUI/Views/Shared/_Layout.cshtml b/MyShop/MyShop.WebUI/Views/Shared/_Layout.cshtml index 7a5ce9c..9a0c45b 100644 --- a/MyShop/MyShop.WebUI/Views/Shared/_Layout.cshtml +++ b/MyShop/MyShop.WebUI/Views/Shared/_Layout.cshtml @@ -22,8 +22,7 @@
@@ -46,4 +41,4 @@ @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", required: false) - + \ No newline at end of file From 99c53e6fa0d8e5dc9e802be23a8c579f310b0969 Mon Sep 17 00:00:00 2001 From: carinedj Date: Thu, 19 Sep 2024 15:36:48 +0200 Subject: [PATCH 13/13] CustomerModel changes --- MyShop/MyShop.DataAccess.SQL/DataContext.cs | 7 +- .../Migrations/202409170919450_Initial.cs | 43 ------ .../202409191004213_AddCustomer.Designer.cs | 29 ++++ .../Migrations/202409191004213_AddCustomer.cs | 16 +++ ....resx => 202409191004213_AddCustomer.resx} | 2 +- ...cs => 202409191228545_Initial.Designer.cs} | 2 +- .../Migrations/202409191228545_Initial.cs | 16 +++ .../Migrations/202409191228545_Initial.resx | 126 ++++++++++++++++++ .../MyShop.DataAccess.SQL.csproj | 21 ++- 9 files changed, 207 insertions(+), 55 deletions(-) delete mode 100644 MyShop/MyShop.DataAccess.SQL/Migrations/202409170919450_Initial.cs create mode 100644 MyShop/MyShop.DataAccess.SQL/Migrations/202409191004213_AddCustomer.Designer.cs create mode 100644 MyShop/MyShop.DataAccess.SQL/Migrations/202409191004213_AddCustomer.cs rename MyShop/MyShop.DataAccess.SQL/Migrations/{202409170919450_Initial.resx => 202409191004213_AddCustomer.resx} (70%) rename MyShop/MyShop.DataAccess.SQL/Migrations/{202409170919450_Initial.Designer.cs => 202409191228545_Initial.Designer.cs} (93%) create mode 100644 MyShop/MyShop.DataAccess.SQL/Migrations/202409191228545_Initial.cs create mode 100644 MyShop/MyShop.DataAccess.SQL/Migrations/202409191228545_Initial.resx diff --git a/MyShop/MyShop.DataAccess.SQL/DataContext.cs b/MyShop/MyShop.DataAccess.SQL/DataContext.cs index b71d2d3..70cc391 100644 --- a/MyShop/MyShop.DataAccess.SQL/DataContext.cs +++ b/MyShop/MyShop.DataAccess.SQL/DataContext.cs @@ -11,7 +11,8 @@ namespace MyShop.DataAccess.SQL public class DataContext : DbContext { public DataContext() - : base("DefaultConnection") { + : base("DefaultConnection") + { } @@ -19,8 +20,8 @@ public DataContext() public DbSet ProductCategories { get; set; } public DbSet Baskets { get; set; } public DbSet BasketItems { get; set; } - //public DbSet Customers { get; set; } + public DbSet Customers { get; set; } //public DbSet Orders { get; set; } //public DbSet OrderItems { get; set; } } -} +} \ No newline at end of file diff --git a/MyShop/MyShop.DataAccess.SQL/Migrations/202409170919450_Initial.cs b/MyShop/MyShop.DataAccess.SQL/Migrations/202409170919450_Initial.cs deleted file mode 100644 index 4560e16..0000000 --- a/MyShop/MyShop.DataAccess.SQL/Migrations/202409170919450_Initial.cs +++ /dev/null @@ -1,43 +0,0 @@ -namespace MyShop.DataAccess.SQL.Migrations -{ - using System; - using System.Data.Entity.Migrations; - - public partial class Initial : DbMigration - { - public override void Up() - { - CreateTable( - "dbo.BasketItems", - c => new - { - Id = c.String(nullable: false, maxLength: 128), - BasketId = c.String(maxLength: 128), - ProductId = c.String(), - Quanity = c.Int(nullable: false), - CreatedAt = c.DateTimeOffset(nullable: false, precision: 7), - }) - .PrimaryKey(t => t.Id) - .ForeignKey("dbo.Baskets", t => t.BasketId) - .Index(t => t.BasketId); - - CreateTable( - "dbo.Baskets", - c => new - { - Id = c.String(nullable: false, maxLength: 128), - CreatedAt = c.DateTimeOffset(nullable: false, precision: 7), - }) - .PrimaryKey(t => t.Id); - - } - - public override void Down() - { - DropForeignKey("dbo.BasketItems", "BasketId", "dbo.Baskets"); - DropIndex("dbo.BasketItems", new[] { "BasketId" }); - DropTable("dbo.Baskets"); - DropTable("dbo.BasketItems"); - } - } -} diff --git a/MyShop/MyShop.DataAccess.SQL/Migrations/202409191004213_AddCustomer.Designer.cs b/MyShop/MyShop.DataAccess.SQL/Migrations/202409191004213_AddCustomer.Designer.cs new file mode 100644 index 0000000..f50cb3e --- /dev/null +++ b/MyShop/MyShop.DataAccess.SQL/Migrations/202409191004213_AddCustomer.Designer.cs @@ -0,0 +1,29 @@ +// +namespace MyShop.DataAccess.SQL.Migrations +{ + using System.CodeDom.Compiler; + using System.Data.Entity.Migrations; + using System.Data.Entity.Migrations.Infrastructure; + using System.Resources; + + [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")] + public sealed partial class AddCustomer : IMigrationMetadata + { + private readonly ResourceManager Resources = new ResourceManager(typeof(AddCustomer)); + + string IMigrationMetadata.Id + { + get { return "202409191004213_AddCustomer"; } + } + + string IMigrationMetadata.Source + { + get { return null; } + } + + string IMigrationMetadata.Target + { + get { return Resources.GetString("Target"); } + } + } +} diff --git a/MyShop/MyShop.DataAccess.SQL/Migrations/202409191004213_AddCustomer.cs b/MyShop/MyShop.DataAccess.SQL/Migrations/202409191004213_AddCustomer.cs new file mode 100644 index 0000000..4fb6bff --- /dev/null +++ b/MyShop/MyShop.DataAccess.SQL/Migrations/202409191004213_AddCustomer.cs @@ -0,0 +1,16 @@ +namespace MyShop.DataAccess.SQL.Migrations +{ + using System; + using System.Data.Entity.Migrations; + + public partial class AddCustomer : DbMigration + { + public override void Up() + { + } + + public override void Down() + { + } + } +} diff --git a/MyShop/MyShop.DataAccess.SQL/Migrations/202409170919450_Initial.resx b/MyShop/MyShop.DataAccess.SQL/Migrations/202409191004213_AddCustomer.resx similarity index 70% rename from MyShop/MyShop.DataAccess.SQL/Migrations/202409170919450_Initial.resx rename to MyShop/MyShop.DataAccess.SQL/Migrations/202409191004213_AddCustomer.resx index ab9f8cd..f458e03 100644 --- a/MyShop/MyShop.DataAccess.SQL/Migrations/202409170919450_Initial.resx +++ b/MyShop/MyShop.DataAccess.SQL/Migrations/202409191004213_AddCustomer.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - H4sIAAAAAAAEAO1aW2/bNhR+H7D/IOhpG1LLcR/WBXaL1EkGY7k1Sou9FYxEO0QpUiOpwMawX7aH/aT9hR3qZknUzY7jJkNRoLB4+Xh4zncOyXPy79//jN8tA2o9YCEJZxP7cDC0Lcw87hO2mNiRmr96Y797+/1341M/WFqfsnGv9TiYyeTEvlcqPHIc6d3jAMlBQDzBJZ+rgccDB/ncGQ2HvziHhw4GCBuwLGt8EzFFAhx/wOeUMw+HKkL0gvuYyrQdetwY1bpEAZYh8vDEvli59zwcnCCFjj0PSzlwP5zb1jElCIRxMZ3bFmKMK6RA1KOPErtKcLZwQ2hA9HYVYhg3R1TidAtH6+F9dzMc6d0464kZlBdJxYMNAQ9fp+pxqtO3UrKdqw8UeAqKViu961iJE/s9kl+wmikc2FZ1uaMpFXporuUpF3iQ2GSwnnhgFboPclYAefS/A2saURUJPGE4UgLRA+s6uqPE+w2vbvkXzCYsorQoJIgJfaUGaLoWP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OhLNkpI2Rt3VGkXKYMJDV3xyqylTJU0dodKU1HyjBpU3eMLNkog2RtPfxACXRmzyiXJgrLbMRN3THyNKCMkjd+k16tnmE39+7qmbe/k69E2FE0zk/pJbU1nN2/LQvYouLXV/i+FK2Gz76hs5Rkk4FKHX0OjnEirXxojJuew3zTfFhJwEnTAbuAcjOsDsmp5zfEyk1wnN7KVldCKde0ZEiUGvWfiBNd0awlhytO7EID60/XdAmstxhwBef8GeYiyYvro+HxqFJJ9fVUNRmcO27n0qa9p/fpE2L2I2Jqgn/D4qECWEmNTamDFxP9r3jmiTb9Pct2OEfaDQP9nmhD7e82jtYqMso4+sFDix/7olUKiQjtUDSyKsXtwGdUTuinKW7paeDnLRcVHa5dPYvU6i9SByW3ciHKRravFJtshFYtKNkIrFQ0shFSuTBkIyi5+GNDnqQCj42QKkUcmy3vOTyy9dZzUI5Zfbg9WF0csA7q4o9SbNBPEzWVBRtptlQ94Oy6emAjVksVAl+9OW+hJmBbBQDJe+7+X/z397zf8Mz1Vb7nq8+HDTmimv9IaX2wT+63YMwPPmg7Mdi2B9x6Qi0P+s0EVoMXL/otj/11BKQygV61AMsulQB1BGtKCroRbqsXaCGk4u+3mqDmwb9D5YBsj9Un451UCqh5H/BM6f/kIDJwMi8gov+ao9gu+WQ+ZkpnfhYcKhxlQypbxhUWyIlSrUyQGbIFdEc517hK7RNyw/iS8ICdKb0JRRAKWDL2HtxSyi8KMW3043KIMs/jm3ir59tYArBJoo3uhr4PievkfF/UbGoNEFHs+hVDe6JLCIXgJMsc6dqnHYFS8eUh9x57gQtg/IZa6AmvwxvcRC/xHNnLLH3XDLJaEWWxj88ImjPk8RSjmA+fYMOOt3j7P0sUqHcuOgAA dbo diff --git a/MyShop/MyShop.DataAccess.SQL/Migrations/202409170919450_Initial.Designer.cs b/MyShop/MyShop.DataAccess.SQL/Migrations/202409191228545_Initial.Designer.cs similarity index 93% rename from MyShop/MyShop.DataAccess.SQL/Migrations/202409170919450_Initial.Designer.cs rename to MyShop/MyShop.DataAccess.SQL/Migrations/202409191228545_Initial.Designer.cs index c133c6f..37f5aa2 100644 --- a/MyShop/MyShop.DataAccess.SQL/Migrations/202409170919450_Initial.Designer.cs +++ b/MyShop/MyShop.DataAccess.SQL/Migrations/202409191228545_Initial.Designer.cs @@ -13,7 +13,7 @@ public sealed partial class Initial : IMigrationMetadata string IMigrationMetadata.Id { - get { return "202409170919450_Initial"; } + get { return "202409191228545_Initial"; } } string IMigrationMetadata.Source diff --git a/MyShop/MyShop.DataAccess.SQL/Migrations/202409191228545_Initial.cs b/MyShop/MyShop.DataAccess.SQL/Migrations/202409191228545_Initial.cs new file mode 100644 index 0000000..55da6cf --- /dev/null +++ b/MyShop/MyShop.DataAccess.SQL/Migrations/202409191228545_Initial.cs @@ -0,0 +1,16 @@ +namespace MyShop.DataAccess.SQL.Migrations +{ + using System; + using System.Data.Entity.Migrations; + + public partial class Initial : DbMigration + { + public override void Up() + { + } + + public override void Down() + { + } + } +} diff --git a/MyShop/MyShop.DataAccess.SQL/Migrations/202409191228545_Initial.resx b/MyShop/MyShop.DataAccess.SQL/Migrations/202409191228545_Initial.resx new file mode 100644 index 0000000..f458e03 --- /dev/null +++ b/MyShop/MyShop.DataAccess.SQL/Migrations/202409191228545_Initial.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + H4sIAAAAAAAEAO1bW2/bNhR+H7D/IOhpG1LLcR/WBXaLVEkGY7k1SothLwUj0Q5RidJIKrAx7JftYT9pf2FHd0qUZMm31EWQF4uX7xyeG8nDk//++Xf8buG52hNmnPh0oh8PhrqGqe07hM4neihmr97o795+/9343PEW2qds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IMs/jm3ir59tYArBJoo3uhr4PievkfF/UbGoNEFHs+hVDe6JLCIXgJMsc6dqnHYFS8eUh9x57gQtg/IZa6AmvwxvcRC/xHNnLLH3XDLJaEWWxj88ImjPk8RSjmA+fYMOOt3j7P0sUqHcuOgAA + + + dbo + + \ No newline at end of file diff --git a/MyShop/MyShop.DataAccess.SQL/MyShop.DataAccess.SQL.csproj b/MyShop/MyShop.DataAccess.SQL/MyShop.DataAccess.SQL.csproj index 28b284f..feb4a3f 100644 --- a/MyShop/MyShop.DataAccess.SQL/MyShop.DataAccess.SQL.csproj +++ b/MyShop/MyShop.DataAccess.SQL/MyShop.DataAccess.SQL.csproj @@ -48,14 +48,18 @@ - - - 202409170919450_Initial.cs - 202409170922120_AddBasket.cs + + + 202409191004213_AddCustomer.cs + + + + 202409191228545_Initial.cs + @@ -71,12 +75,15 @@ - - 202409170919450_Initial.cs - 202409170922120_AddBasket.cs + + 202409191004213_AddCustomer.cs + + + 202409191228545_Initial.cs + \ No newline at end of file