fix
This commit is contained in:
parent
4178c24cd2
commit
9bdb960b80
@ -85,10 +85,7 @@ namespace FoodOrdersDatabaseImplement.Implements
|
|||||||
}
|
}
|
||||||
updateShop.Update(model);
|
updateShop.Update(model);
|
||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
if (model.ShopDishes.Count != 0)
|
updateShop.UpdateDish(context, model);
|
||||||
{
|
|
||||||
updateShop.UpdateDish(context, model);
|
|
||||||
}
|
|
||||||
transaction.Commit();
|
transaction.Commit();
|
||||||
return updateShop.GetViewModel;
|
return updateShop.GetViewModel;
|
||||||
}
|
}
|
||||||
|
@ -76,17 +76,46 @@ namespace FoodOrdersRestApi.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void UpdateShop(ShopBindingModel model) => CRUDShop(() => _logic.Update(model));
|
public void CreateShop(ShopBindingModel model)
|
||||||
[HttpPost]
|
{
|
||||||
public void CreateShop(ShopBindingModel model) => CRUDShop(() => _logic.Create(model));
|
try
|
||||||
[HttpPost]
|
{
|
||||||
public void DeleteShop(ShopBindingModel model) => CRUDShop(() => _logic.Delete(model));
|
_logic.Update(model);
|
||||||
|
}
|
||||||
[HttpPost]
|
catch (Exception ex)
|
||||||
public void AddDishInShop(Tuple<ShopSearchModel, DishViewModel, int> countDishForShop)
|
{
|
||||||
{
|
_logger.LogError(ex, "Ошибка обновления данных");
|
||||||
CRUDShop(() => _logic.DeliveryDishes(countDishForShop.Item1, countDishForShop.Item2, countDishForShop.Item3));
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
[HttpPost]
|
||||||
|
public void DeleteShop(ShopBindingModel model)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_logic.Create(model);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Ошибка удаления магазина");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public void AddDishInShop(Tuple<ShopSearchModel, DishViewModel, int> model)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_logic.DeliveryDishes(model.Item1, model.Item2, model.Item3);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Ошибка добавления суши в магазин");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user