diff --git a/MyFirstMauiApp/MyFirstMauiApp.sln b/MyFirstMauiApp/MyFirstMauiApp.sln index 3760832..0c1f8a0 100644 --- a/MyFirstMauiApp/MyFirstMauiApp.sln +++ b/MyFirstMauiApp/MyFirstMauiApp.sln @@ -11,7 +11,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PageLayout", "PageLayout\Pa EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharedResources", "SharedResources\SharedResources.csproj", "{9A9A55D0-AD77-4510-97E7-A345ABFB5C28}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlyoutTabSearch", "FlyoutTabSearch\FlyoutTabSearch.csproj", "{389BD760-810D-45D4-B67A-2B95FB8B5F74}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlyoutTabSearch", "FlyoutTabSearch\FlyoutTabSearch.csproj", "{389BD760-810D-45D4-B67A-2B95FB8B5F74}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UseRestService", "UseRestService\UseRestService.csproj", "{6878953F-C5FF-4D93-B920-029350FB6B54}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -49,6 +51,12 @@ Global {389BD760-810D-45D4-B67A-2B95FB8B5F74}.Release|Any CPU.ActiveCfg = Release|Any CPU {389BD760-810D-45D4-B67A-2B95FB8B5F74}.Release|Any CPU.Build.0 = Release|Any CPU {389BD760-810D-45D4-B67A-2B95FB8B5F74}.Release|Any CPU.Deploy.0 = Release|Any CPU + {6878953F-C5FF-4D93-B920-029350FB6B54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6878953F-C5FF-4D93-B920-029350FB6B54}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6878953F-C5FF-4D93-B920-029350FB6B54}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {6878953F-C5FF-4D93-B920-029350FB6B54}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6878953F-C5FF-4D93-B920-029350FB6B54}.Release|Any CPU.Build.0 = Release|Any CPU + {6878953F-C5FF-4D93-B920-029350FB6B54}.Release|Any CPU.Deploy.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/MyFirstMauiApp/UseRestService/App.xaml b/MyFirstMauiApp/UseRestService/App.xaml new file mode 100644 index 0000000..c2e2b5b --- /dev/null +++ b/MyFirstMauiApp/UseRestService/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/MyFirstMauiApp/UseRestService/App.xaml.cs b/MyFirstMauiApp/UseRestService/App.xaml.cs new file mode 100644 index 0000000..e0f24be --- /dev/null +++ b/MyFirstMauiApp/UseRestService/App.xaml.cs @@ -0,0 +1,12 @@ +namespace UseRestService +{ + public partial class App : Application + { + public App() + { + InitializeComponent(); + + MainPage = new AppShell(); + } + } +} diff --git a/MyFirstMauiApp/UseRestService/AppShell.xaml b/MyFirstMauiApp/UseRestService/AppShell.xaml new file mode 100644 index 0000000..2ab84d9 --- /dev/null +++ b/MyFirstMauiApp/UseRestService/AppShell.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/MyFirstMauiApp/UseRestService/AppShell.xaml.cs b/MyFirstMauiApp/UseRestService/AppShell.xaml.cs new file mode 100644 index 0000000..e6fb281 --- /dev/null +++ b/MyFirstMauiApp/UseRestService/AppShell.xaml.cs @@ -0,0 +1,10 @@ +namespace UseRestService +{ + public partial class AppShell : Shell + { + public AppShell() + { + InitializeComponent(); + } + } +} diff --git a/MyFirstMauiApp/UseRestService/Data/Messages.cs b/MyFirstMauiApp/UseRestService/Data/Messages.cs new file mode 100644 index 0000000..4bc519d --- /dev/null +++ b/MyFirstMauiApp/UseRestService/Data/Messages.cs @@ -0,0 +1,16 @@ +using CommunityToolkit.Mvvm.Messaging.Messages; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UseRestService.Data +{ + public class RefreshMessage : ValueChangedMessage + { + public RefreshMessage(bool value) : base(value) + { + } + } +} diff --git a/MyFirstMauiApp/UseRestService/Data/Part.cs b/MyFirstMauiApp/UseRestService/Data/Part.cs new file mode 100644 index 0000000..f0250be --- /dev/null +++ b/MyFirstMauiApp/UseRestService/Data/Part.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UseRestService.Data +{ + [Serializable] + public class Part + { + public string PartID { get; set; } + + public string PartName { get; set; } + + public string TheSuppliers { get; set; } + + public string PartType { get; set; } + + public List Suppliers { get; set; } = new List(); + public DateTime PartAvailableDate { get; set; } + + public string SupplierString + { + get + { + string result = String.Empty; + foreach (string supplier in Suppliers) + { + result += $"{supplier}, "; + } + result = result.Trim(',', ' '); + return result; + } + } + } +} diff --git a/MyFirstMauiApp/UseRestService/Data/PartManager.cs b/MyFirstMauiApp/UseRestService/Data/PartManager.cs new file mode 100644 index 0000000..d582cd1 --- /dev/null +++ b/MyFirstMauiApp/UseRestService/Data/PartManager.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UseRestService.Data +{ + public static class PartsManager + { + // TODO: Add fields for BaseAddress, Url, and authorizationKey + static readonly string BaseAddress = "URL GOES HERE"; + static readonly string Url = $"{BaseAddress}/api/"; + + static HttpClient client; + + private static async Task GetClient() + { + throw new NotImplementedException(); + } + + public static async Task> GetAll() + { + throw new NotImplementedException(); + } + + public static async Task Add(string partName, string supplier, string partType) + { + throw new NotImplementedException(); + } + + public static async Task Update(Part part) + { + throw new NotImplementedException(); + } + + public static async Task Delete(string partID) + { + throw new NotImplementedException(); + } + } +} diff --git a/MyFirstMauiApp/UseRestService/MainPage.xaml b/MyFirstMauiApp/UseRestService/MainPage.xaml new file mode 100644 index 0000000..36d13f9 --- /dev/null +++ b/MyFirstMauiApp/UseRestService/MainPage.xaml @@ -0,0 +1,41 @@ + + + + + + + + +