From dc7867fa723d463153716e73f55516243597f32f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miskolczi=20Rich=C3=A1rd?= Date: Tue, 30 Apr 2024 13:16:26 +0200 Subject: [PATCH] organized files --- .../wwwroot/{ => customers}/customers.html | 2 +- .../wwwroot/{ => customers}/customers.js | 0 .../wwwroot/{ => employees}/employees.html | 2 +- .../wwwroot/{ => employees}/employees.js | 0 .../wwwroot/index.html | 8 +- .../maintainerteam.html | 2 +- .../{ => maintainer_teams}/maintainerteam.js | 0 .../wwwroot/script.js | 93 ------------------- .../wwwroot/{ => services}/services.html | 2 +- .../wwwroot/{ => services}/services.js | 0 10 files changed, 8 insertions(+), 101 deletions(-) rename WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/{ => customers}/customers.html (95%) rename WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/{ => customers}/customers.js (100%) rename WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/{ => employees}/employees.html (95%) rename WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/{ => employees}/employees.js (100%) rename WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/{ => maintainer_teams}/maintainerteam.html (95%) rename WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/{ => maintainer_teams}/maintainerteam.js (100%) delete mode 100644 WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/script.js rename WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/{ => services}/services.html (96%) rename WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/{ => services}/services.js (100%) diff --git a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/customers.html b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/customers/customers.html similarity index 95% rename from WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/customers.html rename to WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/customers/customers.html index e6d8e94..79af1a3 100644 --- a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/customers.html +++ b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/customers/customers.html @@ -3,7 +3,7 @@ Customers - + diff --git a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/customers.js b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/customers/customers.js similarity index 100% rename from WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/customers.js rename to WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/customers/customers.js diff --git a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/employees.html b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/employees/employees.html similarity index 95% rename from WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/employees.html rename to WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/employees/employees.html index da20c6e..799bdaf 100644 --- a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/employees.html +++ b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/employees/employees.html @@ -3,7 +3,7 @@ Employees - + diff --git a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/employees.js b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/employees/employees.js similarity index 100% rename from WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/employees.js rename to WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/employees/employees.js diff --git a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/index.html b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/index.html index 744f46b..952a964 100644 --- a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/index.html +++ b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/index.html @@ -7,12 +7,12 @@

Tables

- Services + Services
- Employees + Employees
- Customers + Customers
- Maintainer Team + Maintainer Team diff --git a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/maintainerteam.html b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/maintainer_teams/maintainerteam.html similarity index 95% rename from WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/maintainerteam.html rename to WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/maintainer_teams/maintainerteam.html index 0493cd0..d856273 100644 --- a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/maintainerteam.html +++ b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/maintainer_teams/maintainerteam.html @@ -3,7 +3,7 @@ Maintainer Team - + diff --git a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/maintainerteam.js b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/maintainer_teams/maintainerteam.js similarity index 100% rename from WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/maintainerteam.js rename to WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/maintainer_teams/maintainerteam.js diff --git a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/script.js b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/script.js deleted file mode 100644 index 337568b..0000000 --- a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/script.js +++ /dev/null @@ -1,93 +0,0 @@ -let customers = []; -getCustomers(); - -async function getCustomers() -{ - await fetch('https://localhost:5001/api/Customer') - .then(x => x.json()) - .then(y => { - customers = y; - console.log(customers); - display(); - }); -} customers.forEach(customer => { - - -}) - -function display() -{ - document.getElementById('resultarea').innerHTML = ''; - - customers.forEach(t => { - document.getElementById('resultarea').innerHTML += - '' - + t.id + - '' - + 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) - .then(data => - { - console.log("Success: ", data) - getCustomers(); - }) - .catch(error => console.error("Error: ", error)); -} - -function deleteCustomer(id) -{ - fetch('https://localhost:5001/api/Customer/' + id, { - method: 'DELETE', - headers: { 'Content-Type': 'application/json' }, - }) - .then(response => response) - .then(data => - { - console.log("Success: ", data) - getCustomers(); - }) - .catch(error => console.error("Error: ", error)); -} \ No newline at end of file diff --git a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/services.html b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/services/services.html similarity index 96% rename from WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/services.html rename to WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/services/services.html index 7837c9e..992c57f 100644 --- a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/services.html +++ b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/services/services.html @@ -3,7 +3,7 @@ services - + diff --git a/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/services.js b/WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/services/services.js similarity index 100% rename from WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/services.js rename to WD7UVN_SzTGUI_2023242.Client.JS/wwwroot/services/services.js