diff --git a/ElectronicsShop/ElectronicsShopDataBaseImplement/DataBase.cs b/ElectronicsShop/ElectronicsShopDataBaseImplement/DataBase.cs index 247925f..2830f99 100644 --- a/ElectronicsShop/ElectronicsShopDataBaseImplement/DataBase.cs +++ b/ElectronicsShop/ElectronicsShopDataBaseImplement/DataBase.cs @@ -12,7 +12,7 @@ namespace ElectronicsShopDataBaseImplement optionsBuilder) { if (optionsBuilder.IsConfigured == false) { - optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-E2VPEN3\SQLEXPRESS;Initial Catalog=ElectronicsShopDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); + optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-O0N00SH\SQLEXPRESS;Initial Catalog=ElectronicsShopDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); } base.OnConfiguring(optionsBuilder); } diff --git a/ElectronicsShop/ElectronicsShopDataBaseImplement/Models/Order.cs b/ElectronicsShop/ElectronicsShopDataBaseImplement/Models/Order.cs index 3eefb25..8404e5e 100644 --- a/ElectronicsShop/ElectronicsShopDataBaseImplement/Models/Order.cs +++ b/ElectronicsShop/ElectronicsShopDataBaseImplement/Models/Order.cs @@ -86,7 +86,7 @@ namespace ElectronicsShopDataBaseImplement.Models } context.SaveChanges(); } - var order = context.Orders.First(x => x.ID == model.ID); + var order = context.Orders.FirstOrDefault(x => x.ID == model.ID); order.Sum = model.Sum; foreach (var op in model.ProductList) { context.OrderProducts.Add(new OrderProduct { diff --git a/ElectronicsShop/ElectronicsShopShopClientApp/Controllers/HomeController.cs b/ElectronicsShop/ElectronicsShopShopClientApp/Controllers/HomeController.cs index 645b955..828265e 100644 --- a/ElectronicsShop/ElectronicsShopShopClientApp/Controllers/HomeController.cs +++ b/ElectronicsShop/ElectronicsShopShopClientApp/Controllers/HomeController.cs @@ -135,7 +135,7 @@ namespace ElectronicsShopUserApp.Controllers { } if (id == 0) { - return Redirect("Orders"); + return RedirectToAction("Orders"); } var products = APIClient.GetRequset>>($"api/main/getorderproducts?_orderid={id}"); diff --git a/ElectronicsShop/ElectronicsShopShopClientApp/Views/Home/EditOrder.cshtml b/ElectronicsShop/ElectronicsShopShopClientApp/Views/Home/EditOrder.cshtml index fa75e9a..eb068ac 100644 --- a/ElectronicsShop/ElectronicsShopShopClientApp/Views/Home/EditOrder.cshtml +++ b/ElectronicsShop/ElectronicsShopShopClientApp/Views/Home/EditOrder.cshtml @@ -43,7 +43,7 @@ Количество - Сумма + Цена за единицу товара diff --git a/ElectronicsShop/ElectronicsShopShopClientApp/Views/Home/OrderView.cshtml b/ElectronicsShop/ElectronicsShopShopClientApp/Views/Home/OrderView.cshtml index 717fadf..b3d3eda 100644 --- a/ElectronicsShop/ElectronicsShopShopClientApp/Views/Home/OrderView.cshtml +++ b/ElectronicsShop/ElectronicsShopShopClientApp/Views/Home/OrderView.cshtml @@ -43,7 +43,7 @@ Количество - Сумма + Цена за единицу товара