From ce81ab40701d73df77da626b1d2a89ac7cdad2f5 Mon Sep 17 00:00:00 2001 From: TypoMustakes Date: Tue, 23 Apr 2024 18:19:57 +0200 Subject: [PATCH] things --- .../wwwroot/index.html | 95 +++++++++++++++---- .../wwwroot/script.js | 30 +++++- .../wwwroot/style.css | 38 ++++++-- 3 files changed, 134 insertions(+), 29 deletions(-) diff --git a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/index.html b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/index.html index 9fa1cbd..818d170 100644 --- a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/index.html +++ b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/index.html @@ -5,27 +5,86 @@ -

Hello, World!

-

Welcome to my first web page.

+
+
+

Customers:

+ + + + + + + + + -
- - +
+
IDNameActions
+
+ +

Create new customer:

+
+ + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+
+ +

Edit customer:

+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+
- - - - - - - - - - - -
IDNameActions
- \ No newline at end of file diff --git a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/script.js b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/script.js index 300c75a..337568b 100644 --- a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/script.js +++ b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/script.js @@ -26,20 +26,46 @@ function display() '' + t.name + '' - + '' + - ''; + + '' + + '' + + '' + + ''; }); } +function updateCustomer(id) +{ + let customerId = document.getElementById('customerid').value; + let customerName = document.getElementById('customername').value; + let customerPhone = document.getElementById('customerphone').value; + let customerEmail = document.getElementById('customeremail').value; + let customerServiceId = document.getElementById('customerserviceid').value; + + + fetch ('https://localhost:5001/api/Customer/' + id, { + method: 'PUT', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + name: 'Updated Name', + phone: 'Updated Phone', + customerEmail: 'Updated Email' + }) + }) +} + function addCustomer() { let customerName = document.getElementById('customername').value; + let customerPhone = document.getElementById('customerphone').value; + let customerEmail = document.getElementById('customeremail').value; fetch('https://localhost:5001/api/Customer', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: customerName, + phone: customerPhone, + customerEmail: customerEmail }) }) .then(response => response) diff --git a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/style.css b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/style.css index 031ba92..88a8855 100644 --- a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/style.css +++ b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/style.css @@ -3,35 +3,55 @@ width: 100%; } -table, th, td +.list table, .list th, .list td { border: 1px solid black; } -table +.list table { border-collapse: collapse; } -th,td +.list th, .list td { padding: 5px; } -th +.list th { background-color: rgb(127, 255, 138); } -#formdiv +.list button +{ + width: 100%; + height: 30px; + box-sizing: border-box; +} + + + + +.formdiv { display: flex; flex-direction: column; - margin-bottom: 20px; } -#formdiv button input +.formdiv table { - margin: 10px; - padding: 5px; + border: none; +} + +.formdiv button, .formdiv input +{ + width: 100%; + height: 60px; + box-sizing: border-box; +} + +.datatable * +{ + padding: 10; } \ No newline at end of file