This commit is contained in:
Игорь Гордеев 2024-06-01 03:40:00 +04:00
commit 277588130b
5 changed files with 5 additions and 5 deletions

View File

@ -12,7 +12,7 @@ namespace ElectronicsShopDataBaseImplement
optionsBuilder) optionsBuilder)
{ {
if (optionsBuilder.IsConfigured == false) { 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); base.OnConfiguring(optionsBuilder);
} }

View File

@ -86,7 +86,7 @@ namespace ElectronicsShopDataBaseImplement.Models
} }
context.SaveChanges(); 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; order.Sum = model.Sum;
foreach (var op in model.ProductList) { foreach (var op in model.ProductList) {
context.OrderProducts.Add(new OrderProduct { context.OrderProducts.Add(new OrderProduct {

View File

@ -135,7 +135,7 @@ namespace ElectronicsShopUserApp.Controllers {
} }
if (id == 0) { if (id == 0) {
return Redirect("Orders"); return RedirectToAction("Orders");
} }
var products = APIClient.GetRequset<List<List<string>>>($"api/main/getorderproducts?_orderid={id}"); var products = APIClient.GetRequset<List<List<string>>>($"api/main/getorderproducts?_orderid={id}");

View File

@ -43,7 +43,7 @@
Количество Количество
</th> </th>
<th> <th>
Сумма Цена за единицу товара
</th> </th>
</tr> </tr>
</thead> </thead>

View File

@ -43,7 +43,7 @@
Количество Количество
</th> </th>
<th> <th>
Сумма Цена за единицу товара
</th> </th>
</tr> </tr>
</thead> </thead>