2023-12-07 21:01:32 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using WD7UVN_HFT_2023241.Models;
|
|
|
|
|
|
using System.Collections.Generic;
|
2023-10-03 10:36:32 +02:00
|
|
|
|
|
2023-10-03 11:00:40 +02:00
|
|
|
|
namespace WD7UVN_HFT_2023241.Client
|
2023-10-03 10:36:32 +02:00
|
|
|
|
{
|
|
|
|
|
|
class Program
|
|
|
|
|
|
{
|
|
|
|
|
|
static void Main(string[] args)
|
|
|
|
|
|
{
|
2023-12-06 15:15:58 +01:00
|
|
|
|
RestService rest = new RestService();
|
2023-12-06 15:56:53 +01:00
|
|
|
|
|
2023-12-13 12:14:49 +01:00
|
|
|
|
Console.WriteLine("All employees:\n");
|
2023-12-07 21:01:32 +01:00
|
|
|
|
List<Employee> employeeList = rest.Get<Employee>("/api/Employee/");
|
|
|
|
|
|
foreach (Employee e in employeeList)
|
|
|
|
|
|
{
|
|
|
|
|
|
Console.WriteLine(
|
|
|
|
|
|
e.NAME +
|
|
|
|
|
|
": " +
|
|
|
|
|
|
e.ID
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-13 12:14:49 +01:00
|
|
|
|
Console.WriteLine("\n\nAll customers:\n");
|
2023-12-07 21:01:32 +01:00
|
|
|
|
List<Customer> customerList = rest.Get<Customer>("/api/Customer/");
|
|
|
|
|
|
foreach (Customer c in customerList)
|
|
|
|
|
|
{
|
|
|
|
|
|
Console.WriteLine(
|
|
|
|
|
|
c.NAME +
|
|
|
|
|
|
": " +
|
|
|
|
|
|
c.ID
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
2023-12-06 15:56:53 +01:00
|
|
|
|
|
2023-12-13 12:14:49 +01:00
|
|
|
|
Console.WriteLine("\n\nMaintainer teams:\n");
|
|
|
|
|
|
List<MaintainerTeam> maintainerTeamList = rest.Get<MaintainerTeam>("/api/MaintainerTeam/");
|
2023-12-07 21:01:32 +01:00
|
|
|
|
foreach (MaintainerTeam m in maintainerTeamList)
|
|
|
|
|
|
{
|
|
|
|
|
|
Console.WriteLine(
|
|
|
|
|
|
m.NAME +
|
|
|
|
|
|
": " +
|
|
|
|
|
|
m.ID
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-13 12:14:49 +01:00
|
|
|
|
Console.WriteLine("\n\nMaintained services:\n");
|
|
|
|
|
|
List<Service> serviceList = rest.Get<Service>("/api/Service/");
|
2023-12-07 21:01:32 +01:00
|
|
|
|
foreach (Service s in serviceList)
|
|
|
|
|
|
{
|
|
|
|
|
|
Console.WriteLine(
|
|
|
|
|
|
s.NAME +
|
|
|
|
|
|
": " +
|
|
|
|
|
|
s.ID +
|
|
|
|
|
|
" -> " +
|
|
|
|
|
|
s.IP
|
|
|
|
|
|
+ ":" +
|
|
|
|
|
|
s.PORT
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-10-03 10:36:32 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|