public SalesView(SalesVM salesVM) { InitializeComponent(); DataContext = salesVM; salesvm = salesVM; SalesPad.SalesVM = salesVM; SalesPad.SalesView = this; ((INotifyCollectionChanged)SalesLst.Items).CollectionChanged += SalesView_CollectionChanged; SalesLst.SelectionChanged += SalesLst_SelectionChanged; SalesLst.LayoutUpdated += SalesLst_LayoutUpdated; HideReceipt(); ShowTransaction(); SetUpSalesPad(); ObservableObject <object> viewRegionContext = RegionContext.GetObservableContext(this); viewRegionContext.PropertyChanged += this.ViewRegionContext_OnPropertyChangedEvent; }
private void DeleteTransactionEntry() { if (SalesVM.TransactionData.CurrentTransactionEntry != null) { SalesVM.DeleteTransactionEntry <TransactionEntryBase>(SalesVM.TransactionData.CurrentTransactionEntry); } }
public SalesView(SalesVM salesVM) { InitializeComponent(); DataContext = salesVM; salesvm = salesVM; SalesPad.SalesVM = salesVM; SalesPad.SalesView = this; salesVM.PropertyChanged += salesVM_PropertyChanged; ((INotifyCollectionChanged)SalesLst.Items).CollectionChanged += SalesView_CollectionChanged; SalesLst.SelectionChanged += SalesLst_SelectionChanged; // SalesPad.LayoutUpdated += SalesPad_LayoutUpdated; //SalesLst.SizeChanged += SalesLst_SizeChanged; SalesLst.LayoutUpdated += SalesLst_LayoutUpdated; // salesVM.ParentCanvas = ppcan; HideChange(); HideTender(); HideReceipt(); ShowTransaction(); SetUpSalesPad(); }
private void LocalProcesItem(object itm) { if (itm == null) { return; } if (itm.GetType() == typeof(RMSDataAccessLayer.SearchItem)) { switch (((ISearchItem)itm).DisplayName) { case "Add Patient": Patient p = SalesVM.CreateNewEntity <Patient>(); SalesVM.rms.Persons.AddObject(p); ItemEditor.Content = p; break; case "Add Doctor": Doctor d = SalesVM.CreateNewEntity <Doctor>(); SalesVM.rms.Persons.AddObject(d); ItemEditor.Content = d; break; default: ItemEditor.Content = ((RMSDataAccessLayer.SearchItem)itm).SearchObject; break; } } else if (itm.GetType() == typeof(RMSDataAccessLayer.Pass) && ((RMSDataAccessLayer.Pass)itm).Status.Contains("Invalid") == true) { TransStatusTxt.Text = "Invalid Pass"; TransStatusTxt.Focus(); } else { SalesVM.ProcessSearchListItem(itm); MoveToNextControl(ItemEditor); } }
private void LocalProcesItem(object itm) { if (itm == null) { return; } if (edititem == true) { ItemEditor.Content = itm; edititem = false; return; } if (itm.GetType() == typeof(RMSDataAccessLayer.SearchItem)) { switch (((ISearchItem)itm).DisplayName) { case "Add Patient": Patient p = SalesVM.Instance.CreateNewPatient(); // SalesVM.rms.Persons.AddObject(p); ItemEditor.Content = p; break; case "Add Doctor": Doctor d = SalesVM.Instance.CreateNewDoctor(); // SalesVM.rms.Persons.AddObject(d); ItemEditor.Content = d; break; default: ItemEditor.Content = ((RMSDataAccessLayer.SearchItem)itm).SearchObject; break; } } else { if (showPatientPrescriptions == true) { if (itm.GetType() == typeof(RMSDataAccessLayer.Patient)) { ItemEditor.Content = SalesVM.Instance.GetPatientTransactionList(itm as Patient); showPatientPrescriptions = false; } if (itm.GetType() == typeof(RMSDataAccessLayer.Doctor)) { ItemEditor.Content = SalesVM.Instance.GetDoctorTransactionList(itm as Doctor); showPatientPrescriptions = false; } } else { SalesVM.ProcessSearchListItem(itm); MoveToNextControl(ItemEditor); } } }
static SalesVM() { _instance = new SalesVM(new UnityContainer(), new EventAggregator(), new RegionManager()); }