Removing unneccesary loops

This commit is contained in:
TypoMustakes
2024-01-09 18:35:33 +01:00
parent 116cfea4e0
commit 537eea25a0

View File

@@ -512,8 +512,6 @@ namespace WD7UVN_HFT_2023241.Client
Console.WriteLine("Now you can modify these fields, except for the ID.");
while (true)
{
try
{
Console.Write("Name (text): ");
@@ -538,14 +536,12 @@ namespace WD7UVN_HFT_2023241.Client
};
RestService.Post<Customer>(c, "/api/Customer/");
break;
}
catch (FormatException)
{
Console.WriteLine("Invalid format!");
}
}
}
public static void Customer()
{
var menu = new ConsoleMenu();
@@ -569,8 +565,6 @@ namespace WD7UVN_HFT_2023241.Client
Console.WriteLine("Now you can modify these fields, except for the ID.");
while (true)
{
try
{
Console.Write("Name (text): ");
@@ -599,14 +593,12 @@ namespace WD7UVN_HFT_2023241.Client
};
RestService.Post<Employee>(c, "/api/Employee/");
break;
}
catch (FormatException)
{
Console.WriteLine("Invalid format!");
}
}
}
public static void Employee()
{
var menu = new ConsoleMenu();
@@ -634,8 +626,6 @@ namespace WD7UVN_HFT_2023241.Client
Console.WriteLine("Now you can modify these fields, except for the ID.");
while (true)
{
try
{
Console.Write("Name (text): ");
@@ -676,14 +666,12 @@ namespace WD7UVN_HFT_2023241.Client
};
RestService.Post<Service>(c, "/api/Service/");
break;
}
catch (FormatException)
{
Console.WriteLine("Invalid format!");
}
}
}
public static void Service()
{
var menu = new ConsoleMenu();
@@ -706,8 +694,6 @@ namespace WD7UVN_HFT_2023241.Client
Console.WriteLine("Now you can modify these fields, except for the ID.");
while (true)
{
try
{
Console.Write("Name (text): ");
@@ -728,14 +714,12 @@ namespace WD7UVN_HFT_2023241.Client
};
RestService.Post<MaintainerTeam>(c, "/api/MaintainerTeam/");
break;
}
catch (FormatException)
{
Console.WriteLine("Invalid format!");
}
}
}
public static void MaintainerTeam()
{
var menu = new ConsoleMenu();