ПИбд-23 Захаров Ростислав Андреевич Лабораторная работа №5 усложненная #15
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user