diff --git a/SushiBar/SushiBarClientApi/Controllers/HomeController.cs b/SushiBar/SushiBarClientApi/Controllers/HomeController.cs index 1871716..c4bf1df 100644 --- a/SushiBar/SushiBarClientApi/Controllers/HomeController.cs +++ b/SushiBar/SushiBarClientApi/Controllers/HomeController.cs @@ -115,7 +115,7 @@ namespace SushiBarClientApp.Controllers return View(); } [HttpPost] - public void Create(int iceCream, int count) + public void Create(int sushi, int count) { if (APIClient.Client == null) { @@ -129,19 +129,19 @@ namespace SushiBarClientApp.Controllers OrderBindingModel { ClientId = APIClient.Client.Id, - SushiId = iceCream, + SushiId = sushi, Count = count, - Sum = Calc(count, iceCream) + Sum = Calc(count, sushi) }); Response.Redirect("Index"); } [HttpPost] - public double Calc(int count, int iceCream) + public double Calc(int count, int sushi) { - var _iceCream = - APIClient.GetRequest($"api/main/getsushi?sushiid={iceCream}" + var _sushi = + APIClient.GetRequest($"api/main/getsushi?sushiid={sushi}" ); - return Math.Round(count * (_iceCream?.Price ?? 1), 2); + return Math.Round(count * (_sushi?.Price ?? 1), 2); } } } diff --git a/SushiBar/SushiBarDatabaseImplement/Implements/ClientStorage.cs b/SushiBar/SushiBarDatabaseImplement/Implements/ClientStorage.cs index c636084..9cc4adc 100644 --- a/SushiBar/SushiBarDatabaseImplement/Implements/ClientStorage.cs +++ b/SushiBar/SushiBarDatabaseImplement/Implements/ClientStorage.cs @@ -24,7 +24,7 @@ namespace SushiBarDatabaseImplement.Implements (!model.Id.HasValue || c.Id == model.Id) && (string.IsNullOrEmpty(model.ClientFIO) || c.ClientFIO.Contains(model.ClientFIO)) && (string.IsNullOrEmpty(model.Email) || c.Email.Contains(model.Email)) && - (string.IsNullOrEmpty(model.Password) || c.Password.Contains(model.Password))) + (string.IsNullOrEmpty(model.Password) || c.Password.Equals(model.Password))) .Select(c => c.GetViewModel) .ToList(); } @@ -35,8 +35,8 @@ namespace SushiBarDatabaseImplement.Implements .FirstOrDefault(c => (!model.Id.HasValue || c.Id == model.Id) && (string.IsNullOrEmpty(model.ClientFIO) || c.ClientFIO.Contains(model.ClientFIO)) && - (string.IsNullOrEmpty(model.Email) || c.Email.Contains(model.Email)) && - (string.IsNullOrEmpty(model.Password) || c.Password.Contains(model.Password)))? + (string.IsNullOrEmpty(model.Email) || c.Email.Equals(model.Email)) && + (string.IsNullOrEmpty(model.Password) || c.Password.Equals(model.Password)))? .GetViewModel; } public ClientViewModel? Insert(ClientBindingModel model) diff --git a/SushiBar/SushiBarRestApi/Controllers/MainController.cs b/SushiBar/SushiBarRestApi/Controllers/MainController.cs index 98d41cb..c641594 100644 --- a/SushiBar/SushiBarRestApi/Controllers/MainController.cs +++ b/SushiBar/SushiBarRestApi/Controllers/MainController.cs @@ -12,39 +12,39 @@ namespace SushiBarRestApi.Controllers { private readonly ILogger _logger; private readonly IOrderLogic _order; - private readonly ISushiLogic _iceCream; - public MainController(ILogger logger, IOrderLogic order, ISushiLogic iceCream) + private readonly ISushiLogic _sushi; + public MainController(ILogger logger, IOrderLogic order, ISushiLogic sushi) { _logger = logger; _order = order; - _iceCream = iceCream; + _sushi = sushi; } [HttpGet] public List? GetSushiList() { try { - return _iceCream.ReadList(null); + return _sushi.ReadList(null); } catch (Exception ex) { - _logger.LogError(ex, "Ошибка получения списка мороженного"); + _logger.LogError(ex, "Ошибка получения списка суши"); throw; } } [HttpGet] - public SushiViewModel? GetSushi(int iceCreamId) + public SushiViewModel? GetSushi(int sushiId) { try { - return _iceCream.ReadElement(new SushiSearchModel + return _sushi.ReadElement(new SushiSearchModel { - Id = iceCreamId + Id = sushiId }); } catch (Exception ex) { - _logger.LogError(ex, "Ошибка получения продукта по id={Id}", iceCreamId); + _logger.LogError(ex, "Ошибка получения продукта по id={Id}", sushiId); throw; } }