супер

This commit is contained in:
ArtemEmelyanov 2023-05-05 14:56:04 +04:00
parent ac4e4b254e
commit dd808b4e5f
2 changed files with 3 additions and 3 deletions

View File

@ -79,7 +79,7 @@ namespace FishFactoryDatabaseImplement.Implements
} }
shop.Update(model); shop.Update(model);
context.SaveChanges(); context.SaveChanges();
shop.UpdateSushi(context, model); shop.UpdateCanneds(context, model);
transaction.Commit(); transaction.Commit();
return shop.GetViewModel; return shop.GetViewModel;
} }
@ -129,7 +129,7 @@ namespace FishFactoryDatabaseImplement.Implements
{ {
shop.ListCanneds[model.Id] = (shop.ListCanneds[model.Id].Item1, countInCurrentShop - count); shop.ListCanneds[model.Id] = (shop.ListCanneds[model.Id].Item1, countInCurrentShop - count);
count = 0; count = 0;
shop.UpdateSushi(context, new() shop.UpdateCanneds(context, new()
{ {
Id = shop.Id, Id = shop.Id,
ListCanneds = shop.ListCanneds, ListCanneds = shop.ListCanneds,

View File

@ -77,7 +77,7 @@ namespace FishFactoryDatabaseImplement.Models
ListCanneds = ListCanneds ListCanneds = ListCanneds
}; };
public void UpdateSushi(FishFactoryDatabase context, ShopBindingModel model) public void UpdateCanneds(FishFactoryDatabase context, ShopBindingModel model)
{ {
var shopCanned = context.ShopCanned.Where(rec => rec.ShopId == model.Id).ToList(); var shopCanned = context.ShopCanned.Where(rec => rec.ShopId == model.Id).ToList();
if (shopCanned != null && shopCanned.Count > 0) if (shopCanned != null && shopCanned.Count > 0)