lab-5-hard preparing for pr
This commit is contained in:
parent
9bda41c11f
commit
caaf612951
@ -15,7 +15,7 @@ namespace BlacksmithWorkshopShopApp
|
||||
_client.BaseAddress = new Uri(configuration["IPAddress"]);
|
||||
_client.DefaultRequestHeaders.Accept.Clear();
|
||||
_client.DefaultRequestHeaders.Accept.Add(new
|
||||
MediaTypeWithQualityHeaderValue("application/json"));
|
||||
MediaTypeWithQualityHeaderValue("application/json"));
|
||||
}
|
||||
public static T? GetRequest<T>(string requestUrl)
|
||||
{
|
||||
|
@ -20,8 +20,7 @@ namespace BlacksmithWorkshopShopApp.Controllers
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
return
|
||||
View(ApiClient.GetRequest<List<ShopViewModel>>($"api/shop/getshops"));
|
||||
return View(ApiClient.GetRequest<List<ShopViewModel>>($"api/shop/getshops"));
|
||||
|
||||
}
|
||||
[HttpGet]
|
||||
@ -147,10 +146,10 @@ namespace BlacksmithWorkshopShopApp.Controllers
|
||||
result.Item1.ShopManufactures.Clear();
|
||||
for (int i = 0; i < result.Item2.Count; i++)
|
||||
{
|
||||
var icecream = result.Item2[i].Item1;
|
||||
var manufacture = result.Item2[i].Item1;
|
||||
var count = result.Item2[i].Item2;
|
||||
table += "<tr>";
|
||||
table += $"<td>{icecream}</td>";
|
||||
table += $"<td>{manufacture}</td>";
|
||||
table += $"<td>{count}</td>";
|
||||
table += "</tr>";
|
||||
}
|
||||
@ -167,7 +166,7 @@ namespace BlacksmithWorkshopShopApp.Controllers
|
||||
return View();
|
||||
}
|
||||
[HttpPost]
|
||||
public void MakeSupply(int shop, int icecream, int count)
|
||||
public void MakeSupply(int shop, int manufacture, int count)
|
||||
{
|
||||
if (ApiClient.Access == false)
|
||||
{
|
||||
@ -175,7 +174,7 @@ namespace BlacksmithWorkshopShopApp.Controllers
|
||||
}
|
||||
ApiClient.PostRequest("api/shop/makesupply", Tuple.Create(
|
||||
new ShopSearchModel() { Id = shop },
|
||||
new ManufactureViewModel() { Id = icecream },
|
||||
new ManufactureViewModel() { Id = manufacture },
|
||||
count
|
||||
));
|
||||
Response.Redirect("Index");
|
||||
|
@ -20,7 +20,7 @@
|
||||
<div class="row">
|
||||
<div class="col-4">Кузнечное изделие:</div>
|
||||
<div class="col-8">
|
||||
<select id="icecream" name="icecream" class="form-control" asp-items="@(new SelectList(@ViewBag.ListManufacture, "Id", "ManufactureName"))"></select>
|
||||
<select id="manufacture" name="manufacture" class="form-control" asp-items="@(new SelectList(@ViewBag.ListManufacture, "Id", "ManufactureName"))"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
Loading…
Reference in New Issue
Block a user