From 9492e91e275f00b65bd3c72db70d716002f09685 Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Wed, 3 Apr 2024 15:59:11 +0200 Subject: [PATCH] Updates --- 8.0/Apps/PointOfSale/README.md | 3 +- 8.0/Apps/PointOfSale/src/PointOfSale.sln | 6 + .../src/PointOfSale/.vscode/launch.json | 14 -- .../PointOfSale/src/PointOfSale/AppShell.xaml | 19 ++- .../src/PointOfSale/AppShellMobile.xaml | 2 + .../src/PointOfSale/AppShellMobile.xaml.cs | 1 + .../src/PointOfSale/GlobalUsings.cs | 7 - .../src/PointOfSale/MauiProgram.cs | 8 + .../src/PointOfSale/Models/AppData.cs | 1 + .../Pages/Handheld/OrderDetailsPage.xaml | 11 +- .../Pages/Handheld/OrderDetailsViewModel.cs | 6 - .../Pages/Handheld/OrdersPage.xaml | 157 ++++++++++++++---- .../Pages/Handheld/OrdersPage.xaml.cs | 6 +- .../Pages/Handheld/OrdersViewModel.cs | 35 ++++ .../PointOfSale/Pages/Handheld/PayPage.xaml | 4 +- .../Pages/Handheld/ReceiptPage.xaml | 4 +- .../Pages/Handheld/SignaturePage.xaml | 4 +- .../PointOfSale/Pages/Handheld/TipPage.xaml | 9 +- .../Pages/Handheld/TipViewModel.cs | 6 + .../src/PointOfSale/Pages/HomePage.xaml | 135 ++++++++++++--- .../src/PointOfSale/Pages/HomePage.xaml.cs | 114 +++++++++++-- .../src/PointOfSale/Pages/HomeViewModel.cs | 4 +- .../Pages/Views/AddProductView.xaml | 13 +- .../Pages/Views/AddProductView.xaml.cs | 27 ++- .../Pages/Views/AddProductViewModel.cs | 12 +- .../Pages/Views/OrderCartView.xaml | 68 +++++++- .../Pages/Views/OrderCartView.xaml.cs | 12 +- .../Pages/Views/OrderCartViewModel.cs | 36 +++- .../Platforms/Android/AndroidManifest.xml | 22 ++- .../Platforms/Android/MainActivity.cs | 7 + .../Platforms/MacCatalyst/AppDelegate.cs | 11 ++ .../src/PointOfSale/Platforms/iOS/Info.plist | 2 + .../src/PointOfSale/PointOfSale.csproj | 51 +++--- .../src/PointOfSale/Shared/MainLayout.razor | 18 +- .../PointOfSale/Shared/MainLayout.razor.css | 4 + 35 files changed, 672 insertions(+), 167 deletions(-) delete mode 100644 8.0/Apps/PointOfSale/src/PointOfSale/.vscode/launch.json delete mode 100644 8.0/Apps/PointOfSale/src/PointOfSale/GlobalUsings.cs mode change 100644 => 100755 8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/PayPage.xaml mode change 100644 => 100755 8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/ReceiptPage.xaml mode change 100644 => 100755 8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/SignaturePage.xaml mode change 100644 => 100755 8.0/Apps/PointOfSale/src/PointOfSale/Pages/HomeViewModel.cs mode change 100644 => 100755 8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/AddProductViewModel.cs diff --git a/8.0/Apps/PointOfSale/README.md b/8.0/Apps/PointOfSale/README.md index ef41a80..a9a224b 100644 --- a/8.0/Apps/PointOfSale/README.md +++ b/8.0/Apps/PointOfSale/README.md @@ -7,6 +7,7 @@ languages: - xaml products: - dotnet-maui +- dotnet-core urlFragment: apps-pointofsale --- @@ -30,4 +31,4 @@ This app demonstrates various techniques for building a desktop and mobile appli * CommunityToolkit.Maui: https://github.com/CommunityToolkit/Maui * SkiaSharp & Lottie: https://mono.github.io/SkiaSharp.Extended/api/ui-maui/#sklottieview * MicroCharts: https://github.com/microcharts-dotnet/Microcharts -* Ril.BlazorSignatureCanvas: https://github.com/ResourceWare/Ril.BlazorSignatureCanvas +* Ril.BlazorSignatureCanvas: https://github.com/ResourceWare/Ril.BlazorSignatureCanvas \ No newline at end of file diff --git a/8.0/Apps/PointOfSale/src/PointOfSale.sln b/8.0/Apps/PointOfSale/src/PointOfSale.sln index 91d49c1..01e5a77 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale.sln +++ b/8.0/Apps/PointOfSale/src/PointOfSale.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 17.0.31611.283 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PointOfSale", "PointOfSale\PointOfSale.csproj", "{88F24BAD-E7CD-4D00-87F4-702FE9AA7077}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PointOfSale.API", "PointOfSale.API\PointOfSale.API.csproj", "{E093156C-2134-4AE3-8C14-96CE94725BBF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -17,6 +19,10 @@ Global {88F24BAD-E7CD-4D00-87F4-702FE9AA7077}.Release|Any CPU.ActiveCfg = Release|Any CPU {88F24BAD-E7CD-4D00-87F4-702FE9AA7077}.Release|Any CPU.Build.0 = Release|Any CPU {88F24BAD-E7CD-4D00-87F4-702FE9AA7077}.Release|Any CPU.Deploy.0 = Release|Any CPU + {E093156C-2134-4AE3-8C14-96CE94725BBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E093156C-2134-4AE3-8C14-96CE94725BBF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E093156C-2134-4AE3-8C14-96CE94725BBF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E093156C-2134-4AE3-8C14-96CE94725BBF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/.vscode/launch.json b/8.0/Apps/PointOfSale/src/PointOfSale/.vscode/launch.json deleted file mode 100644 index e015f08..0000000 --- a/8.0/Apps/PointOfSale/src/PointOfSale/.vscode/launch.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Debug", - "type": "comet", - "request": "launch", - "preLaunchTask": "comet: Build" - } - ] -} \ No newline at end of file diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/AppShell.xaml b/8.0/Apps/PointOfSale/src/PointOfSale/AppShell.xaml index d30fd4e..49fba37 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/AppShell.xaml +++ b/8.0/Apps/PointOfSale/src/PointOfSale/AppShell.xaml @@ -3,6 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:pages="clr-namespace:PointOfSale.Pages" xmlns:mct="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" + xmlns:b="clr-namespace:PointOfSale.Common.Behaviors" xmlns:v="clr-namespace:PointOfSale.Pages.Views" x:Class="PointOfSale.AppShell" FlyoutWidth="104" @@ -84,20 +85,18 @@ Margin="0,15,0,15"/> - + @@ -113,6 +112,7 @@ @@ -128,6 +128,7 @@ @@ -143,6 +144,7 @@ @@ -158,13 +160,16 @@ - + diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/AppShellMobile.xaml b/8.0/Apps/PointOfSale/src/PointOfSale/AppShellMobile.xaml index 7a612df..c529bda 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/AppShellMobile.xaml +++ b/8.0/Apps/PointOfSale/src/PointOfSale/AppShellMobile.xaml @@ -4,5 +4,7 @@ xmlns:p="clr-namespace:PointOfSale.Pages.Handheld" x:Class="PointOfSale.AppShellMobile" Title="AppShellMobile"> + + diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/AppShellMobile.xaml.cs b/8.0/Apps/PointOfSale/src/PointOfSale/AppShellMobile.xaml.cs index 832ff02..7aca38d 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/AppShellMobile.xaml.cs +++ b/8.0/Apps/PointOfSale/src/PointOfSale/AppShellMobile.xaml.cs @@ -18,5 +18,6 @@ public partial class AppShellMobile : Shell Routing.RegisterRoute(nameof(PayPage), typeof(PayPage)); Routing.RegisterRoute(nameof(SignaturePage), typeof(SignaturePage)); Routing.RegisterRoute(nameof(ReceiptPage), typeof(ReceiptPage)); + Routing.RegisterRoute(nameof(ScanPage), typeof(ScanPage)); } } diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/GlobalUsings.cs b/8.0/Apps/PointOfSale/src/PointOfSale/GlobalUsings.cs deleted file mode 100644 index f38cf4d..0000000 --- a/8.0/Apps/PointOfSale/src/PointOfSale/GlobalUsings.cs +++ /dev/null @@ -1,7 +0,0 @@ -global using System.Collections.ObjectModel; -global using System.Diagnostics; -global using CommunityToolkit.Mvvm; -global using CommunityToolkit.Mvvm.ComponentModel; -global using CommunityToolkit.Mvvm.Input; -global using PointOfSale.Models; -global using CommunityToolkit.Mvvm.Messaging; \ No newline at end of file diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/MauiProgram.cs b/8.0/Apps/PointOfSale/src/PointOfSale/MauiProgram.cs index 1374da9..962d252 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/MauiProgram.cs +++ b/8.0/Apps/PointOfSale/src/PointOfSale/MauiProgram.cs @@ -1,7 +1,11 @@ using CommunityToolkit.Maui; using Microsoft.Maui.LifecycleEvents; using Microsoft.Maui.Platform; +using MonkeyCache; +using MonkeyCache.FileStore; +using Plugin.Maui.KeyListener; using SkiaSharp.Views.Maui.Controls.Hosting; +using ZXing.Net.Maui; #if WINDOWS using Microsoft.UI; @@ -22,8 +26,10 @@ public static class MauiProgram var builder = MauiApp.CreateBuilder(); builder .UseMauiApp() + .UseBarcodeReader() .UseMauiCommunityToolkit() .UseSkiaSharp() + .UseKeyListener() .ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); @@ -58,6 +64,8 @@ public static class MauiProgram ModifyEntry(); + Barrel.ApplicationId = "com.simplyprofound.pointofsale"; + return builder.Build(); } diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Models/AppData.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Models/AppData.cs index 04b841d..ab56ea9 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/Models/AppData.cs +++ b/8.0/Apps/PointOfSale/src/PointOfSale/Models/AppData.cs @@ -18,6 +18,7 @@ public static class AppData new Item(){ Title = "Hot Tea", Price = 4.00, Quantity = 1, Category = ItemCategory.Beverages, Image = "tea.png"}, new Item(){ Title = "Coffee", Price = 4.00, Quantity = 1, Category = ItemCategory.Beverages, Image = "coffee.png"}, new Item(){ Title = "Milk", Price = 5.00, Quantity = 1, Category = ItemCategory.Beverages, Image = "milk.png"}, + new Item(){ Title = "Juice", Price = 50.00, Quantity = 1, Category = ItemCategory.Beverages, Image = "juice.png"}, }; public static List Orders { get; set; } = GenerateOrders(); diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrderDetailsPage.xaml b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrderDetailsPage.xaml index c6953d7..a6f4aaa 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrderDetailsPage.xaml +++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrderDetailsPage.xaml @@ -11,14 +11,14 @@ - - + + - + @@ -38,9 +38,8 @@ - -