From ff6653c1bdd2bcb00f6cd52bdfc3642e323e4c33 Mon Sep 17 00:00:00 2001 From: s459315 Date: Fri, 22 Jul 2022 21:20:13 +0200 Subject: [PATCH] Added Sales Page Added sales page xaml and supporting View Model. Just scaffolds out the VM, does not add logic --- RMWPFUserInterface/RMWPFUserInterface.csproj | 8 ++ .../ViewModels/SalesViewModel.cs | 124 ++++++++++++++++++ RMWPFUserInterface/Views/SalesView.xaml | 75 +++++++++++ RMWPFUserInterface/Views/SalesView.xaml.cs | 28 ++++ 4 files changed, 235 insertions(+) create mode 100644 RMWPFUserInterface/ViewModels/SalesViewModel.cs create mode 100644 RMWPFUserInterface/Views/SalesView.xaml create mode 100644 RMWPFUserInterface/Views/SalesView.xaml.cs diff --git a/RMWPFUserInterface/RMWPFUserInterface.csproj b/RMWPFUserInterface/RMWPFUserInterface.csproj index cc8a1a6..bff8b6c 100644 --- a/RMWPFUserInterface/RMWPFUserInterface.csproj +++ b/RMWPFUserInterface/RMWPFUserInterface.csproj @@ -84,10 +84,14 @@ + LoginView.xaml + + SalesView.xaml + ShellView.xaml @@ -99,6 +103,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/RMWPFUserInterface/ViewModels/SalesViewModel.cs b/RMWPFUserInterface/ViewModels/SalesViewModel.cs new file mode 100644 index 0000000..7ff3c91 --- /dev/null +++ b/RMWPFUserInterface/ViewModels/SalesViewModel.cs @@ -0,0 +1,124 @@ +using Caliburn.Micro; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RMWPFUserInterface.ViewModels +{ + public class SalesViewModel : Screen + { + private BindingList _products; + + public BindingList Products + { + get { return _products; } + set + { + _products = value; + NotifyOfPropertyChange(() => Products); + } + } + + private BindingList _cart; + + public BindingList Cart + { + get { return _cart; } + set + { + Cart = value; + NotifyOfPropertyChange(() => Cart); + } + } + + private string _itemQuantity; + + public string ItemQuantity + { + get { return _itemQuantity; } + set + { + ItemQuantity = value; + NotifyOfPropertyChange(() => ItemQuantity); + } + } + + public string SubTotal + { + get + { + // replace with calulation; + return "$0.00"; + } + } + + public string Tax + { + get + { + // replace with calulation; + return "$0.00"; + } + } + + public string Total + { + get + { + // replace with calulation; + return "$0.00"; + } + } + + public bool CanAddToCart + { + get + { + bool output = false; + + // Make sure item is selected and quantity is typed in + + return output; + } + } + public void AddToCart() + { + + } + + public bool CanRemoveFromCart + { + get + { + bool output = false; + + // Make sure something is selected + + return output; + } + } + public void RemoveFromCart() + { + + } + + public bool CanCheckOut + { + get + { + bool output = false; + + // Make sure there is something in the cart + + return output; + } + } + public void CheckOut() + { + + } + } +} diff --git a/RMWPFUserInterface/Views/SalesView.xaml b/RMWPFUserInterface/Views/SalesView.xaml new file mode 100644 index 0000000..5a165c0 --- /dev/null +++ b/RMWPFUserInterface/Views/SalesView.xaml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +