Почти все

This commit is contained in:
gg12 darfren 2024-04-14 16:06:36 +04:00
parent 1391904949
commit 8ee189b6c2
4 changed files with 9 additions and 6 deletions

View File

@ -10,8 +10,8 @@ namespace IceCreamShopContracts.BindingModels
public class ShopBindingModel : IShopModel public class ShopBindingModel : IShopModel
{ {
public int Id { get; set; } public int Id { get; set; }
public string ShopName { get; set; } public string ShopName { get; set; } = string.Empty;
public string Address { get; set; } public string Address { get; set; } = string.Empty;
public DateTime DateOpen { get; set; } public DateTime DateOpen { get; set; }
public int MaxCapacity { get; set; } public int MaxCapacity { get; set; }
public Dictionary<int, (IIceCreamModel, int)> ShopIceCreams { get; set; } = new(); public Dictionary<int, (IIceCreamModel, int)> ShopIceCreams { get; set; } = new();

View File

@ -83,13 +83,13 @@ namespace IceCreamShopRestApi.Controllers
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Не удалось удалить магазин"); _logger.LogError(ex, "Ошибка удаления магазина");
throw; throw;
} }
} }
[HttpPost] [HttpPost]
public bool MakeSupply(Tuple<ShopSearchModel, IIceCreamModel, int> model) public bool MakeSupply(Tuple<ShopSearchModel, IceCreamViewModel, int> model)
{ {
try try
{ {

View File

@ -27,6 +27,7 @@ namespace IceCreamShopsApp.Controllers
} }
[HttpGet] [HttpGet]
public IActionResult Enter() public IActionResult Enter()
{ {
@ -57,6 +58,8 @@ namespace IceCreamShopsApp.Controllers
return View(); return View();
} }
[HttpPost] [HttpPost]
public void Create(string name, string address, DateTime dateOpen, int maxCapacity) public void Create(string name, string address, DateTime dateOpen, int maxCapacity)
{ {
@ -184,7 +187,7 @@ namespace IceCreamShopsApp.Controllers
{ {
throw new Exception("Вы как сюда попали? Сюда вход только авторизованным"); throw new Exception("Вы как сюда попали? Сюда вход только авторизованным");
} }
ApiClient.PostRequest("api/shop/AddIceCreamInShop", Tuple.Create( ApiClient.PostRequest("api/shop/makesupply", Tuple.Create(
new ShopSearchModel() { Id = shop }, new ShopSearchModel() { Id = shop },
new IceCreamViewModel() { Id = icecream }, new IceCreamViewModel() { Id = icecream },
count count

View File

@ -18,7 +18,7 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-4">Мороженое:</div> <div class="col-4">Мороженное:</div>
<div class="col-8"> <div class="col-8">
<select id="icecream" name="icecream" class="form-control" asp-items="@(new SelectList(@ViewBag.ListIceCream, "Id", "IceCreamName"))"></select> <select id="icecream" name="icecream" class="form-control" asp-items="@(new SelectList(@ViewBag.ListIceCream, "Id", "IceCreamName"))"></select>
</div> </div>