private void OnOpenAmendSalesCommand(object showAll)
 {
     //_documentViewModels.Add(new SalesEntryViewModel(showAllBool));
     //ActiveDocument = _documentViewModels.Last();
     try
     {
         AmendSales amendSales = new AmendSales(false);
         amendSales.ShowDialog();
     }
     catch (Exceptions.RMSException ex)
     {
         Utility.ShowErrorBox(ex.Message);
     }
     catch (Exception ex)
     {
         Utility.ShowErrorBox(ex.Message);
         //log here
     }
 }
Exemple #2
0
        private void HandleKeyDownEvent(object sender, KeyEventArgs e)
        {
            if (!((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Shift)) == (ModifierKeys.Control | ModifierKeys.Shift)))
            {
                return;
            }

            if (Keyboard.IsKeyDown(Key.P) && Keyboard.IsKeyDown(Key.R))
            {
                Workspace.This.OpenDailyPurchaseReportCommand.Execute(true);
                return;
            }

            if (Keyboard.IsKeyDown(Key.S) && Keyboard.IsKeyDown(Key.R))
            {
                Workspace.This.OpenReturnSalesCommand.Execute(true);
                return;
            }

            switch (e.Key)
            {
            //Sales Entry
            case Key.S:
            {
                var saleParams = new SalesParams()
                {
                    ShowAllCustomers = true, IsTempDataWindow = true
                };
                Workspace.This.OpenSalesEntryCommand.Execute(saleParams);
                return;
            }

            //Sales Amend
            case Key.A:
            {
                try
                {
                    AmendSales amendSales = new AmendSales(true);
                    amendSales.ShowDialog();
                }
                catch (Exceptions.RMSException ex)
                {
                    Utility.ShowErrorBox(ex.Message);
                }
                catch (Exception ex)
                {
                    Utility.ShowErrorBox(ex.Message);
                }
                return;
            }


            //Sales Return
            case Key.P:
            {
                var purchaseParams = new PurchaseParams()
                {
                    ShowAllCompanies = true
                };
                Workspace.This.OpenPurchaseEntryCommand.Execute(purchaseParams);
                return;
            }
            }
        }