├── images └── checker.png ├── POS_Login ├── Logo_Big.png ├── Resources │ └── Logo_Big.png ├── App.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── App.xaml.cs ├── App.xaml ├── Views │ └── LoginView.xaml.cs ├── ViewModels │ └── LoginViewModel.cs └── POS-Login.csproj ├── POS_ManagersApp ├── Logo_Big.png ├── App.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── packages.config ├── ManagersStartupView2.xaml.cs ├── ManagersStartupView.xaml.cs ├── App.xaml ├── Views │ ├── ManagersMainWindow.xaml.cs │ ├── DashboardView.xaml.cs │ └── ManageProductsView.xaml.cs ├── App.xaml.cs ├── ManagersStartupView2.xaml ├── ViewModels │ └── ManagersMainWindowViewModel.cs ├── ManagersStartupViewModel.cs └── ManagersStartupView.xaml ├── POS_SellersApp ├── Logo_Small.png ├── Resources │ └── Logo_Big.png ├── App.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── SellersStartupView.xaml.cs ├── App.xaml ├── DialogService.cs ├── Views │ ├── PaymentView.xaml.cs │ ├── SellersMainWindow.xaml.cs │ └── ProductsCatalogView.xaml.cs ├── App.xaml.cs ├── SellersStartupViewModel.cs ├── ViewModels │ └── ProductsCatalogViewModel.cs └── SellersStartupView.xaml ├── POS_DataLibrary ├── ProductsCategory.cs ├── ProductCategory.cs ├── Order.cs ├── Sales.cs ├── User.cs ├── Properties │ └── AssemblyInfo.cs ├── Product.cs ├── POS_DataLibrary.csproj └── OrderItems.cs ├── javascripts └── scale.fix.js ├── POS-Coded UITests ├── UIMap.cs ├── Properties │ └── AssemblyInfo.cs ├── CodedUITest1.cs └── POS-Coded UITests.csproj ├── POS-CodedUITests ├── UIMap.cs ├── Properties │ └── AssemblyInfo.cs ├── CodedUITest1.cs ├── POS-CodedUITests.csproj └── UIMap.Designer.cs ├── UnitTests ├── ActionCommandTests.cs ├── Properties │ └── AssemblyInfo.cs ├── LoginViewModelTests.cs ├── DatabaseTests.cs └── POS-UnitTests.csproj ├── POS_ViewsLibrary ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── ImageConverter.cs ├── ObservableObject.cs ├── VML │ └── ViewModelLocator.cs ├── DecimalStringConverter.cs ├── ViewModel.cs ├── POS_ViewsLibrary.csproj ├── PasswordBoxAssistant.cs └── ActionComand.cs ├── .gitattributes ├── README.md ├── params.json ├── stylesheets └── github-dark.css ├── DailyScrum.txt ├── POS-PointOfSales.sln ├── .gitignore └── index.html /images/checker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Valetnina/POS-PointOfSalesTeamProject/HEAD/images/checker.png -------------------------------------------------------------------------------- /POS_Login/Logo_Big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Valetnina/POS-PointOfSalesTeamProject/HEAD/POS_Login/Logo_Big.png -------------------------------------------------------------------------------- /POS_ManagersApp/Logo_Big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Valetnina/POS-PointOfSalesTeamProject/HEAD/POS_ManagersApp/Logo_Big.png -------------------------------------------------------------------------------- /POS_SellersApp/Logo_Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Valetnina/POS-PointOfSalesTeamProject/HEAD/POS_SellersApp/Logo_Small.png -------------------------------------------------------------------------------- /POS_Login/Resources/Logo_Big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Valetnina/POS-PointOfSalesTeamProject/HEAD/POS_Login/Resources/Logo_Big.png -------------------------------------------------------------------------------- /POS_SellersApp/Resources/Logo_Big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Valetnina/POS-PointOfSalesTeamProject/HEAD/POS_SellersApp/Resources/Logo_Big.png -------------------------------------------------------------------------------- /POS_Login/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /POS_ManagersApp/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /POS_SellersApp/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /POS_Login/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /POS_ManagersApp/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /POS_ManagersApp/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /POS_SellersApp/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /POS_DataLibrary/ProductsCategory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace POS_DataLibrary 8 | { 9 | public class ProductsCategory { 10 | public string CategoryName { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /POS_DataLibrary/ProductCategory.cs: -------------------------------------------------------------------------------- 1 | namespace POS_DataLibrary 2 | { 3 | public class ProductCategory 4 | { 5 | public int Id { get; set; } 6 | public string CategoryName { get; set; } 7 | 8 | public override string ToString() 9 | { 10 | return string.Format("{0} | {1}", Id, CategoryName); 11 | } 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /POS_Login/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace POS_PointOfSales 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /POS_Login/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /POS_DataLibrary/Order.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace POS_DataLibrary 8 | { 9 | public class Order 10 | { 11 | 12 | public int OrderId { get; set; } 13 | public DateTime Date { get; set; } 14 | public string StoreNo { get; set; } 15 | public string UserId { get; set; } 16 | public decimal OrderAmount { get; set; } 17 | public decimal Tax { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /javascripts/scale.fix.js: -------------------------------------------------------------------------------- 1 | fixScale = function(doc) { 2 | 3 | var addEvent = 'addEventListener', 4 | type = 'gesturestart', 5 | qsa = 'querySelectorAll', 6 | scales = [1, 1], 7 | meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : []; 8 | 9 | function fix() { 10 | meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1]; 11 | doc.removeEventListener(type, fix, true); 12 | } 13 | 14 | if ((meta = meta[meta.length - 1]) && addEvent in doc) { 15 | fix(); 16 | scales = [.25, 1.6]; 17 | doc[addEvent](type, fix, true); 18 | } 19 | 20 | }; -------------------------------------------------------------------------------- /POS-Coded UITests/UIMap.cs: -------------------------------------------------------------------------------- 1 | namespace POS_Coded_UITests 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.CodeDom.Compiler; 6 | using Microsoft.VisualStudio.TestTools.UITest.Extension; 7 | using Microsoft.VisualStudio.TestTools.UITesting; 8 | using Microsoft.VisualStudio.TestTools.UnitTesting; 9 | using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard; 10 | using Mouse = Microsoft.VisualStudio.TestTools.UITesting.Mouse; 11 | using MouseButtons = System.Windows.Forms.MouseButtons; 12 | using System.Drawing; 13 | using System.Windows.Input; 14 | using System.Text.RegularExpressions; 15 | 16 | 17 | public partial class UIMap 18 | { 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /POS-CodedUITests/UIMap.cs: -------------------------------------------------------------------------------- 1 | namespace POS_CodedUITests 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.CodeDom.Compiler; 6 | using Microsoft.VisualStudio.TestTools.UITest.Extension; 7 | using Microsoft.VisualStudio.TestTools.UITesting; 8 | using Microsoft.VisualStudio.TestTools.UnitTesting; 9 | using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard; 10 | using Mouse = Microsoft.VisualStudio.TestTools.UITesting.Mouse; 11 | using MouseButtons = System.Windows.Forms.MouseButtons; 12 | using System.Drawing; 13 | using System.Windows.Input; 14 | using System.Text.RegularExpressions; 15 | 16 | 17 | public partial class UIMap 18 | { 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /POS_ManagersApp/ManagersStartupView2.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Shapes; 14 | 15 | namespace POS_ManagersApp 16 | { 17 | /// 18 | /// Interaction logic for ManagersStartupView2.xaml 19 | /// 20 | public partial class ManagersStartupView2 : Window 21 | { 22 | public ManagersStartupView2() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /POS_SellersApp/SellersStartupView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Shapes; 14 | 15 | namespace POS_SellersApp 16 | { 17 | /// 18 | /// Interaction logic for SellersStartypView.xaml 19 | /// 20 | public partial class SellersStartupView : Window 21 | { 22 | public SellersStartupView() 23 | { 24 | InitializeComponent(); 25 | 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /POS_ManagersApp/ManagersStartupView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Shapes; 14 | 15 | namespace POS_ManagersApp 16 | { 17 | /// 18 | /// Interaction logic for SellersStartypView.xaml 19 | /// 20 | public partial class ManagersStartupView : Window 21 | { 22 | public ManagersStartupView() 23 | { 24 | InitializeComponent(); 25 | 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /POS_SellersApp/App.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /POS_ManagersApp/App.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /POS_ManagersApp/Views/ManagersMainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using POS_ManagersApp.ViewModels; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Controls; 9 | using System.Windows.Data; 10 | using System.Windows.Documents; 11 | using System.Windows.Input; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Shapes; 15 | 16 | namespace POS_ManagersApp.Views 17 | { 18 | /// 19 | /// Interaction logic for ManagersMainWindow.xaml 20 | /// 21 | public partial class ManagersMainWindow : UserControl 22 | { 23 | public ManagersMainWindow() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /POS_SellersApp/DialogService.cs: -------------------------------------------------------------------------------- 1 | using POS_SellersApp.ViewModels; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Controls; 9 | 10 | namespace POS_ViewsLibrary 11 | { 12 | class DialogService 13 | { 14 | public void Show(FrameworkElement view, PaimentViewModel ChildVM) 15 | { 16 | //Window window = new Window(); 17 | //window.Content = view; 18 | //window.DataContext = ChildVM; 19 | 20 | //// For closing this dialog using MVVM 21 | //ChildVM.RequestClose += delegate 22 | //{ 23 | // window.Close(); 24 | //}; 25 | 26 | //window.Show(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /POS_DataLibrary/Sales.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace POS_DataLibrary 8 | { 9 | public class Sales 10 | { 11 | private string seller; 12 | 13 | public string Seller 14 | { 15 | get { return seller; } 16 | set { seller = value; } 17 | } 18 | 19 | private OrderItems orderItems; 20 | 21 | public OrderItems OrderItems 22 | { 23 | get { return orderItems; } 24 | set { orderItems = value; } 25 | } 26 | private decimal itemTotal; 27 | 28 | public decimal ItemTotal 29 | { 30 | get { return itemTotal; } 31 | set { itemTotal = value; } 32 | } 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /POS_ManagersApp/Views/DashboardView.xaml.cs: -------------------------------------------------------------------------------- 1 | using POS_ManagersApp.ViewModels; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Controls; 9 | using System.Windows.Data; 10 | using System.Windows.Documents; 11 | using System.Windows.Input; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Navigation; 15 | using System.Windows.Shapes; 16 | 17 | namespace POS_ManagersApp.Views 18 | { 19 | /// 20 | /// Interaction logic for DashboardView.xaml 21 | /// 22 | public partial class DashboardView : UserControl 23 | { 24 | public DashboardView() 25 | { 26 | InitializeComponent(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /POS_ManagersApp/Views/ManageProductsView.xaml.cs: -------------------------------------------------------------------------------- 1 | using POS_ManagersApp.ViewModels; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Controls; 9 | using System.Windows.Data; 10 | using System.Windows.Documents; 11 | using System.Windows.Input; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Navigation; 15 | using System.Windows.Shapes; 16 | 17 | namespace POS_ManagersApp.Views 18 | { 19 | /// 20 | /// Interaction logic for ManageProductsView.xaml 21 | /// 22 | public partial class ManageProductsView : UserControl 23 | { 24 | public ManageProductsView() 25 | { 26 | InitializeComponent(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /POS_Login/Views/LoginView.xaml.cs: -------------------------------------------------------------------------------- 1 | using POS_PointOfSales.ViewModels; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Security; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Windows; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Documents; 12 | using System.Windows.Input; 13 | using System.Windows.Media; 14 | using System.Windows.Media.Imaging; 15 | using System.Windows.Shapes; 16 | 17 | namespace POS_PointOfSales.Views 18 | { 19 | /// 20 | /// Interaction logic for LoginView.xaml 21 | /// 22 | public partial class LoginView : UserControl 23 | { 24 | public LoginView() 25 | { 26 | // DataContext = new LoginViewModel(); 27 | InitializeComponent(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /POS_SellersApp/Views/PaymentView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | using POS_SellersApp.ViewModels; 16 | 17 | namespace POS_SellersApp.Views 18 | { 19 | /// 20 | /// Interaction logic for PaymentView.xaml 21 | /// 22 | public partial class PaymentView : UserControl 23 | { 24 | 25 | public PaymentView() 26 | { 27 | InitializeComponent(); 28 | // DataContext = new PaimentViewModel(0); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /POS_SellersApp/Views/SellersMainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using POS_SellersApp.ViewModels; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Controls; 9 | using System.Windows.Data; 10 | using System.Windows.Documents; 11 | using System.Windows.Input; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Navigation; 15 | using System.Windows.Shapes; 16 | 17 | namespace POS_SellersApp.Views 18 | { 19 | /// 20 | /// Interaction logic for UserControl1.xaml 21 | /// 22 | public partial class SellersMainWindow : UserControl 23 | { 24 | public SellersMainWindow() 25 | { 26 | //DataContext = new SellersMainWindowViewModel(); 27 | InitializeComponent(); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /UnitTests/ActionCommandTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | using POS_PointOfSales.ViewModels; 4 | using POS_ViewsLibrary; 5 | using POS_DataLibrary; 6 | using POS_SellersApp.ViewModels; 7 | 8 | namespace UnitTests 9 | { 10 | [TestClass] 11 | public class ActionCommandTests 12 | { 13 | [TestMethod] 14 | [ExpectedException(typeof(ArgumentNullException))] 15 | public void ConstructorThrowsExceptionIfActionparameterISNull() 16 | { 17 | var commanvd = new ActionCommand(null); 18 | } 19 | [TestMethod] 20 | public void ExecuteInvokesAction() 21 | { 22 | var invoked = false; 23 | Action action = obj => invoked = true; 24 | var command = new ActionCommand(action); 25 | command.Execute(); 26 | Assert.IsTrue(invoked); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /POS_SellersApp/Views/ProductsCatalogView.xaml.cs: -------------------------------------------------------------------------------- 1 | using POS_SellersApp.ViewModels; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Controls; 9 | using System.Windows.Data; 10 | using System.Windows.Documents; 11 | using System.Windows.Input; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Navigation; 15 | using System.Windows.Shapes; 16 | 17 | namespace POS_SellersApp.Views 18 | { 19 | /// 20 | /// Interaction logic for ProductsCatalogView.xaml 21 | /// 22 | public partial class ProductsCatalogView : UserControl 23 | { 24 | public ProductsCatalogView() 25 | { 26 | // DataContext = new ProductsCatalogViewModel(); 27 | InitializeComponent(); 28 | 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /POS_DataLibrary/User.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace POS_DataLibrary 9 | { 10 | public class User 11 | { 12 | private string userName; 13 | public string UserName 14 | { 15 | get 16 | { 17 | return userName; 18 | } 19 | set 20 | { 21 | userName = value; 22 | } 23 | 24 | } 25 | public string Password { get; set; } 26 | public string FirstName { get; set; } 27 | public string Id { get; set; } 28 | public string LastName { get; set; } 29 | public bool IsManager { get; set; } 30 | 31 | 32 | public event PropertyChangedEventHandler PropertyChanged; 33 | 34 | private void RaisePropertyChanged(string property) 35 | { 36 | if (PropertyChanged != null) 37 | { 38 | PropertyChanged(this, new PropertyChangedEventArgs(property)); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /POS_Login/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace POS_PointOfSales.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /POS_ManagersApp/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace POS_ManagersApp.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /POS_SellersApp/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace POS_SellersApp.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /POS_ManagersApp/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace POS_ManagersApp 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | public App() 17 | { 18 | IDisposable disposableViewModel = null; 19 | 20 | //Create and show window while storing datacontext 21 | this.Startup += (sender, args) => 22 | { 23 | ManagersStartupView startupView = new ManagersStartupView(); 24 | // SellersMainWindowViewModel startupView = new SellersMainWindowViewModel(); 25 | disposableViewModel = MainWindow.DataContext as IDisposable; 26 | 27 | startupView.Show(); 28 | }; 29 | 30 | //Dispose on unhandled exception 31 | this.DispatcherUnhandledException += (sender, args) => 32 | { 33 | if (disposableViewModel != null) disposableViewModel.Dispose(); 34 | }; 35 | 36 | //Dispose on exit 37 | this.Exit += (sender, args) => 38 | { 39 | if (disposableViewModel != null) disposableViewModel.Dispose(); 40 | }; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /POS_SellersApp/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using POS_SellersApp.ViewModels; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Configuration; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Threading.Tasks; 8 | using System.Windows; 9 | 10 | namespace POS_SellersApp 11 | { 12 | /// 13 | /// Interaction logic for App.xaml 14 | /// 15 | public partial class App : Application 16 | { 17 | public App() 18 | { 19 | IDisposable disposableViewModel = null; 20 | 21 | //Create and show window while storing datacontext 22 | this.Startup += (sender, args) => 23 | { 24 | SellersStartupView startupView = new SellersStartupView(); 25 | // SellersMainWindowViewModel startupView = new SellersMainWindowViewModel(); 26 | disposableViewModel = MainWindow.DataContext as IDisposable; 27 | 28 | startupView.Show(); 29 | }; 30 | 31 | //Dispose on unhandled exception 32 | this.DispatcherUnhandledException += (sender, args) => 33 | { 34 | if (disposableViewModel != null) disposableViewModel.Dispose(); 35 | }; 36 | 37 | //Dispose on exit 38 | this.Exit += (sender, args) => 39 | { 40 | if (disposableViewModel != null) disposableViewModel.Dispose(); 41 | }; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /POS-CodedUITests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("POS-CodedUITests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("POS-CodedUITests")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5f30ff5d-b3ae-4d9e-864d-c008d3a8b2f5")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /POS-Coded UITests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("POS-Coded UITests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("POS-Coded UITests")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("56075087-086b-43af-a1ad-102acc10822a")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /UnitTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("UnitTests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("UnitTests")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("3430c410-8572-42d3-9a9a-bcc975e7e882")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /POS_DataLibrary/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("POS_DataLibrary")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("POS_DataLibrary")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("c0873047-8453-4fe7-9bc1-6629c9e3d9f8")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /POS_ViewsLibrary/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("POS_ViewsLibrary")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("POS_ViewsLibrary")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("359f19f0-2a62-468e-9e74-674b0da83999")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /POS_ViewsLibrary/ImageConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing.Imaging; 4 | using System.Globalization; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Data; 10 | 11 | namespace POS_ViewsLibrary 12 | { 13 | /// 14 | /// One-way converter from System.Drawing.Image to System.Windows.Media.ImageSource 15 | /// 16 | [ValueConversion(typeof(System.Drawing.Image), typeof(System.Windows.Media.ImageSource))] 17 | public class ImageConverter : IValueConverter 18 | { 19 | public object Convert(object value, Type targetType, 20 | object parameter, CultureInfo culture) 21 | { 22 | // empty images are empty... 23 | if (value == null) { return null; } 24 | 25 | var image = (System.Drawing.Image)value; 26 | // Winforms Image we want to get the WPF Image from... 27 | var bitmap = new System.Windows.Media.Imaging.BitmapImage(); 28 | bitmap.BeginInit(); 29 | MemoryStream memoryStream = new MemoryStream(); 30 | // Save to a memory stream... 31 | image.Save(memoryStream, ImageFormat.Bmp); 32 | // Rewind the stream... 33 | memoryStream.Seek(0, System.IO.SeekOrigin.Begin); 34 | bitmap.StreamSource = memoryStream; 35 | bitmap.EndInit(); 36 | return bitmap; 37 | } 38 | 39 | public object ConvertBack(object value, Type targetType, 40 | object parameter, CultureInfo culture) 41 | { 42 | return null; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /UnitTests/LoginViewModelTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | using POS_PointOfSales.ViewModels; 4 | using POS_ViewsLibrary; 5 | 6 | namespace UnitTests 7 | { 8 | [TestClass] 9 | public class LoginViewModelTests 10 | { 11 | 12 | 13 | [TestMethod] 14 | public void IsViewModel() 15 | { 16 | Assert.IsTrue(typeof(LoginViewModel).BaseType == typeof(ViewModel)); 17 | } 18 | 19 | [TestMethod] 20 | public void ValidationErrorWhenUserNameIsEmpty() 21 | { 22 | var viewModel = new LoginViewModel 23 | { 24 | UserName = "" 25 | }; 26 | 27 | Assert.IsNotNull(viewModel["UserName"]); 28 | } 29 | [TestMethod] 30 | public void ValidationErrorWhenUserNameIsNotProvided() 31 | { 32 | var viewModel = new LoginViewModel 33 | { 34 | UserName = null 35 | }; 36 | Assert.IsNotNull(viewModel["UserName"]); 37 | } 38 | [TestMethod] 39 | public void NoValidationErrorWhenUserNameMeetsAllRequirements() 40 | { 41 | var viewModel = new LoginViewModel 42 | { 43 | UserName = "Tina" 44 | }; 45 | 46 | Assert.IsNull(viewModel["UserName"]); 47 | } 48 | [TestMethod] 49 | public void LoginComamndCannotExecuteWhenUserNameIsNotValid() 50 | { 51 | var viewModel = new LoginViewModel 52 | { 53 | UserName = null, 54 | Password = "123456", 55 | }; 56 | Assert.IsFalse(viewModel.Login.CanExecute(null)); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /POS_ViewsLibrary/ObservableObject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Runtime.CompilerServices; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace POS_ViewsLibrary 10 | { 11 | public class ObservableObject : INotifyPropertyChanged 12 | { 13 | 14 | // protected virtual void SetProperty(ref T member, T val, 15 | //[CallerMemberName] string propertyName = null) 16 | // { 17 | // if (object.Equals(member, val)) return; 18 | 19 | // member = val; 20 | // PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); 21 | // } 22 | 23 | // protected virtual void OnPropertyChanged(string propertyName) 24 | // { 25 | // PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); 26 | // } 27 | 28 | // public event PropertyChangedEventHandler PropertyChanged = delegate { }; 29 | // } 30 | 31 | 32 | // public event PropertyChangedEventHandler PropertyChanged; 33 | 34 | // protected void NotifyPropertyChanged([CallerMemberName] String propertyName = "") 35 | // { 36 | // PropertyChangedEventHandler handler = PropertyChanged; 37 | // if (handler != null) 38 | // { 39 | // handler(this, new PropertyChangedEventArgs(propertyName)); 40 | // } 41 | // } 42 | // boiler-plate 43 | 44 | public event PropertyChangedEventHandler PropertyChanged; 45 | 46 | public void RaisePropertyChanged(string property) 47 | { 48 | if (PropertyChanged != null) 49 | { 50 | PropertyChanged(this, new PropertyChangedEventArgs(property)); 51 | } 52 | 53 | } 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /POS_ViewsLibrary/VML/ViewModelLocator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace POS_ViewsLibrary.VML 10 | { 11 | public class ViewModelLocator 12 | { 13 | public static bool GetAutoHookedUpViewModel(DependencyObject obj) 14 | { 15 | return (bool)obj.GetValue(AutoHookedUpViewModelProperty); 16 | } 17 | 18 | public static void SetAutoHookedUpViewModel(DependencyObject obj, bool value) 19 | { 20 | obj.SetValue(AutoHookedUpViewModelProperty, value); 21 | } 22 | 23 | // Using a DependencyProperty as the backing store for AutoHookedUpViewModel. 24 | 25 | //This enables animation, styling, binding, etc... 26 | public static readonly DependencyProperty AutoHookedUpViewModelProperty = 27 | DependencyProperty.RegisterAttached("AutoHookedUpViewModel", 28 | typeof(bool), typeof(ViewModelLocator), new 29 | PropertyMetadata(false, AutoHookedUpViewModelChanged)); 30 | 31 | private static void AutoHookedUpViewModelChanged(DependencyObject d, 32 | DependencyPropertyChangedEventArgs e) 33 | { 34 | if (DesignerProperties.GetIsInDesignMode(d)) return; 35 | var viewType = d.GetType(); 36 | 37 | string str = viewType.FullName; 38 | str = str.Replace(".Views.", ".ViewModels."); 39 | 40 | var viewTypeName = str; 41 | var viewModelTypeName = viewTypeName + "Model"; 42 | var viewModelType = Type.GetType(viewModelTypeName); 43 | var viewModel = Activator.CreateInstance(viewModelType); 44 | 45 | ((FrameworkElement)d).DataContext = viewModel; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /POS_ViewsLibrary/DecimalStringConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing.Imaging; 4 | using System.Globalization; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows; 10 | using System.Windows.Data; 11 | 12 | namespace POS_ViewsLibrary 13 | { 14 | /// 15 | /// One-way converter from System.Drawing.Image to System.Windows.Media.ImageSource 16 | /// 17 | [ValueConversion(typeof(System.Decimal), typeof(System.String))] 18 | public class NumericalStringConverter : IValueConverter 19 | { 20 | public int EmptyStringValue { get; set; } 21 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 22 | { 23 | if (value == null) 24 | return null; 25 | else if (value is string) 26 | return value; 27 | else if (value is decimal && (decimal)value == EmptyStringValue) 28 | return string.Empty; 29 | else if (value is Int32) 30 | return value.ToString(); 31 | else if (value is Double) 32 | return ((double)value).ToString("#.##"); 33 | else 34 | return ((decimal)value).ToString("#.##"); 35 | } 36 | 37 | public object ConvertBack(object value, Type targetType, 38 | object parameter, CultureInfo culture) 39 | { 40 | if (value is string) 41 | { 42 | string s = (string)value; 43 | decimal d; 44 | if (decimal.TryParse(s, out d)) 45 | return d; 46 | else 47 | return EmptyStringValue; 48 | } 49 | return value; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /POS_ManagersApp/ManagersStartupView2.xaml: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /POS-CodedUITests/CodedUITest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text.RegularExpressions; 4 | using System.Windows.Input; 5 | using System.Windows.Forms; 6 | using System.Drawing; 7 | using Microsoft.VisualStudio.TestTools.UITesting; 8 | using Microsoft.VisualStudio.TestTools.UnitTesting; 9 | using Microsoft.VisualStudio.TestTools.UITest.Extension; 10 | using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard; 11 | 12 | 13 | namespace POS_CodedUITests 14 | { 15 | /// 16 | /// Summary description for CodedUITest1 17 | /// 18 | [CodedUITest] 19 | public class CodedUITest1 20 | { 21 | public CodedUITest1() 22 | { 23 | } 24 | 25 | [TestMethod] 26 | public void CodedUITestMethod1() 27 | { 28 | // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. 29 | } 30 | 31 | #region Additional test attributes 32 | 33 | // You can use the following additional attributes as you write your tests: 34 | 35 | ////Use TestInitialize to run code before running each test 36 | //[TestInitialize()] 37 | //public void MyTestInitialize() 38 | //{ 39 | // // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. 40 | //} 41 | 42 | ////Use TestCleanup to run code after each test has run 43 | //[TestCleanup()] 44 | //public void MyTestCleanup() 45 | //{ 46 | // // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. 47 | //} 48 | 49 | #endregion 50 | 51 | /// 52 | ///Gets or sets the test context which provides 53 | ///information about and functionality for the current test run. 54 | /// 55 | public TestContext TestContext 56 | { 57 | get 58 | { 59 | return testContextInstance; 60 | } 61 | set 62 | { 63 | testContextInstance = value; 64 | } 65 | } 66 | private TestContext testContextInstance; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /POS-Coded UITests/CodedUITest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text.RegularExpressions; 4 | using System.Windows.Input; 5 | using System.Windows.Forms; 6 | using System.Drawing; 7 | using Microsoft.VisualStudio.TestTools.UITesting; 8 | using Microsoft.VisualStudio.TestTools.UnitTesting; 9 | using Microsoft.VisualStudio.TestTools.UITest.Extension; 10 | using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard; 11 | 12 | 13 | namespace POS_Coded_UITests 14 | { 15 | /// 16 | /// Summary description for CodedUITest1 17 | /// 18 | [CodedUITest] 19 | public class CodedUITest1 20 | { 21 | public CodedUITest1() 22 | { 23 | } 24 | 25 | [TestMethod] 26 | public void CodedUITestMethod1() 27 | { 28 | // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. 29 | } 30 | 31 | #region Additional test attributes 32 | 33 | // You can use the following additional attributes as you write your tests: 34 | 35 | ////Use TestInitialize to run code before running each test 36 | //[TestInitialize()] 37 | //public void MyTestInitialize() 38 | //{ 39 | // // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. 40 | //} 41 | 42 | ////Use TestCleanup to run code after each test has run 43 | //[TestCleanup()] 44 | //public void MyTestCleanup() 45 | //{ 46 | // // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. 47 | //} 48 | 49 | #endregion 50 | 51 | /// 52 | ///Gets or sets the test context which provides 53 | ///information about and functionality for the current test run. 54 | /// 55 | public TestContext TestContext 56 | { 57 | get 58 | { 59 | return testContextInstance; 60 | } 61 | set 62 | { 63 | testContextInstance = value; 64 | } 65 | } 66 | private TestContext testContextInstance; 67 | 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /POS_DataLibrary/Product.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace POS_DataLibrary 10 | { 11 | public class Product : INotifyPropertyChanged 12 | { 13 | private string uPCCode; 14 | 15 | public string UPCCode 16 | { 17 | get { return uPCCode; } 18 | set 19 | { 20 | uPCCode = value; 21 | RaisePropertyChanged("UPCCode"); 22 | } 23 | } 24 | 25 | private decimal price; 26 | 27 | public decimal Price 28 | { 29 | get { return price; } 30 | set 31 | { 32 | price = value; 33 | RaisePropertyChanged("Price"); 34 | } 35 | } 36 | private string name; 37 | 38 | public string Name 39 | { 40 | get { return name; } 41 | set 42 | { 43 | name = value; 44 | RaisePropertyChanged("Name"); 45 | } 46 | } 47 | 48 | private string categoryName; 49 | 50 | public string CategoryName 51 | { 52 | get { return categoryName; } 53 | set 54 | { 55 | categoryName = value; 56 | RaisePropertyChanged("CategoryName"); 57 | } 58 | } 59 | 60 | private int categoryId; 61 | 62 | public int CategoryId 63 | { 64 | get { return categoryId; } 65 | set 66 | { 67 | categoryId = value; 68 | RaisePropertyChanged("CategoryId"); 69 | } 70 | } 71 | 72 | private Image picture; 73 | 74 | public Image Picture 75 | { 76 | get { return picture; } 77 | set 78 | { 79 | picture = value; 80 | RaisePropertyChanged("Picture"); 81 | } 82 | } 83 | 84 | public event PropertyChangedEventHandler PropertyChanged; 85 | 86 | private void RaisePropertyChanged(string property) 87 | { 88 | if (PropertyChanged != null) 89 | { 90 | PropertyChanged(this, new PropertyChangedEventArgs(property)); 91 | } 92 | } 93 | public override string ToString() 94 | { 95 | return string.Format("{0} | {1}", UPCCode, Name); 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /POS_ViewsLibrary/ViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Collections.ObjectModel; 5 | using System.ComponentModel; 6 | using System.ComponentModel.DataAnnotations; 7 | using System.Linq; 8 | using System.Runtime.CompilerServices; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | 12 | namespace POS_ViewsLibrary 13 | { 14 | public abstract class ViewModel : ObservableObject, IDataErrorInfo, IDisposable 15 | { 16 | /// 17 | /// Gets the validation error for a property whose name matches the specified . 18 | /// 19 | /// The name of the property to validate. 20 | /// Returns a validation error if there is one, otherwise returns null. 21 | public string this[string columnName] 22 | { 23 | get { return OnValidate(columnName); } 24 | } 25 | 26 | /// 27 | /// Not supported. 28 | /// 29 | [Obsolete] 30 | public string Error 31 | { 32 | get { throw new NotSupportedException(); } 33 | } 34 | 35 | /// 36 | /// Validates a property whose name matches the specified . 37 | /// 38 | /// The name of the property to validate. 39 | /// Returns a validation error, if any, otherwise returns null. 40 | protected virtual string OnValidate(string propertyName) 41 | { 42 | var context = new ValidationContext(this) 43 | { 44 | MemberName = propertyName 45 | }; 46 | 47 | var results = new Collection(); 48 | bool isValid = Validator.TryValidateObject(this, context, results, true); 49 | 50 | if (!isValid) 51 | { 52 | ValidationResult result = results.SingleOrDefault(p => 53 | p.MemberNames.Any(memberName => 54 | memberName == propertyName)); 55 | 56 | return result == null ? null : result.ErrorMessage; 57 | } 58 | 59 | return null; 60 | } 61 | 62 | protected virtual void OnDispose() { } 63 | 64 | void IDisposable.Dispose() 65 | { 66 | this.OnDispose(); 67 | } 68 | 69 | } 70 | } -------------------------------------------------------------------------------- /POS_ManagersApp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("POS_ManagersApp")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("POS_ManagersApp")] 15 | [assembly: AssemblyCopyright("Copyright © 2016")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /POS_SellersApp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("POS_SellersApp")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("POS_SellersApp")] 15 | [assembly: AssemblyCopyright("Copyright © 2016")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /POS_DataLibrary/POS_DataLibrary.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {C0873047-8453-4FE7-9BC1-6629C9E3D9F8} 8 | Library 9 | Properties 10 | POS_DataLibrary 11 | POS_DataLibrary 12 | v4.5 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 63 | -------------------------------------------------------------------------------- /POS_SellersApp/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace POS_SellersApp.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("POS_SellersApp.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /POS_ViewsLibrary/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace POS_ViewsLibrary.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | public class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | public static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("POS_ViewsLibrary.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | public static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /POS_ManagersApp/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace POS_ManagersApp.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("POS_ManagersApp.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## POS-PointOfSalesTeamProject 2 | POS Point Of Sales - FastFood Restaurant 3 | 4 | ### Project Description 5 | The application is indented to respond to the needs of a small fast-food restaurant as well as of a chain of restaurants. It includes the features to manage daily sales operations as well as a customized view for managers and authorized staff to track statistics, update prices and products. It has a user-friendly interface, mainly oriented to using screen and minimum keyboard input, very easy to use and It provides a lot of flexibility and maintainability. It is designed as that expansion might happen. It provides two - way relationship between the user and database. 6 | 7 | ### Technologies Used: 8 | * WPF with MVVM (Multiple Views) 9 | * Azure - SQL Database 10 | * Charts, Graphs 11 | * Unit Testing 12 | 13 | ### Special Features: 14 | * User Authentication 15 | * Passing data between different views 16 | * MVVM data Binding 17 | * Price Control 18 | * Printing receipts 19 | * Exporting statistics to PDF and sending via Email 20 | * Using buttons instead of keyboard input 21 | 22 | ### Additional Libraries: 23 | - Modern UI for WPF (Charts and Graphs) 24 | - iTextSharp Library (PDF generation) 25 | 26 | ### Application Overview: 27 | The Application is built with two modules: Managers App for tracking statistics and control products and Sellers App for registering daily sales operations, payments and printing receipts. 28 | The two modules are secured by an authentication feature - a login view 29 | 30 | ![Login View](https://cloud.githubusercontent.com/assets/12819018/19778958/06d023ac-9c4d-11e6-96eb-1d696f0d8c13.png) 31 | 32 | Following the authentication the Seller's Module provides a user-friendly interface which is mainly designed toward using buttons on the screen rather than keyboard input. So we tried to provide functionality from the screen for all the needs. The seller has the products list (dynamically generated from the database) organized in different categories to choose from and populate the order view 33 | 34 | ![Sellers View](https://cloud.githubusercontent.com/assets/12819018/19779172/ebe1a9e8-9c4d-11e6-800d-f2b2bf183b4c.png) 35 | 36 | 37 | The application computes the amount to be paid, registers the payment in the database and prints the receipt. 38 | 39 | ![Receipt Printed](https://cloud.githubusercontent.com/assets/12819018/19779995/7c27537e-9c51-11e6-9928-1de64266568f.png) 40 | 41 | OK, so this application solves one big problem - registering daily sales operations. But how about statistics? So we decided to develop a second Module of the application which would respond to basic managers needs. It has a customized view to track statistics by month in a nice graphical way and generate PDF to be sent by email. 42 | 43 | ![Statistics View](https://cloud.githubusercontent.com/assets/12819018/19780081/d7ce6e24-9c51-11e6-8083-6b8c099665fe.png) 44 | 45 | Also, we Implemented a view to update the products in the database. This way we provide functionality to maintain usual fluctuations in prices and menus. 46 | 47 | ![Add or Edit Products](https://cloud.githubusercontent.com/assets/12819018/19780202/1f1ff540-9c52-11e6-821d-02673d18525a.png) 48 | 49 | ### Authors and Contributors 50 | This project is the result of two member team work: Valentina Migalatii and Olga Racu. 51 | 52 | 53 | -------------------------------------------------------------------------------- /POS_ManagersApp/ViewModels/ManagersMainWindowViewModel.cs: -------------------------------------------------------------------------------- 1 | using POS_DataLibrary; 2 | using POS_ViewsLibrary; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Windows; 9 | 10 | namespace POS_ManagersApp.ViewModels 11 | { 12 | public class ManagersMainWindowViewModel : ViewModel 13 | { 14 | private User userLoggedIn; 15 | public User UserLoggedIn 16 | { 17 | get { return userLoggedIn; } 18 | set 19 | { 20 | userLoggedIn = value; 21 | RaisePropertyChanged("User"); 22 | } 23 | } 24 | 25 | public ManagersMainWindowViewModel() 26 | { 27 | SwitchViews = new ActionCommand((p) => OnSwitchViews(p.ToString())); 28 | SendLogoutMessage = new ActionCommand(p => OnSendLogoutMessage("login")); 29 | 30 | EnabledDashboard = true; 31 | EnabledManageProducts = true; 32 | OnSwitchViews("dashboard"); 33 | } 34 | 35 | 36 | private bool enabledDashboard; 37 | 38 | public bool EnabledDashboard 39 | { 40 | get { return enabledDashboard; } 41 | set 42 | { 43 | enabledDashboard = value; 44 | RaisePropertyChanged("EnabledDashboard"); 45 | } 46 | } 47 | 48 | private bool enabledManageProducts; 49 | 50 | public bool EnabledManageProducts 51 | { 52 | get { return enabledManageProducts; } 53 | set 54 | { 55 | enabledManageProducts = value; 56 | RaisePropertyChanged("EnabledManageProducts"); 57 | } 58 | } 59 | 60 | readonly static DashboardViewModel dash = new DashboardViewModel(); 61 | readonly static ManageProductsViewModel manage = new ManageProductsViewModel(); 62 | private void OnSwitchViews(string destination) 63 | { 64 | 65 | 66 | switch (destination) 67 | { 68 | case "dashboard": 69 | CurrentView = dash; 70 | EnabledDashboard = false; 71 | EnabledManageProducts = true; 72 | break; 73 | 74 | case "manage": 75 | default: 76 | CurrentView = manage; 77 | EnabledManageProducts = false; 78 | EnabledDashboard = true; 79 | break; 80 | } 81 | } 82 | private void OnSendLogoutMessage(string v) 83 | { 84 | MessengerLogout.Default.Send(v); 85 | } 86 | 87 | public ActionCommand SendLogoutMessage { get; private set; } 88 | private ViewModel currentView; 89 | 90 | public ViewModel CurrentView 91 | { 92 | get { return currentView; } 93 | set 94 | { 95 | currentView = value; 96 | RaisePropertyChanged("CurrentView"); 97 | } 98 | } 99 | public ActionCommand SwitchViews { get; private set; } 100 | 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /params.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "POINT OF SALES", 3 | "tagline": "POS Point Of Sales - FastFood Restaurant", 4 | "body": "### Project Description\r\nThe application is indented to respond to the needs of a small fast-food restaurant as well as of a chain of restaurants. It includes the features to manage daily sales operations as well as a customized view for managers and authorized staff to track statistics, update prices and products. It has a user-friendly interface, mainly oriented to using screen and minimum keyboard input, very easy to use and It provides a lot of flexibility and maintainability. It is designed as that expansion might happen. It provides two - way relationship between the user and database.\r\n\r\n### Technologies Used:\r\n* WPF with MVVM (Multiple Views)\r\n* Azure - SQL Database\r\n* Charts, Graphs\r\n* Unit Testing\r\n* LINQ\r\n\r\n### Special Features:\r\n* User Authentication\r\n* Passing data between different views\r\n* MVVM data Binding\r\n* Price Control\r\n* Printing receipts \r\n* Exporting statistics to PDF and sending via Email\r\n* Using buttons instead of keyboard input\r\n\r\n### Additional Libraries:\r\n - Modern UI for WPF (Charts and Graphs)\r\n - iTextSharp Library (PDF generation)\r\n\r\n### Application Overview:\r\nThe Application is built with two modules: Managers App for tracking statistics and control products and Sellers App for registering daily sales operations, payments and printing receipts.\r\nThe two modules are secured by an authentication feature - a login view\r\n\r\n![Login View](https://cloud.githubusercontent.com/assets/12819018/19778958/06d023ac-9c4d-11e6-96eb-1d696f0d8c13.png)\r\n\r\nFollowing the authentication the Seller's Module provides a user-friendly interface which is mainly designed toward using buttons on the screen rather than keyboard input. So we tried to provide functionality from the screen for all the needs. The seller has the products list (dynamically generated from the database) organized in different categories to choose from and populate the order view\r\n\r\n![Sellers View](https://cloud.githubusercontent.com/assets/12819018/19779172/ebe1a9e8-9c4d-11e6-800d-f2b2bf183b4c.png)\r\n\r\n\r\nThe application computes the amount to be paid, registers the payment in the database and prints the receipt.\r\n\r\n![Receipt Printed](https://cloud.githubusercontent.com/assets/12819018/19779995/7c27537e-9c51-11e6-9928-1de64266568f.png)\r\n\r\n OK, so this application solves one big problem - registering daily sales operations. But how about statistics? So we decided to develop a second Module of the application which would respond to basic managers needs. It has a customized view to track statistics by month in a nice graphical way and generate PDF to be sent by email.\r\n\r\n![Statistics View](https://cloud.githubusercontent.com/assets/12819018/19780081/d7ce6e24-9c51-11e6-8083-6b8c099665fe.png)\r\n\r\n Also, we Implemented a view to update the products in the database. This way we provide functionality to maintain usual fluctuations in prices and menus. \r\n\r\n![Add or Edit Products](https://cloud.githubusercontent.com/assets/12819018/19780202/1f1ff540-9c52-11e6-821d-02673d18525a.png)\r\n\r\n### Authors and Contributors\r\nThis project is the result of two member team work: Valentina Migalatii and Olga Racu.\r\n\r\n", 5 | "note": "Don't delete this file! It's used internally to help with page regeneration." 6 | } -------------------------------------------------------------------------------- /POS_Login/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace POS_PointOfSales.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("POS_PointOfSales.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap Logo_Big { 67 | get { 68 | object obj = ResourceManager.GetObject("Logo_Big", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /UnitTests/DatabaseTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | using POS_PointOfSales.ViewModels; 4 | using POS_ViewsLibrary; 5 | using POS_DataLibrary; 6 | using POS_SellersApp.ViewModels; 7 | using System.IO; 8 | using System.Collections.Generic; 9 | using System.Collections.ObjectModel; 10 | using System.Data.SqlClient; 11 | 12 | namespace UnitTests 13 | { 14 | [TestClass] 15 | public class DatabaseTests 16 | { 17 | 18 | [TestMethod] 19 | [ExpectedException(typeof(ArgumentException))] 20 | public void AddNewProduct_ThrowsException_WhenEmptyImagePathIsProvided() 21 | { 22 | var db = new Database(); 23 | string path = ""; 24 | Product product = new Product() 25 | { 26 | CategoryId = 1, 27 | Name = "ProductTest", 28 | Price = 5.2M, 29 | UPCCode = "SAL01" 30 | 31 | }; 32 | db.addProduct(product, path); 33 | } 34 | [TestMethod] 35 | [ExpectedException(typeof(SqlException))] 36 | public void AddNewProduct_ThrowsException_WhenProductNameISNull() 37 | { 38 | var db = new Database(); 39 | string path = "Test.png"; 40 | Product product = new Product() 41 | { 42 | CategoryId = 1, 43 | Name = null, 44 | Price = 5.2M, 45 | UPCCode = "SAL01" 46 | 47 | }; 48 | db.addProduct(product, path); 49 | } 50 | [TestMethod] 51 | [ExpectedException(typeof(FileNotFoundException))] 52 | public void AddNewProduct_ThrowsException_WhenImagePathISNotCorrect() 53 | { 54 | var db = new Database(); 55 | string path = "Test.jpg"; 56 | Product product = new Product() 57 | { 58 | CategoryId = 1, 59 | Name = null, 60 | Price = 5.2M, 61 | UPCCode = "SAL01" 62 | 63 | }; 64 | db.addProduct(product, path); 65 | } 66 | [TestMethod] 67 | public void GetTopFivItemsPerMotnhShouldReturnFiveItems() 68 | { 69 | var db = new Database(); 70 | ObservableCollection salesListTest = db.getTopItemsPerMonth(9, 2016); 71 | Assert.AreEqual(5, salesListTest.Count); 72 | } 73 | [TestMethod] 74 | [ExpectedException(typeof(SqlException))] 75 | public void SQLTransactionRollsBackWhenOrderIsNotValidButOrderItemsIsValid() 76 | { 77 | var db = new Database(); 78 | Order order = new Order 79 | { 80 | OrderId = 1, 81 | Date = DateTime.Now, 82 | StoreNo = null, 83 | UserId = "SEL01", 84 | Tax = 0.15M, 85 | OrderAmount = 0 86 | 87 | }; 88 | List orderItemsTestList = new List(); 89 | orderItemsTestList.Add(new OrderItems 90 | { 91 | CategoryId = 1, 92 | CategoryName = "Meals", 93 | Name = "Test", 94 | OrderId = 1, 95 | Price = 2.4M, 96 | Quantity = 1, 97 | Tax = 0.15, 98 | UPCCode = "SEL01" 99 | }); 100 | db.saveOrderAndOrderItems(order, orderItemsTestList); 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /POS_DataLibrary/OrderItems.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace POS_DataLibrary 9 | { 10 | public class OrderItems : INotifyPropertyChanged 11 | { 12 | private int orderId; 13 | public int OrderId 14 | { 15 | get 16 | { 17 | return orderId; 18 | } 19 | 20 | set 21 | { 22 | orderId = value; 23 | RaisePropertyChanged("OrderId"); 24 | } 25 | } 26 | private int quantity; 27 | public int Quantity 28 | { 29 | get 30 | { 31 | return quantity; 32 | } 33 | 34 | set 35 | { 36 | quantity = value; 37 | RaisePropertyChanged("Quantity"); 38 | RaisePropertyChanged("Total"); 39 | } 40 | } 41 | 42 | public double Tax 43 | { 44 | get 45 | { 46 | return tax; 47 | } 48 | 49 | set 50 | { 51 | tax = value; 52 | RaisePropertyChanged("Tax"); 53 | } 54 | } 55 | public decimal Total 56 | { 57 | get 58 | { 59 | return Quantity * Price; 60 | } 61 | } 62 | private double tax; 63 | 64 | private string uPCCode; 65 | 66 | public string UPCCode 67 | { 68 | get { return uPCCode; } 69 | set 70 | { 71 | uPCCode = value; 72 | RaisePropertyChanged("UPCCode"); 73 | } 74 | } 75 | 76 | private decimal price; 77 | 78 | public decimal Price 79 | { 80 | get { return price; } 81 | set 82 | { 83 | price = value; 84 | RaisePropertyChanged("Price"); 85 | RaisePropertyChanged("Total"); 86 | } 87 | } 88 | private string name; 89 | 90 | public string Name 91 | { 92 | get { return name; } 93 | set 94 | { 95 | name = value; 96 | RaisePropertyChanged("Name"); 97 | } 98 | } 99 | 100 | private string categoryName; 101 | 102 | public string CategoryName 103 | { 104 | get { return categoryName; } 105 | set 106 | { 107 | categoryName = value; 108 | RaisePropertyChanged("CategoryName"); 109 | } 110 | } 111 | private int categoryId; 112 | 113 | public int CategoryId 114 | { 115 | get { return categoryId; } 116 | set 117 | { 118 | categoryId = value; 119 | RaisePropertyChanged("CategoryId"); 120 | } 121 | } 122 | public event PropertyChangedEventHandler PropertyChanged; 123 | 124 | private void RaisePropertyChanged(string property) 125 | { 126 | if (PropertyChanged != null) 127 | { 128 | PropertyChanged(this, new PropertyChangedEventArgs(property)); 129 | } 130 | } 131 | public override string ToString() 132 | { 133 | return Name; 134 | } 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /stylesheets/github-dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2016 GitHub, Inc. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | 24 | */ 25 | 26 | .pl-c /* comment */ { 27 | color: #969896; 28 | } 29 | 30 | .pl-c1 /* constant, variable.other.constant, support, meta.property-name, support.constant, support.variable, meta.module-reference, markup.raw, meta.diff.header */, 31 | .pl-s .pl-v /* string variable */ { 32 | color: #0099cd; 33 | } 34 | 35 | .pl-e /* entity */, 36 | .pl-en /* entity.name */ { 37 | color: #9774cb; 38 | } 39 | 40 | .pl-smi /* variable.parameter.function, storage.modifier.package, storage.modifier.import, storage.type.java, variable.other */, 41 | .pl-s .pl-s1 /* string source */ { 42 | color: #ddd; 43 | } 44 | 45 | .pl-ent /* entity.name.tag */ { 46 | color: #7bcc72; 47 | } 48 | 49 | .pl-k /* keyword, storage, storage.type */ { 50 | color: #cc2372; 51 | } 52 | 53 | .pl-s /* string */, 54 | .pl-pds /* punctuation.definition.string, string.regexp.character-class */, 55 | .pl-s .pl-pse .pl-s1 /* string punctuation.section.embedded source */, 56 | .pl-sr /* string.regexp */, 57 | .pl-sr .pl-cce /* string.regexp constant.character.escape */, 58 | .pl-sr .pl-sre /* string.regexp source.ruby.embedded */, 59 | .pl-sr .pl-sra /* string.regexp string.regexp.arbitrary-repitition */ { 60 | color: #3c66e2; 61 | } 62 | 63 | .pl-v /* variable */ { 64 | color: #fb8764; 65 | } 66 | 67 | .pl-id /* invalid.deprecated */ { 68 | color: #e63525; 69 | } 70 | 71 | .pl-ii /* invalid.illegal */ { 72 | color: #f8f8f8; 73 | background-color: #e63525; 74 | } 75 | 76 | .pl-sr .pl-cce /* string.regexp constant.character.escape */ { 77 | font-weight: bold; 78 | color: #7bcc72; 79 | } 80 | 81 | .pl-ml /* markup.list */ { 82 | color: #c26b2b; 83 | } 84 | 85 | .pl-mh /* markup.heading */, 86 | .pl-mh .pl-en /* markup.heading entity.name */, 87 | .pl-ms /* meta.separator */ { 88 | font-weight: bold; 89 | color: #264ec5; 90 | } 91 | 92 | .pl-mq /* markup.quote */ { 93 | color: #00acac; 94 | } 95 | 96 | .pl-mi /* markup.italic */ { 97 | font-style: italic; 98 | color: #ddd; 99 | } 100 | 101 | .pl-mb /* markup.bold */ { 102 | font-weight: bold; 103 | color: #ddd; 104 | } 105 | 106 | .pl-md /* markup.deleted, meta.diff.header.from-file */ { 107 | color: #bd2c00; 108 | background-color: #ffecec; 109 | } 110 | 111 | .pl-mi1 /* markup.inserted, meta.diff.header.to-file */ { 112 | color: #55a532; 113 | background-color: #eaffea; 114 | } 115 | 116 | .pl-mdr /* meta.diff.range */ { 117 | font-weight: bold; 118 | color: #9774cb; 119 | } 120 | 121 | .pl-mo /* meta.output */ { 122 | color: #264ec5; 123 | } 124 | 125 | -------------------------------------------------------------------------------- /POS_ViewsLibrary/POS_ViewsLibrary.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {359F19F0-2A62-468E-9E74-674B0DA83999} 8 | Library 9 | Properties 10 | POS_ViewsLibrary 11 | POS_ViewsLibrary 12 | v4.5 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | True 62 | True 63 | Resources.resx 64 | 65 | 66 | 67 | 68 | 69 | 70 | {c0873047-8453-4fe7-9bc1-6629c9e3d9f8} 71 | POS_DataLibrary 72 | 73 | 74 | 75 | 76 | PublicResXFileCodeGenerator 77 | Designer 78 | Resources.Designer.cs 79 | 80 | 81 | 82 | 83 | 90 | -------------------------------------------------------------------------------- /POS_Login/ViewModels/LoginViewModel.cs: -------------------------------------------------------------------------------- 1 | using POS_DataLibrary; 2 | using POS_ViewsLibrary; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Windows; 9 | using System.Collections; 10 | using System.Collections.ObjectModel; 11 | using System.ComponentModel.DataAnnotations; 12 | using System.Runtime.Remoting.Contexts; 13 | using System.ComponentModel; 14 | using System.Windows.Threading; 15 | using System.Data.SqlClient; 16 | 17 | namespace POS_PointOfSales.ViewModels 18 | { 19 | public class LoginViewModel : ViewModel 20 | { 21 | //Declare fields 22 | private Database db; 23 | private User user; 24 | 25 | //Properties 26 | public User User 27 | { 28 | get { return user; } 29 | set 30 | { 31 | user = value; 32 | RaisePropertyChanged("User"); 33 | } 34 | } 35 | 36 | private DateTime CurrentTime { get; set; } 37 | private string userName; 38 | [Required] 39 | [StringLength(50, MinimumLength = 4)] 40 | public string UserName 41 | { 42 | get { return userName; } 43 | set 44 | { 45 | userName = value; 46 | RaisePropertyChanged("UserName"); 47 | } 48 | } 49 | private string password; 50 | 51 | [Required] 52 | [StringLength(50, MinimumLength = 4)] 53 | public string Password 54 | { 55 | get { return password; } 56 | set 57 | { 58 | password = value; 59 | RaisePropertyChanged("Password"); 60 | } 61 | } 62 | public string DisplayedImagePath 63 | { 64 | get { return "/POS-PointOfSales;component/Logo_Big.png"; } 65 | } 66 | 67 | public LoginViewModel() 68 | { 69 | User = new User(); 70 | //TODO handle Exceptions 71 | 72 | try 73 | { 74 | db = new Database(); 75 | } 76 | catch (Exception e) 77 | { 78 | MessageBox.Show("fatal Error: Unable to connect to database", "Fatal Error", MessageBoxButton.OK, MessageBoxImage.Stop); 79 | throw e; 80 | } 81 | Login = new ActionCommand(p => OnLogin(UserName, Password), 82 | p => CanLogin); 83 | } 84 | //Declare Commands 85 | public ActionCommand Login { get; set; } 86 | 87 | 88 | 89 | //Method to validate when the login command can execute 90 | public bool CanLogin 91 | { 92 | get 93 | { 94 | return !String.IsNullOrWhiteSpace(UserName) && 95 | !String.IsNullOrWhiteSpace(Password); 96 | } 97 | } 98 | private void OnLogin(string userN, string pass) 99 | { 100 | if (userN != null) 101 | { 102 | try 103 | { 104 | var user = db.getUserByUserName(userN, pass); 105 | if (user != null) 106 | { 107 | User = user; 108 | MessengerUser.Default.Send(User); 109 | UserName = null; 110 | Password = null; 111 | 112 | } 113 | else 114 | { 115 | MessageBox.Show("Could not authenticate user " + UserName); 116 | } 117 | } 118 | catch (SqlException ex) 119 | { 120 | MessageBox.Show("Unable to fetch records from database", "Database Error", MessageBoxButton.OK, MessageBoxImage.Exclamation); 121 | throw ex; 122 | } 123 | } 124 | else 125 | { 126 | MessageBox.Show("You didn't provide an username"); 127 | 128 | } 129 | } 130 | 131 | 132 | 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /DailyScrum.txt: -------------------------------------------------------------------------------- 1 | ---Day01 Tina 2 | 3 | 1. ToDo Initial Project Setup with MVVM Layers 4 | 2. Reasearch how to add dynamic Binding to buttons in MVVM 5 | 3. Need to Reasearch on how to setup a solution with multiple projects 6 | 7 | 8 | 9 | --Day01 Olga 10 | 11 | 1.To Do: Login Screen view -UI Design(Research and implement appropriate layout). 12 | 2. Need Assistance Teacher- Is it a good idea to not have Close window Button on the Login Screen 13 | 2.To Do: Database table Products and Entity Class 14 | 3. Add Button 15 | 16 | 17 | 18 | --Day02 Tina 19 | 1.Done: Initial Project Setup with MVVM Layers. 20 | 2 ToDo: After Teacher Advice We have to make changes to our ERD, and make the Login Project a library and not a project 21 | 3 ToDo: Login Screen Bindings 22 | 23 | 24 | 25 | --Day02 Olga 26 | 1.Done: Started design of login View, prepared the items for products table, Add Binding to DateTime Label in status Bar for loginView 27 | 2.TODO: Design SellersAppMainWindow 28 | 29 | 30 | --Day03 Tina 31 | 1.Done: Logic for Login View. Validation and PaswordBox implementation 32 | 2.ToDo: Create table Products and ProductsCategories and populate with data. ToDo: Logic for SellersAppMainWindow. 33 | Create Model for Products, Products Categories, Orders and OrderDetails and populate them with data. 34 | 35 | 36 | 37 | 38 | --Day03 Olga 39 | 1. Done: Design for Login View, dataBibdig for datetime label 40 | 2. ToDo: Create design for SellersAppMainWindow.Xaml 41 | 42 | 43 | --Day04 Tina 44 | 1.Done: Create table Products and ProductsCategories and populate with data. Started Logic for SellersAppMainWindow. 45 | Create Model for Products, Products Categories. 46 | 2. Din't do: Model for Orders and OrderDetails. It took a lot of time to find out how to pass objects between two viewmodels 47 | 3.TODO: Finish logic for SellersApp. Prototype the ManagersApp 48 | 49 | 50 | 51 | --Day05 Olga 52 | 1.Done: design for SellersAppMainWindow.Xaml. 53 | 2.Din't do: Still some design things to finish. 54 | 3.TODO: Arrange the design for Products Catalog View. Work at the functionality for the SellersMainApp 55 | 56 | 57 | 58 | --WeekEnd Scrum Tina 59 | 1.TODO: Find Bug SellersApp and Finish implementing the products dialog and Orders 60 | 61 | 62 | 63 | --WeekEnd Scrum Olga 64 | 1.TODo: Design Paiment View and Implementing it with logic. Research print receipts. Research Images 65 | 66 | 67 | 68 | --Day06 Tina 69 | 1.Implemented products dialog and orders.Implemented partailly the print button. Setup of ManagersApp with switching functionality. 70 | 2.Didn't do. Could not find bug messenger 71 | 3.Implement paiement view and start working with Managers App 72 | 73 | 74 | --Day06 Olga 75 | 1. Implemented triggers for buttons.. Designed The paiement view. Researched images 76 | 2 Started logic paiement view but nott finished 77 | 3. Finish logic paiement view. Start dashboard ManagersApp 78 | 79 | 80 | --Day07 Tina 81 | 1. Implemented paiement view 82 | 2 Still didn;t find the messenfer bud. Need teacher's assistance 83 | 3.TODo: Implement the dashboard in Managers App 84 | 85 | --Day07 Olga 86 | 1.Finished login paiement view, started Manage products view 87 | 2 TODO: Finish Manage products view and fix the appearance issue 88 | 89 | 90 | 91 | --Day08 Tina 92 | 1. Started Dashboard ManagersView. Implemented PDf and Email 93 | 3.TODo: Finish dashboard, validate products view, Implement all buttons and correct bugs on paiement view. Finish print receipt.Create tests 94 | 95 | --Day08 Olga 96 | 1.Finished Manage products view and fixed the appearance issue 97 | 2 TODO: Finish the images updates, all the design issues. 98 | 99 | 100 | --Day09 Tina 101 | 1. Finish dashboard,Finished print receipt started validate products view, Implemented all buttons and corrected bugs on paiement view. Created tests 102 | 2 Didn't do: CodedUI tests , validation 103 | 3.TODo: Presentation, Exception Handling 104 | 105 | --Day09 Olga 106 | 1.Finished the images updates, all the design issues. 107 | 2 TODO: Presentation 108 | 109 | --Day10 Tina 110 | 1. Finished Presentation and exception Handling 111 | 2.TODo: Nothing left to do.... :) 112 | 113 | --Day09 Olga 114 | 1.Finished the Presentation 115 | 2.TODo: Nothing left to do.... :) 116 | 117 | 118 | -------------------------------------------------------------------------------- /POS_ViewsLibrary/PasswordBoxAssistant.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Controls; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace POS_ViewsLibrary 9 | { 10 | public static class PasswordBoxAssistant 11 | { 12 | public static readonly DependencyProperty BoundPassword = 13 | DependencyProperty.RegisterAttached("BoundPassword", typeof(string), typeof(PasswordBoxAssistant), new PropertyMetadata(string.Empty, OnBoundPasswordChanged)); 14 | 15 | public static readonly DependencyProperty BindPassword = DependencyProperty.RegisterAttached( 16 | "BindPassword", typeof(bool), typeof(PasswordBoxAssistant), new PropertyMetadata(false, OnBindPasswordChanged)); 17 | 18 | private static readonly DependencyProperty UpdatingPassword = 19 | DependencyProperty.RegisterAttached("UpdatingPassword", typeof(bool), typeof(PasswordBoxAssistant), new PropertyMetadata(false)); 20 | 21 | private static void OnBoundPasswordChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 22 | { 23 | PasswordBox box = d as PasswordBox; 24 | 25 | // only handle this event when the property is attached to a PasswordBox 26 | // and when the BindPassword attached property has been set to true 27 | if (d == null || !GetBindPassword(d)) 28 | { 29 | return; 30 | } 31 | 32 | // avoid recursive updating by ignoring the box's changed event 33 | box.PasswordChanged -= HandlePasswordChanged; 34 | 35 | string newPassword = (string)e.NewValue; 36 | 37 | if (!GetUpdatingPassword(box)) 38 | { 39 | box.Password = newPassword; 40 | } 41 | 42 | box.PasswordChanged += HandlePasswordChanged; 43 | } 44 | 45 | private static void OnBindPasswordChanged(DependencyObject dp, DependencyPropertyChangedEventArgs e) 46 | { 47 | // when the BindPassword attached property is set on a PasswordBox, 48 | // start listening to its PasswordChanged event 49 | 50 | PasswordBox box = dp as PasswordBox; 51 | 52 | if (box == null) 53 | { 54 | return; 55 | } 56 | 57 | bool wasBound = (bool)(e.OldValue); 58 | bool needToBind = (bool)(e.NewValue); 59 | 60 | if (wasBound) 61 | { 62 | box.PasswordChanged -= HandlePasswordChanged; 63 | } 64 | 65 | if (needToBind) 66 | { 67 | box.PasswordChanged += HandlePasswordChanged; 68 | } 69 | } 70 | 71 | private static void HandlePasswordChanged(object sender, RoutedEventArgs e) 72 | { 73 | PasswordBox box = sender as PasswordBox; 74 | 75 | // set a flag to indicate that we're updating the password 76 | SetUpdatingPassword(box, true); 77 | // push the new password into the BoundPassword property 78 | SetBoundPassword(box, box.Password); 79 | SetUpdatingPassword(box, false); 80 | } 81 | 82 | public static void SetBindPassword(DependencyObject dp, bool value) 83 | { 84 | dp.SetValue(BindPassword, value); 85 | } 86 | 87 | public static bool GetBindPassword(DependencyObject dp) 88 | { 89 | return (bool)dp.GetValue(BindPassword); 90 | } 91 | 92 | public static string GetBoundPassword(DependencyObject dp) 93 | { 94 | return (string)dp.GetValue(BoundPassword); 95 | } 96 | 97 | public static void SetBoundPassword(DependencyObject dp, string value) 98 | { 99 | dp.SetValue(BoundPassword, value); 100 | } 101 | 102 | private static bool GetUpdatingPassword(DependencyObject dp) 103 | { 104 | return (bool)dp.GetValue(UpdatingPassword); 105 | } 106 | 107 | private static void SetUpdatingPassword(DependencyObject dp, bool value) 108 | { 109 | dp.SetValue(UpdatingPassword, value); 110 | } 111 | 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /POS_SellersApp/SellersStartupViewModel.cs: -------------------------------------------------------------------------------- 1 | using POS_SellersApp.ViewModels; 2 | using POS_ViewsLibrary; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using POS_PointOfSales.ViewModels; 9 | using System.Windows; 10 | using POS_DataLibrary; 11 | using System.Runtime.Remoting.Contexts; 12 | using System.Windows.Threading; 13 | 14 | namespace POS_SellersApp 15 | { 16 | public class SellersStartupViewModel: ViewModel 17 | { 18 | private User userLoggedIn; 19 | 20 | public User User 21 | { 22 | get { return userLoggedIn; } 23 | set 24 | { 25 | userLoggedIn = value; 26 | RaisePropertyChanged("User"); 27 | } 28 | } 29 | 30 | private LoginViewModel loginView = new LoginViewModel(); 31 | 32 | 33 | public SellersStartupViewModel() 34 | { 35 | SwitchViews = new ActionCommand(p => OnSwitchViews("catalog")); 36 | Exit = new ActionCommand(p => OnExit()); 37 | MessengerUser.Default.Register(this, (user) => 38 | { 39 | User = user; 40 | OnSwitchViews("catalog"); 41 | 42 | }); 43 | MessengerLogout.Default.Register(this, (message) => 44 | { 45 | OnSwitchViews(message); 46 | 47 | }); 48 | currentView = loginView; 49 | 50 | _timer = new DispatcherTimer(DispatcherPriority.Render); 51 | _timer.Interval = TimeSpan.FromSeconds(1); 52 | _timer.Tick += (sender, args) => 53 | { 54 | CurrentTime = DateTime.Now.ToLongTimeString(); 55 | }; 56 | _timer.Start(); 57 | } 58 | private ViewModel currentView; 59 | 60 | public ViewModel CurrentView 61 | { 62 | get { return currentView; } 63 | set{ 64 | currentView = value; 65 | 66 | RaisePropertyChanged("CurrentView"); 67 | } 68 | 69 | } 70 | private void OnExit() 71 | { 72 | MessageBoxResult result = MessageBox.Show("You are about to close the application", "Close Application", MessageBoxButton.YesNo, MessageBoxImage.Exclamation); 73 | if (result == MessageBoxResult.Yes) 74 | { 75 | Application.Current.Shutdown(); 76 | } 77 | } 78 | 79 | public ActionCommand SwitchViews { get; private set; } 80 | 81 | readonly static SellersMainWindowViewModel sellersVm = new SellersMainWindowViewModel(); 82 | 83 | private void OnSwitchViews(string destination) 84 | { 85 | if (User == null) 86 | { 87 | return; 88 | } 89 | switch (destination) 90 | { 91 | case "catalog": 92 | if (User.IsManager) 93 | { 94 | MessageBox.Show("You don't have acces from this location") ; 95 | return; 96 | } 97 | try 98 | { 99 | sellersVm.UserLoggedIn = User; 100 | sellersVm.OrderItems.Clear(); 101 | CurrentView = sellersVm; 102 | 103 | } 104 | catch(Exception ex) 105 | { 106 | MessageBox.Show("Error. Could not navigate to next page"); 107 | throw (ex); 108 | } 109 | 110 | break; 111 | case "login": 112 | default: 113 | CurrentView = loginView; 114 | break; 115 | } 116 | 117 | } 118 | #region CurrentTime 119 | 120 | private string _currentTime; 121 | 122 | public DispatcherTimer _timer; 123 | 124 | public string CurrentTime 125 | { 126 | get 127 | { 128 | return this._currentTime; 129 | } 130 | set 131 | { 132 | if (_currentTime == value) 133 | return; 134 | _currentTime = value; 135 | RaisePropertyChanged("CurrentTime"); 136 | } 137 | } 138 | #endregion 139 | 140 | public ActionCommand Exit { get; set; } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /POS-PointOfSales.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DesktopApp", "DesktopApp", "{8DB27E47-BFC7-423D-B1FD-555A1C9677F6}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{DE412477-E216-4A17-8B4B-8497452AE32F}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "POS-Login", "POS_Login\POS-Login.csproj", "{603BEEC0-FC88-4893-8121-C8E5D67220EB}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "POS_SellersApp", "POS_SellersApp\POS_SellersApp.csproj", "{273358D8-D807-4314-9BFB-F495ED4F9859}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "POS_ManagersApp", "POS_ManagersApp\POS_ManagersApp.csproj", "{9D209C3F-51DA-4B0C-8243-2F9200B65A68}" 15 | EndProject 16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "POS_DataLibrary", "POS_DataLibrary\POS_DataLibrary.csproj", "{C0873047-8453-4FE7-9BC1-6629C9E3D9F8}" 17 | EndProject 18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "POS_ViewsLibrary", "POS_ViewsLibrary\POS_ViewsLibrary.csproj", "{359F19F0-2A62-468E-9E74-674B0DA83999}" 19 | EndProject 20 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "POS-UnitTests", "UnitTests\POS-UnitTests.csproj", "{3430C410-8572-42D3-9A9A-BCC975E7E882}" 21 | EndProject 22 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "POS-CodedUITests", "POS-CodedUITests\POS-CodedUITests.csproj", "{D732D899-5BE1-4B8F-B5AC-40F8C30540CE}" 23 | EndProject 24 | Global 25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 26 | Debug|Any CPU = Debug|Any CPU 27 | Release|Any CPU = Release|Any CPU 28 | EndGlobalSection 29 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 30 | {603BEEC0-FC88-4893-8121-C8E5D67220EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {603BEEC0-FC88-4893-8121-C8E5D67220EB}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {603BEEC0-FC88-4893-8121-C8E5D67220EB}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {603BEEC0-FC88-4893-8121-C8E5D67220EB}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {273358D8-D807-4314-9BFB-F495ED4F9859}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {273358D8-D807-4314-9BFB-F495ED4F9859}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {273358D8-D807-4314-9BFB-F495ED4F9859}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {273358D8-D807-4314-9BFB-F495ED4F9859}.Release|Any CPU.Build.0 = Release|Any CPU 38 | {9D209C3F-51DA-4B0C-8243-2F9200B65A68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {9D209C3F-51DA-4B0C-8243-2F9200B65A68}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {9D209C3F-51DA-4B0C-8243-2F9200B65A68}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {9D209C3F-51DA-4B0C-8243-2F9200B65A68}.Release|Any CPU.Build.0 = Release|Any CPU 42 | {C0873047-8453-4FE7-9BC1-6629C9E3D9F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 43 | {C0873047-8453-4FE7-9BC1-6629C9E3D9F8}.Debug|Any CPU.Build.0 = Debug|Any CPU 44 | {C0873047-8453-4FE7-9BC1-6629C9E3D9F8}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {C0873047-8453-4FE7-9BC1-6629C9E3D9F8}.Release|Any CPU.Build.0 = Release|Any CPU 46 | {359F19F0-2A62-468E-9E74-674B0DA83999}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 47 | {359F19F0-2A62-468E-9E74-674B0DA83999}.Debug|Any CPU.Build.0 = Debug|Any CPU 48 | {359F19F0-2A62-468E-9E74-674B0DA83999}.Release|Any CPU.ActiveCfg = Release|Any CPU 49 | {359F19F0-2A62-468E-9E74-674B0DA83999}.Release|Any CPU.Build.0 = Release|Any CPU 50 | {3430C410-8572-42D3-9A9A-BCC975E7E882}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 51 | {3430C410-8572-42D3-9A9A-BCC975E7E882}.Debug|Any CPU.Build.0 = Debug|Any CPU 52 | {3430C410-8572-42D3-9A9A-BCC975E7E882}.Release|Any CPU.ActiveCfg = Release|Any CPU 53 | {3430C410-8572-42D3-9A9A-BCC975E7E882}.Release|Any CPU.Build.0 = Release|Any CPU 54 | {D732D899-5BE1-4B8F-B5AC-40F8C30540CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 55 | {D732D899-5BE1-4B8F-B5AC-40F8C30540CE}.Debug|Any CPU.Build.0 = Debug|Any CPU 56 | {D732D899-5BE1-4B8F-B5AC-40F8C30540CE}.Release|Any CPU.ActiveCfg = Release|Any CPU 57 | {D732D899-5BE1-4B8F-B5AC-40F8C30540CE}.Release|Any CPU.Build.0 = Release|Any CPU 58 | EndGlobalSection 59 | GlobalSection(SolutionProperties) = preSolution 60 | HideSolutionNode = FALSE 61 | EndGlobalSection 62 | GlobalSection(NestedProjects) = preSolution 63 | {603BEEC0-FC88-4893-8121-C8E5D67220EB} = {8DB27E47-BFC7-423D-B1FD-555A1C9677F6} 64 | {273358D8-D807-4314-9BFB-F495ED4F9859} = {8DB27E47-BFC7-423D-B1FD-555A1C9677F6} 65 | {9D209C3F-51DA-4B0C-8243-2F9200B65A68} = {8DB27E47-BFC7-423D-B1FD-555A1C9677F6} 66 | {C0873047-8453-4FE7-9BC1-6629C9E3D9F8} = {8DB27E47-BFC7-423D-B1FD-555A1C9677F6} 67 | {359F19F0-2A62-468E-9E74-674B0DA83999} = {8DB27E47-BFC7-423D-B1FD-555A1C9677F6} 68 | {3430C410-8572-42D3-9A9A-BCC975E7E882} = {DE412477-E216-4A17-8B4B-8497452AE32F} 69 | {D732D899-5BE1-4B8F-B5AC-40F8C30540CE} = {DE412477-E216-4A17-8B4B-8497452AE32F} 70 | EndGlobalSection 71 | EndGlobal 72 | -------------------------------------------------------------------------------- /POS_SellersApp/ViewModels/ProductsCatalogViewModel.cs: -------------------------------------------------------------------------------- 1 | using POS_ViewsLibrary; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Collections.ObjectModel; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using POS_DataLibrary; 9 | using System.Windows; 10 | 11 | namespace POS_SellersApp.ViewModels 12 | { 13 | public class ProductsCatalogViewModel : ViewModel 14 | { 15 | private Database db; 16 | private ObservableCollection catalogCollection; 17 | 18 | public ObservableCollection CatalogCollection 19 | { 20 | get { return catalogCollection; } 21 | set 22 | { 23 | catalogCollection = value; 24 | RaisePropertyChanged("CatalogCollection"); 25 | } 26 | } 27 | 28 | public ActionCommand SwitchViews { get; private set; } 29 | public ActionCommand AddToOrder { get; private set; } 30 | 31 | 32 | 33 | public ProductsCatalogViewModel() 34 | { 35 | try 36 | { 37 | db = new Database(); 38 | } 39 | catch (Exception e) 40 | { 41 | MessageBox.Show("fatal Error: Unable to connect to database", "Fatal Error", MessageBoxButton.OK, MessageBoxImage.Stop); 42 | throw e; 43 | } 44 | 45 | CatalogCollection = db.GetProductsByCategory("Meals"); 46 | SwitchViews = new ActionCommand((param) => 47 | { 48 | OnSwitchViews(param.ToString()); 49 | }); 50 | AddToOrder = new ActionCommand((param) => 51 | { 52 | OnAddToOrder(param as Product); 53 | }); 54 | Category = "Meals"; 55 | 56 | EnabledMeals = false; 57 | EnabledDrinks = true; 58 | EnabledDeserts = true; 59 | } 60 | private string category; 61 | public string Category 62 | { 63 | get 64 | { 65 | return category; 66 | } 67 | 68 | set 69 | { 70 | category = value; 71 | RaisePropertyChanged("Category"); 72 | } 73 | } 74 | private void OnSwitchViews(string destination) 75 | { 76 | try 77 | { 78 | switch (destination) 79 | { 80 | case "Meals": 81 | CatalogCollection = db.GetProductsByCategory("Meals"); 82 | Category = "Meals"; 83 | EnabledMeals = false; 84 | EnabledDrinks = true; 85 | EnabledDeserts = true; 86 | break; 87 | case "Drinks": 88 | CatalogCollection = db.GetProductsByCategory("Drinks"); 89 | Category = "Drinks"; 90 | EnabledMeals = true; 91 | EnabledDrinks = false; 92 | EnabledDeserts = true; 93 | break; 94 | case "Desserts": 95 | default: 96 | CatalogCollection = db.GetProductsByCategory("Desserts"); 97 | Category = "Desserts"; 98 | EnabledMeals = true; 99 | EnabledDrinks = true; 100 | EnabledDeserts = false; 101 | break; 102 | } 103 | } 104 | catch (Exception) 105 | { 106 | MessageBox.Show("Could not fetch product categories feom the database", "Database Error", MessageBoxButton.OK, MessageBoxImage.Error); 107 | } 108 | } 109 | 110 | 111 | private bool enabledMeals; 112 | 113 | public bool EnabledMeals 114 | { 115 | get { return enabledMeals; } 116 | set 117 | { 118 | enabledMeals = value; 119 | RaisePropertyChanged("EnabledMeals"); 120 | } 121 | } 122 | 123 | private bool enabledDrinks; 124 | 125 | public bool EnabledDrinks 126 | { 127 | get { return enabledDrinks; } 128 | set 129 | { 130 | enabledDrinks = value; 131 | RaisePropertyChanged("EnabledDrinks"); 132 | } 133 | } 134 | 135 | 136 | private bool enabledDeserts; 137 | 138 | public bool EnabledDeserts 139 | { 140 | get { return enabledDeserts; } 141 | set 142 | { 143 | enabledDeserts = value; 144 | RaisePropertyChanged("EnabledDeserts"); 145 | } 146 | } 147 | 148 | private void OnAddToOrder(Product product) 149 | { 150 | if (product != null) 151 | { 152 | MessengerPoduct.Default.Send(product); 153 | 154 | } 155 | } 156 | 157 | } 158 | } 159 | -------------------------------------------------------------------------------- /POS-Coded UITests/POS-Coded UITests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 7 | 8 | 2.0 9 | {76423269-E8AB-4D64-B068-A66A6F3237CD} 10 | Library 11 | Properties 12 | POS_Coded_UITests 13 | POS-Coded UITests 14 | v4.5.1 15 | 512 16 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 17 | 10.0 18 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 19 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages 20 | True 21 | CodedUITest 22 | 23 | 24 | true 25 | full 26 | false 27 | bin\Debug\ 28 | DEBUG;TRACE 29 | prompt 30 | 4 31 | 32 | 33 | pdbonly 34 | true 35 | bin\Release\ 36 | TRACE 37 | prompt 38 | 4 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | False 51 | 52 | 53 | 54 | 55 | 56 | 57 | UIMap.uitest 58 | 59 | 60 | UIMap.uitest 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | False 71 | 72 | 73 | False 74 | 75 | 76 | False 77 | 78 | 79 | False 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 100 | -------------------------------------------------------------------------------- /POS-CodedUITests/POS-CodedUITests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 7 | 8 | 2.0 9 | {D732D899-5BE1-4B8F-B5AC-40F8C30540CE} 10 | Library 11 | Properties 12 | POS_CodedUITests 13 | POS-CodedUITests 14 | v4.5 15 | 512 16 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 17 | 10.0 18 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 19 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages 20 | True 21 | CodedUITest 22 | 23 | 24 | 25 | true 26 | full 27 | false 28 | bin\Debug\ 29 | DEBUG;TRACE 30 | prompt 31 | 4 32 | 33 | 34 | pdbonly 35 | true 36 | bin\Release\ 37 | TRACE 38 | prompt 39 | 4 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | False 52 | 53 | 54 | 55 | 56 | 57 | 58 | UIMap.uitest 59 | 60 | 61 | UIMap.uitest 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | False 72 | 73 | 74 | False 75 | 76 | 77 | False 78 | 79 | 80 | False 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 101 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | *.VC.VC.opendb 85 | 86 | # Visual Studio profiler 87 | *.psess 88 | *.vsp 89 | *.vspx 90 | *.sap 91 | 92 | # TFS 2012 Local Workspace 93 | $tf/ 94 | 95 | # Guidance Automation Toolkit 96 | *.gpState 97 | 98 | # ReSharper is a .NET coding add-in 99 | _ReSharper*/ 100 | *.[Rr]e[Ss]harper 101 | *.DotSettings.user 102 | 103 | # JustCode is a .NET coding add-in 104 | .JustCode 105 | 106 | # TeamCity is a build add-in 107 | _TeamCity* 108 | 109 | # DotCover is a Code Coverage Tool 110 | *.dotCover 111 | 112 | # NCrunch 113 | _NCrunch_* 114 | .*crunch*.local.xml 115 | nCrunchTemp_* 116 | 117 | # MightyMoose 118 | *.mm.* 119 | AutoTest.Net/ 120 | 121 | # Web workbench (sass) 122 | .sass-cache/ 123 | 124 | # Installshield output folder 125 | [Ee]xpress/ 126 | 127 | # DocProject is a documentation generator add-in 128 | DocProject/buildhelp/ 129 | DocProject/Help/*.HxT 130 | DocProject/Help/*.HxC 131 | DocProject/Help/*.hhc 132 | DocProject/Help/*.hhk 133 | DocProject/Help/*.hhp 134 | DocProject/Help/Html2 135 | DocProject/Help/html 136 | 137 | # Click-Once directory 138 | publish/ 139 | 140 | # Publish Web Output 141 | *.[Pp]ublish.xml 142 | *.azurePubxml 143 | # TODO: Comment the next line if you want to checkin your web deploy settings 144 | # but database connection strings (with potential passwords) will be unencrypted 145 | *.pubxml 146 | *.publishproj 147 | 148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 149 | # checkin your Azure Web App publish settings, but sensitive information contained 150 | # in these scripts will be unencrypted 151 | PublishScripts/ 152 | 153 | # NuGet Packages 154 | *.nupkg 155 | # The packages folder can be ignored because of Package Restore 156 | **/packages/* 157 | # except build/, which is used as an MSBuild target. 158 | !**/packages/build/ 159 | # Uncomment if necessary however generally it will be regenerated when needed 160 | #!**/packages/repositories.config 161 | # NuGet v3's project.json files produces more ignoreable files 162 | *.nuget.props 163 | *.nuget.targets 164 | 165 | # Microsoft Azure Build Output 166 | csx/ 167 | *.build.csdef 168 | 169 | # Microsoft Azure Emulator 170 | ecf/ 171 | rcf/ 172 | 173 | # Windows Store app package directories and files 174 | AppPackages/ 175 | BundleArtifacts/ 176 | Package.StoreAssociation.xml 177 | _pkginfo.txt 178 | 179 | # Visual Studio cache files 180 | # files ending in .cache can be ignored 181 | *.[Cc]ache 182 | # but keep track of directories ending in .cache 183 | !*.[Cc]ache/ 184 | 185 | # Others 186 | ClientBin/ 187 | ~$* 188 | *~ 189 | *.dbmdl 190 | *.dbproj.schemaview 191 | *.pfx 192 | *.publishsettings 193 | node_modules/ 194 | orleans.codegen.cs 195 | 196 | # Since there are multiple workflows, uncomment next line to ignore bower_components 197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 198 | #bower_components/ 199 | 200 | # RIA/Silverlight projects 201 | Generated_Code/ 202 | 203 | # Backup & report files from converting an old project file 204 | # to a newer Visual Studio version. Backup files are not needed, 205 | # because we have git ;-) 206 | _UpgradeReport_Files/ 207 | Backup*/ 208 | UpgradeLog*.XML 209 | UpgradeLog*.htm 210 | 211 | # SQL Server files 212 | *.mdf 213 | *.ldf 214 | 215 | # Business Intelligence projects 216 | *.rdl.data 217 | *.bim.layout 218 | *.bim_*.settings 219 | 220 | # Microsoft Fakes 221 | FakesAssemblies/ 222 | 223 | # GhostDoc plugin setting file 224 | *.GhostDoc.xml 225 | 226 | # Node.js Tools for Visual Studio 227 | .ntvs_analysis.dat 228 | 229 | # Visual Studio 6 build log 230 | *.plg 231 | 232 | # Visual Studio 6 workspace options file 233 | *.opt 234 | 235 | # Visual Studio LightSwitch build output 236 | **/*.HTMLClient/GeneratedArtifacts 237 | **/*.DesktopClient/GeneratedArtifacts 238 | **/*.DesktopClient/ModelManifest.xml 239 | **/*.Server/GeneratedArtifacts 240 | **/*.Server/ModelManifest.xml 241 | _Pvt_Extensions 242 | 243 | # Paket dependency manager 244 | .paket/paket.exe 245 | paket-files/ 246 | 247 | # FAKE - F# Make 248 | .fake/ 249 | 250 | # JetBrains Rider 251 | .idea/ 252 | *.sln.iml 253 | -------------------------------------------------------------------------------- /POS_Login/POS-Login.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {603BEEC0-FC88-4893-8121-C8E5D67220EB} 8 | WinExe 9 | Properties 10 | POS_PointOfSales 11 | POS-PointOfSales 12 | v4.5 13 | 512 14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15 | 4 16 | true 17 | 18 | 19 | 20 | AnyCPU 21 | true 22 | full 23 | false 24 | bin\Debug\ 25 | DEBUG;TRACE 26 | prompt 27 | 4 28 | 29 | 30 | AnyCPU 31 | pdbonly 32 | true 33 | bin\Release\ 34 | TRACE 35 | prompt 36 | 4 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 4.0 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | MSBuild:Compile 59 | Designer 60 | 61 | 62 | App.xaml 63 | Code 64 | 65 | 66 | 67 | LoginView.xaml 68 | 69 | 70 | 71 | 72 | True 73 | True 74 | Resources.resx 75 | 76 | 77 | True 78 | Settings.settings 79 | True 80 | 81 | 82 | ResXFileCodeGenerator 83 | Resources.Designer.cs 84 | 85 | 86 | SettingsSingleFileGenerator 87 | Settings.Designer.cs 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | {c0873047-8453-4fe7-9bc1-6629c9e3d9f8} 97 | POS_DataLibrary 98 | 99 | 100 | {359f19f0-2a62-468e-9e74-674b0da83999} 101 | POS_ViewsLibrary 102 | 103 | 104 | 105 | 106 | MSBuild:Compile 107 | Designer 108 | 109 | 110 | 111 | 112 | Always 113 | 114 | 115 | 116 | 117 | PreserveNewest 118 | 119 | 120 | 121 | 128 | -------------------------------------------------------------------------------- /POS_ManagersApp/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /UnitTests/POS-UnitTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {3430C410-8572-42D3-9A9A-BCC975E7E882} 7 | Library 8 | Properties 9 | UnitTests 10 | UnitTests 11 | v4.5 12 | 512 13 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 10.0 15 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 16 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages 17 | False 18 | UnitTest 19 | 20 | 21 | 22 | true 23 | full 24 | false 25 | bin\Debug\ 26 | DEBUG;TRACE 27 | prompt 28 | 4 29 | 30 | 31 | pdbonly 32 | true 33 | bin\Release\ 34 | TRACE 35 | prompt 36 | 4 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | False 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | {c0873047-8453-4fe7-9bc1-6629c9e3d9f8} 66 | POS_DataLibrary 67 | 68 | 69 | {603beec0-fc88-4893-8121-c8e5d67220eb} 70 | POS-Login 71 | 72 | 73 | {9d209c3f-51da-4b0c-8243-2f9200b65a68} 74 | POS_ManagersApp 75 | 76 | 77 | {273358d8-d807-4314-9bfb-f495ed4f9859} 78 | POS_SellersApp 79 | 80 | 81 | {359f19f0-2a62-468e-9e74-674b0da83999} 82 | POS_ViewsLibrary 83 | 84 | 85 | 86 | 87 | 88 | 89 | False 90 | 91 | 92 | False 93 | 94 | 95 | False 96 | 97 | 98 | False 99 | 100 | 101 | 102 | 103 | 104 | 105 | 112 | -------------------------------------------------------------------------------- /POS_ManagersApp/ManagersStartupViewModel.cs: -------------------------------------------------------------------------------- 1 | using POS_ViewsLibrary; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using POS_PointOfSales.ViewModels; 8 | using System.Windows; 9 | using POS_DataLibrary; 10 | using System.Runtime.Remoting.Contexts; 11 | using System.Windows.Threading; 12 | using POS_ManagersApp.ViewModels; 13 | 14 | namespace POS_ManagersApp 15 | 16 | { 17 | public class ManagersStartupViewModel: ViewModel 18 | { 19 | private User userLoggedIn; 20 | 21 | public User User 22 | { 23 | get { return userLoggedIn; } 24 | set 25 | { 26 | userLoggedIn = value; 27 | RaisePropertyChanged("User"); 28 | } 29 | } 30 | 31 | private LoginViewModel loginViewManager = new LoginViewModel(); 32 | 33 | 34 | public ManagersStartupViewModel() 35 | { 36 | SwitchViews = new ActionCommand(p => OnSwitchViews("dashboard")); 37 | Exit = new ActionCommand(p => OnExit()); 38 | MessengerUser.Default.Register(this, (user) => 39 | { 40 | User = user; 41 | OnSwitchViews("dashboard"); 42 | 43 | }); 44 | MessengerLogout.Default.Register(this, (message) => 45 | { 46 | OnSwitchViews(message); 47 | 48 | }); 49 | currentView = loginViewManager; 50 | 51 | timer = new DispatcherTimer(DispatcherPriority.Render); 52 | timer.Interval = TimeSpan.FromSeconds(1); 53 | timer.Tick += (sender, args) => 54 | { 55 | CurrentTime = DateTime.Now.ToLongTimeString(); 56 | }; 57 | timer.Start(); 58 | } 59 | 60 | private ViewModel currentView; 61 | 62 | public ViewModel CurrentView 63 | { 64 | get { return currentView; } 65 | set{ 66 | currentView = value; 67 | 68 | RaisePropertyChanged("CurrentView"); 69 | } 70 | 71 | } 72 | 73 | public ActionCommand SwitchViews { get; private set; } 74 | 75 | readonly static ManagersMainWindowViewModel managersVm = new ManagersMainWindowViewModel(); 76 | 77 | private void OnSwitchViews(string destination) 78 | { 79 | if (User == null) 80 | { 81 | return; 82 | } 83 | switch (destination) 84 | { 85 | case "dashboard": 86 | if (!User.IsManager) 87 | { 88 | MessageBox.Show("You don't have acces from this location") ; 89 | return; 90 | } 91 | try 92 | { 93 | managersVm.UserLoggedIn = User; 94 | CurrentView = managersVm; 95 | 96 | } 97 | catch(Exception ex) 98 | { 99 | MessageBox.Show("Error. Could not navigate to next page"); 100 | throw (ex); 101 | } 102 | 103 | break; 104 | case "login": 105 | default: 106 | CurrentView = loginViewManager; 107 | break; 108 | } 109 | 110 | } 111 | #region CurrentTime 112 | 113 | private string currentTime; 114 | 115 | public DispatcherTimer timer; 116 | 117 | public string CurrentTime 118 | { 119 | get 120 | { 121 | return this.currentTime; 122 | } 123 | set 124 | { 125 | if (currentTime == value) 126 | return; 127 | currentTime = value; 128 | RaisePropertyChanged("CurrentTime"); 129 | } 130 | } 131 | 132 | 133 | //private string _currentTime, _currentDate; 134 | 135 | //private void DispatcherTimerSetup() 136 | //{ 137 | // DispatcherTimer dispatcherTimer = new DispatcherTimer(); 138 | // dispatcherTimer.Interval = TimeSpan.FromSeconds(1); 139 | // dispatcherTimer.Tick += new EventHandler(CurrentTimeText); 140 | // dispatcherTimer.Start(); 141 | //} 142 | 143 | //private void CurrentDateText() 144 | //{ 145 | // CurrentDate = DateTime.Now.ToString("g"); 146 | //} 147 | 148 | //private void CurrentTimeText(object sender, EventArgs e) 149 | //{ 150 | // CurrentTime = DateTime.Now.ToString("HH:mm"); 151 | //} 152 | 153 | //public string CurrentTime 154 | //{ 155 | // get { return _currentTime; } 156 | // set 157 | // { 158 | // if (_currentTime != null) 159 | // _currentTime = value; 160 | 161 | // RaisePropertyChanged("CurrentTime"); 162 | // } 163 | //} 164 | 165 | //public string CurrentDate 166 | //{ 167 | // get { return _currentDate; } 168 | // set 169 | // { 170 | // if (_currentDate != value) 171 | // _currentDate = value; 172 | // RaisePropertyChanged("CurrentDate"); 173 | // } 174 | //} 175 | #endregion 176 | 177 | public ActionCommand Exit { get; set; } 178 | 179 | private void OnExit() 180 | { 181 | MessageBoxResult result = MessageBox.Show("You are about to close the application.Are you sure?", "Close Application", MessageBoxButton.YesNo, MessageBoxImage.Exclamation); 182 | if (result == MessageBoxResult.Yes) 183 | { 184 | Application.Current.Shutdown(); 185 | } 186 | } 187 | 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /POS_ManagersApp/ManagersStartupView.xaml: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 93 | 94 | 95 | 96 | 97 |