diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Models/Item.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Models/Item.cs index 8e00ab9..61cd3ad 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/Models/Item.cs +++ b/8.0/Apps/PointOfSale/src/PointOfSale/Models/Item.cs @@ -1,7 +1,6 @@ namespace PointOfSale.Models; -[INotifyPropertyChanged] -public partial class Item +public partial class Item : ObservableObject { [ObservableProperty] string title; diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Models/Order.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Models/Order.cs index 2e14d7f..4b2bffa 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/Models/Order.cs +++ b/8.0/Apps/PointOfSale/src/PointOfSale/Models/Order.cs @@ -3,8 +3,7 @@ using PointOfSale.Pages.Handheld; namespace PointOfSale.Models; -[INotifyPropertyChanged] -public partial class Order +public partial class Order : ObservableObject { [ObservableProperty] private int table; @@ -19,9 +18,9 @@ public partial class Order { get { - var tot = items.Sum(i => (i.Price * i.Quantity)); - if (tip != 0) - tot = tot + (tot * tip); + var tot = Items.Sum(i => (i.Price * i.Quantity)); + if (Tip != 0) + tot = tot + (tot * Tip); return tot.ToString("N2"); } } @@ -48,7 +47,7 @@ public partial class Order } [RelayCommand] - private async void Pay() + private async Task Pay() { try { diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/DashboardViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/DashboardViewModel.cs index 6b903a4..82d436c 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/DashboardViewModel.cs +++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/DashboardViewModel.cs @@ -1,7 +1,6 @@ namespace PointOfSale.Pages; - -[INotifyPropertyChanged] -public partial class DashboardViewModel + +public partial class DashboardViewModel : ObservableObject { [RelayCommand] async Task ViewAll() diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/MobileLoginViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/MobileLoginViewModel.cs index 01ea1d8..96d5077 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/MobileLoginViewModel.cs +++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/MobileLoginViewModel.cs @@ -1,8 +1,7 @@ namespace PointOfSale.Pages.Handheld; -[INotifyPropertyChanged] -public partial class MobileLoginViewModel +public partial class MobileLoginViewModel : ObservableObject { [RelayCommand] async Task Login() diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrderDetailsViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrderDetailsViewModel.cs index e343222..21b771c 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrderDetailsViewModel.cs +++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrderDetailsViewModel.cs @@ -1,9 +1,8 @@ namespace PointOfSale.Pages.Handheld; -[INotifyPropertyChanged] [QueryProperty("Order","Order")] [QueryProperty("Added", "Added")] -public partial class OrderDetailsViewModel +public partial class OrderDetailsViewModel : ObservableObject { [ObservableProperty] Order order; @@ -18,7 +17,7 @@ public partial class OrderDetailsViewModel { var navigationParameter = new Dictionary { - { "Order", order } + { "Order", Order } }; await Shell.Current.GoToAsync($"{nameof(TipPage)}", navigationParameter); } diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersViewModel.cs index 7e605b0..5813c8e 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersViewModel.cs +++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/OrdersViewModel.cs @@ -5,8 +5,7 @@ using System.Reflection; namespace PointOfSale.Pages.Handheld; -[INotifyPropertyChanged] -public partial class OrdersViewModel +public partial class OrdersViewModel : ObservableObject { [ObservableProperty] private ObservableCollection _orders; diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/PayViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/PayViewModel.cs index cd6ecc1..d92d919 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/PayViewModel.cs +++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/PayViewModel.cs @@ -1,18 +1,17 @@ namespace PointOfSale.Pages.Handheld; -[INotifyPropertyChanged] [QueryProperty("Order","Order")] -public partial class PayViewModel +public partial class PayViewModel : ObservableObject { [ObservableProperty] Order order; [RelayCommand] - async void Pay() + async Task Pay() { var navigationParameter = new Dictionary { - { "Order", order } + { "Order", Order } }; await Shell.Current.GoToAsync($"{nameof(SignaturePage)}", navigationParameter); } diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/ReceiptViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/ReceiptViewModel.cs index 5f75c9b..1e5bf6b 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/ReceiptViewModel.cs +++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/ReceiptViewModel.cs @@ -1,14 +1,13 @@ namespace PointOfSale.Pages.Handheld; -[INotifyPropertyChanged] [QueryProperty("Order","Order")] -public partial class ReceiptViewModel +public partial class ReceiptViewModel : ObservableObject { [ObservableProperty] Order order; [RelayCommand] - async void Done() + async Task Done() { await Shell.Current.GoToAsync("///orders"); } diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/SignatureViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/SignatureViewModel.cs index d10b9ad..f83d87d 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/SignatureViewModel.cs +++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/SignatureViewModel.cs @@ -3,9 +3,8 @@ using PointOfSale.Messages; namespace PointOfSale.Pages.Handheld; -[INotifyPropertyChanged] [QueryProperty("Order","Order")] -public partial class SignatureViewModel +public partial class SignatureViewModel : ObservableObject { [ObservableProperty] Order order; @@ -14,21 +13,23 @@ public partial class SignatureViewModel async Task Done() { WeakReferenceMessenger.Default.Send( - new SaveSignatureMessage(order.Table) + new SaveSignatureMessage(Order.Table) ); var navigationParameter = new Dictionary { - { "Order", order } + { "Order", Order } }; await Shell.Current.GoToAsync($"{nameof(ReceiptPage)}", navigationParameter); } [RelayCommand] - void Clear() + Task Clear() { WeakReferenceMessenger.Default.Send( new ClearSignatureMessage(true) - ); ; + ); + + return Task.CompletedTask; } } \ No newline at end of file diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/TipViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/TipViewModel.cs index 67325b2..95e503d 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/TipViewModel.cs +++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Handheld/TipViewModel.cs @@ -1,8 +1,7 @@ namespace PointOfSale.Pages.Handheld; -[INotifyPropertyChanged] [QueryProperty("Order","Order")] -public partial class TipViewModel +public partial class TipViewModel : ObservableObject { [ObservableProperty] Order order; @@ -12,16 +11,16 @@ public partial class TipViewModel partial void OnTipChanged(double value) { - order.Tip = value; + Order.Tip = value; OnPropertyChanged(nameof(Order)); } [RelayCommand] - async void Continue() + async Task Continue() { var navigationParameter = new Dictionary { - { "Order", order } + { "Order", Order } }; await Shell.Current.GoToAsync($"{nameof(PayPage)}", navigationParameter); } diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/HomeViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/HomeViewModel.cs index 70e550f..e4aba89 100755 --- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/HomeViewModel.cs +++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/HomeViewModel.cs @@ -3,8 +3,7 @@ using PointOfSale.Messages; namespace PointOfSale.Pages; -[INotifyPropertyChanged] -public partial class HomeViewModel +public partial class HomeViewModel : ObservableObject { [ObservableProperty] ObservableCollection _products; @@ -12,10 +11,10 @@ public partial class HomeViewModel [ObservableProperty] string category = ItemCategory.Noodles.ToString(); - partial void OnCategoryChanged(string cat) + partial void OnCategoryChanged(string value) { - ItemCategory category = (ItemCategory)Enum.Parse(typeof(ItemCategory), cat); - _products = new ObservableCollection( + ItemCategory category = (ItemCategory)Enum.Parse(typeof(ItemCategory), value); + Products = new ObservableCollection( AppData.Items.Where(x => x.Category == category).ToList() ); OnPropertyChanged(nameof(Products)); @@ -23,7 +22,7 @@ public partial class HomeViewModel public HomeViewModel() { - _products = new ObservableCollection( + Products = new ObservableCollection( AppData.Items.Where(x=>x.Category == ItemCategory.Noodles).ToList() ); } @@ -35,7 +34,7 @@ public partial class HomeViewModel } [RelayCommand] - async Task AddProduct() + void AddProduct() { WeakReferenceMessenger.Default.Send(new AddProductMessage(true)); } diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/SettingsViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/SettingsViewModel.cs index 5ee756e..aa767f6 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/SettingsViewModel.cs +++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/SettingsViewModel.cs @@ -1,7 +1,6 @@ namespace PointOfSale.Pages; - -[INotifyPropertyChanged] -public partial class SettingsViewModel + +public partial class SettingsViewModel : ObservableObject { [ObservableProperty] ObservableCollection _products; diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/AddProductViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/AddProductViewModel.cs index 55beaf0..57a0088 100755 --- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/AddProductViewModel.cs +++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/AddProductViewModel.cs @@ -2,9 +2,8 @@ using PointOfSale.Messages; namespace PointOfSale.Pages; - -[INotifyPropertyChanged] -public partial class AddProductViewModel + +public partial class AddProductViewModel : ObservableObject { [ObservableProperty] Item item = new Item(); @@ -21,20 +20,22 @@ public partial class AddProductViewModel [RelayCommand] void Save() { - ItemCategory cat = (ItemCategory)Enum.Parse(typeof(ItemCategory), category); - item.Category = cat; - AppData.Items.Add(item); + ItemCategory cat = (ItemCategory)Enum.Parse(typeof(ItemCategory), Category); + Item.Category = cat; + AppData.Items.Add(Item); WeakReferenceMessenger.Default.Send(new AddProductMessage(false)); } [RelayCommand] - void Cancel() + Task Cancel() { WeakReferenceMessenger.Default.Send(new AddProductMessage(false)); + + return Task.CompletedTask; } - [RelayCommand] + [RelayCommand] async Task ChangeImage() { PickOptions options = new() @@ -66,6 +67,7 @@ public partial class AddProductViewModel catch (Exception ex) { // The user canceled or something went wrong + Console.WriteLine(ex); } return null; diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/OrderCartViewModel.cs b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/OrderCartViewModel.cs index 5051fc9..a06b8b5 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/OrderCartViewModel.cs +++ b/8.0/Apps/PointOfSale/src/PointOfSale/Pages/Views/OrderCartViewModel.cs @@ -1,8 +1,7 @@ using System; namespace PointOfSale.Pages.Views; -[INotifyPropertyChanged] -public partial class OrderCartViewModel +public partial class OrderCartViewModel : ObservableObject { [ObservableProperty] Order order; diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/Android/AndroidManifest.xml b/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/Android/AndroidManifest.xml index 3a32a87..e66767c 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/Android/AndroidManifest.xml +++ b/8.0/Apps/PointOfSale/src/PointOfSale/Platforms/Android/AndroidManifest.xml @@ -1,6 +1,6 @@  - + diff --git a/8.0/Apps/PointOfSale/src/PointOfSale/PointOfSale.csproj b/8.0/Apps/PointOfSale/src/PointOfSale/PointOfSale.csproj index 20291a6..513247e 100644 --- a/8.0/Apps/PointOfSale/src/PointOfSale/PointOfSale.csproj +++ b/8.0/Apps/PointOfSale/src/PointOfSale/PointOfSale.csproj @@ -8,8 +8,6 @@ true true enable - true - false Food @@ -34,29 +32,6 @@ Food - - - - - dPOSDev - Apple Development: Created via API (2NJFZDD9ZM) - - - 4 - - - Automatic - iPhone Developer - - - false - Automatic - iPhone Developer - Platforms\iOS\Entitlements.plist - - - false - @@ -82,18 +57,21 @@ - + - + - - + + + + +