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;
        }
예제 #2
0
 private void DeleteTransactionEntry()
 {
     if (SalesVM.TransactionData.CurrentTransactionEntry != null)
     {
         SalesVM.DeleteTransactionEntry <TransactionEntryBase>(SalesVM.TransactionData.CurrentTransactionEntry);
     }
 }
예제 #3
0
        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();
        }
예제 #4
0
        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);
            }
        }
예제 #5
0
        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);
                }
            }
        }
예제 #6
0
 static SalesVM()
 {
     _instance = new SalesVM(new UnityContainer(), new EventAggregator(), new RegionManager());
 }