From 1eea7331e4050b0d8c032a9a1b057f4b57e73475 Mon Sep 17 00:00:00 2001 From: ksenianeva <95441235+ksenianeva@users.noreply.github.com> Date: Fri, 28 Apr 2023 10:09:23 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=205.=20=D0=95=D1=89=D0=B5=20=D1=80=D0=B0=D0=B7=20=D0=B2?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=20=D1=82=D0=B5=D0=BA?= =?UTF-8?q?=D1=81=D1=82=20HomeController=20(=D1=84=D0=B8=D0=BA=D1=81=20?= =?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D1=89=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D1=8B=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=BA=D0=B0=D0=B7=D0=BE=D0=B2=20=D0=B2=20ClientAPI?= =?UTF-8?q?).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/HomeController.cs | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/TravelCompany/TravelCompanyClientApp/Controllers/HomeController.cs b/TravelCompany/TravelCompanyClientApp/Controllers/HomeController.cs index f2a5f26..2ecf9d6 100644 --- a/TravelCompany/TravelCompanyClientApp/Controllers/HomeController.cs +++ b/TravelCompany/TravelCompanyClientApp/Controllers/HomeController.cs @@ -1,12 +1,12 @@ -using TravelCompanyContracts.BindingModels; -using TravelCompanyContracts.ViewModels; -using TravelCompanyClientApp.Models; -using Microsoft.AspNetCore.Mvc; -using System.Diagnostics; -using TravelCompanyClientApp; +using Microsoft.AspNetCore.Mvc; using PrecastConcretePlantClientApp; +using System.Diagnostics; +using TravelCompanyClientApp.Models; +using TravelCompanyContracts.BindingModels; +using TravelCompanyContracts.ViewModels; -namespace TravelCompanyClientApp.Controllers + +namespace AbstractShowClientApp.Controllers { public class HomeController : Controller { @@ -76,7 +76,8 @@ namespace TravelCompanyClientApp.Controllers [HttpPost] public void Enter(string login, string password) { - if (string.IsNullOrEmpty(login) ||string.IsNullOrEmpty(password)) + if (string.IsNullOrEmpty(login) || +string.IsNullOrEmpty(password)) { throw new Exception("Введите логин и пароль"); } @@ -101,7 +102,8 @@ namespace TravelCompanyClientApp.Controllers { throw new Exception("Введите логин, пароль и ФИО"); } - APIClient.PostRequest("api/client/register", new ClientBindingModel + APIClient.PostRequest("api/client/register", new + ClientBindingModel { ClientFIO = fio, Email = login, @@ -114,7 +116,7 @@ namespace TravelCompanyClientApp.Controllers public IActionResult Create() { ViewBag.Products = - APIClient.GetRequest>("api/main/gettravellist"); + APIClient.GetRequest>("api/main/getproductlist"); return View(); } [HttpPost] @@ -142,7 +144,7 @@ namespace TravelCompanyClientApp.Controllers public double Calc(int count, int travel) { var prod = - APIClient.GetRequest($"api/main/gettravel?travelId={travel}" + APIClient.GetRequest($"api/main/getproduct?travelId={travel}" ); return count * (prod?.Price ?? 1); }