ПИбд-23 Захаров Ростислав Андреевич Лабораторная работа №5 усложненная #15

Closed
Zakharov_Rostislav wants to merge 34 commits from lab-5-hard into lab-5
2 changed files with 5 additions and 10 deletions
Showing only changes of commit 7ab5b36b0b - Show all commits

View File

@ -76,16 +76,11 @@ namespace BlacksmithWorkshopRestApi.Controllers
}
[HttpPost]
public bool DeleteShop(ShopSearchModel model)
{
var elem = _logic.ReadElement(model);
if (elem == null)
return false;
try
public bool DeleteShop(ShopBindingModel model)
{
try
{
return _logic.Delete(new ShopBindingModel { Id = elem.Id, Address = elem.Address,
MaxCapacity = elem.MaxCapacity, OpeningDate = elem.OpeningDate,
ShopName = elem.ShopName, ShopManufactures = elem.ShopManufactures});
return _logic.Delete(model);
}
catch (Exception ex)
{

View File

@ -89,7 +89,7 @@ namespace BlacksmithWorkshopShopApp.Controllers
{
throw new Exception("Вы как сюда попали? Сюда вход только авторизованным");
}
ApiClient.PostRequest("api/shop/deleteshop", new ShopSearchModel
ApiClient.PostRequest("api/shop/deleteshop", new ShopBindingModel
{
Id = shop
});