From d5438a40908015559f8d7f654d7cc9f708bb6928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B9?= Date: Fri, 19 May 2023 20:00:42 +0400 Subject: [PATCH] fix --- .../Views/Home/CreatePurchase.cshtml | 8 +++- .../Views/Home/UpdatePurchase.cshtml | 38 ++++++++++--------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/HardwareShop/HardwareShopWorkerApp/Views/Home/CreatePurchase.cshtml b/HardwareShop/HardwareShopWorkerApp/Views/Home/CreatePurchase.cshtml index 10270c2..09a6680 100644 --- a/HardwareShop/HardwareShopWorkerApp/Views/Home/CreatePurchase.cshtml +++ b/HardwareShop/HardwareShopWorkerApp/Views/Home/CreatePurchase.cshtml @@ -21,8 +21,9 @@ Товар - Количество Цена + Количество + Сумма Действие @@ -70,6 +71,7 @@ console.log('try to add good') var count = $('#count').val(); var good = $('#good').val(); + if (count > 0 && good > 0){ $.ajax({ method: "GET", url: `/Home/GetGood`, @@ -89,6 +91,7 @@ countElem.value = '1' } }); + } }) saveBtn.addEventListener("click", () => { @@ -126,7 +129,8 @@ let price = 0; let count = 0; list.forEach((elem) => { - resultTable.innerHTML += `${elem.good.goodName}${elem.count}${Math.round(elem.good.price * elem.count * 100) / 100} \ + console.log(elem); + resultTable.innerHTML += `${elem.good.goodName}${elem.good.price}${elem.count}${Math.round(elem.good.price * elem.count * 100) / 100} \
\