From c98d2d261a76df17a33835e92e3eb86e225a7075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=A4=D0=B5=D0=B4=D0=BE=D1=82?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Sat, 1 Jun 2024 06:50:29 +0400 Subject: [PATCH] is done --- .../Controllers/ClientController.cs | 2 +- .../Controllers/HomeController.cs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ElectronicsShop/ElectronicsShopRestAPI/Controllers/ClientController.cs b/ElectronicsShop/ElectronicsShopRestAPI/Controllers/ClientController.cs index 9a75de5..665dbe2 100644 --- a/ElectronicsShop/ElectronicsShopRestAPI/Controllers/ClientController.cs +++ b/ElectronicsShop/ElectronicsShopRestAPI/Controllers/ClientController.cs @@ -57,7 +57,7 @@ namespace ElectronicsShopRestAPI.Controllers { } } - [HttpGet] + [HttpPost] public void CreatePaymeant (PaymeantBindingModel model) { try { _payLogic.CreatePay(model); diff --git a/ElectronicsShop/ElectronicsShopShopClientApp/Controllers/HomeController.cs b/ElectronicsShop/ElectronicsShopShopClientApp/Controllers/HomeController.cs index befbfdc..a201c50 100644 --- a/ElectronicsShop/ElectronicsShopShopClientApp/Controllers/HomeController.cs +++ b/ElectronicsShop/ElectronicsShopShopClientApp/Controllers/HomeController.cs @@ -287,6 +287,10 @@ namespace ElectronicsShopUserApp.Controllers { return PaymeantOption.Неоплачено; } } - - } + [HttpPost] + public double Calc(int count, int product) { + var _product = APIClient.GetRequset($"api/main/getproduct?_productid={product}"); + return count * (_product?.Price ?? 1); + } + } }