Лабораторная_7
This commit is contained in:
parent
af3261f0cb
commit
6bdc77b685
@ -13,8 +13,7 @@ namespace RenovationWorkClientApp
|
|||||||
{
|
{
|
||||||
_client.BaseAddress = new Uri(configuration["IPAddress"]);
|
_client.BaseAddress = new Uri(configuration["IPAddress"]);
|
||||||
_client.DefaultRequestHeaders.Accept.Clear();
|
_client.DefaultRequestHeaders.Accept.Clear();
|
||||||
_client.DefaultRequestHeaders.Accept.Add(new
|
_client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
|
||||||
MediaTypeWithQualityHeaderValue("application/json"));
|
|
||||||
}
|
}
|
||||||
public static T? GetRequest<T>(string requestUrl)
|
public static T? GetRequest<T>(string requestUrl)
|
||||||
{
|
{
|
||||||
|
@ -125,8 +125,7 @@ namespace RenovationWorkClientApp.Controllers
|
|||||||
{
|
{
|
||||||
throw new Exception("Количество и сумма должны быть\r\nбольше 0");
|
throw new Exception("Количество и сумма должны быть\r\nбольше 0");
|
||||||
}
|
}
|
||||||
APIClient.PostRequest("api/main/createorder", new
|
APIClient.PostRequest("api/main/createorder", new OrderBindingModel
|
||||||
OrderBindingModel
|
|
||||||
{
|
{
|
||||||
ClientId = APIClient.Client.Id,
|
ClientId = APIClient.Client.Id,
|
||||||
RepairId = repair,
|
RepairId = repair,
|
||||||
@ -148,8 +147,7 @@ namespace RenovationWorkClientApp.Controllers
|
|||||||
{
|
{
|
||||||
return Redirect("~/Home/Enter");
|
return Redirect("~/Home/Enter");
|
||||||
}
|
}
|
||||||
return
|
return View(APIClient.GetRequest<List<MessageInfoViewModel>>($"api/client/getmessages?clientId={APIClient.Client.Id}"));
|
||||||
View(APIClient.GetRequest<List<MessageInfoViewModel>>($"api/client/getmessages?clientId={APIClient.Client.Id}"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -55,10 +55,7 @@ namespace RenovationWorkRestApi.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return _mailLogic.ReadList(new MessageInfoSearchModel
|
return _mailLogic.ReadList(new MessageInfoSearchModel{ ClientId = clientId });
|
||||||
{
|
|
||||||
ClientId = clientId
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user