コード例 #1
0
        public override void Void()
        {
            /*Check cashier authorization level whether has authority or not.*/

            if (!cr.IsAuthorisedFor(Authorizations.VoidSale))
            {
                cr.State = ConfirmAuthorization.Instance(VoidSale, Continue, Authorizations.VoidSale);
            }
            else
            {
                //do as 1X[IPTAL]
                DisplayAdapter.Cashier.Pause();
                cr.State = EnterNumber.Instance();
                cr.State.Numeric('1');
                DisplayAdapter.Cashier.Play();
                cr.State.Void();
            };
        }
コード例 #2
0
ファイル: CommandMenu.cs プロジェクト: serhatmorkoc/cepos
        /// <summary>
        /// - Command menu selection.
        /// - Some of menu items are confirmed to cahier before take action.
        /// </summary>
        /// <param name="menu">Selected menu</param>
        public static void SelectActionMenu(MenuLabel menu)
        {
            string message = menu.ToString();

            message = message.Substring(message.IndexOf('\n') + 1);

            switch (message)
            {
            case PosMessage.VOID_DOCUMENT:
                cr.State = ConfirmAuthorization.Instance(new Confirm(PosMessage.CONFIRM_VOID_DOCUMENT,
                                                                     new StateInstance(VoidDocument),
                                                                     new StateInstance(Continue)),
                                                         Authorizations.VoidDocument);
                break;

            case PosMessage.REPEAT_DOCUMENT:
                if (cr.IsAuthorisedFor(Authorizations.SuspendAndRepeatDocAuth))
                {
                    cr.State = ChooseRepeatType();
                }
                else
                {
                    throw new CashierAutorizeException();
                }
                break;

            case PosMessage.TRANSFER_DOCUMENT:
                cr.State = TransferDocument();

                //SalesDocument salesDoc = new Invoice(cr.Document);
                //String confirmationMessage = String.Format(PosMessage.CHANGE_DOCUMENT, salesDoc.Name);
                //Confirm e = new Confirm(confirmationMessage,
                //                    new StateInstance<Hashtable>(ListDocument.LDChangeConfirmed),
                //                    new StateInstance(Start.Instance));
                //e.Data["Document"] = salesDoc;
                //CashRegister.State = ConfirmCashier.Instance(e);
                return;

            case PosMessage.SUSPEND_DOCUMENT:
                cr.State = ConfirmAuthorization.Instance(new Confirm(PosMessage.CONFIRM_SUSPEND_DOCUMENT,
                                                                     new StateInstance(SuspendDocument),
                                                                     new StateInstance(Continue)), Authorizations.SuspendAndRepeatDocAuth);
                break;

            case PosMessage.RESUME_DOCUMENT:
                cr.State = ResumeDocument();
                break;

            case PosMessage.CUSTOMER_ENTRY:
                cr.State = EnterCustomer();
                break;

            case PosMessage.EFT_SLIP_COPY:
                cr.State = SlipCopySearchType();
                break;

            case PosMessage.EFT_POS_OPERATIONS:
                cr.State = EftPosMenu();
                break;

            //case PosMessage.FAST_PAYMENT:
            //    cr.State = OpenOrders();
            //    break;
            case PosMessage.TABLE_MANAGEMENT:
                cr.State = OpenTables();
                break;

            case PosMessage.ENTER_CASH:
                if (cr.IsAuthorisedFor(Authorizations.CashInCashOut))
                {
                    cr.State = EnterCurrency.Instance(PosMessage.CASH_AMOUNT,
                                                      new StateInstance <decimal>(DepositCashToRegister),
                                                      new StateInstance(Continue));
                }
                else
                {
                    throw new CashierAutorizeException();
                }
                break;

            case PosMessage.RECEIVE_CASH:
                if (cr.IsAuthorisedFor(Authorizations.CashInCashOut))
                {
                    cr.State = EnterCurrency.Instance(PosMessage.CASH_AMOUNT,
                                                      new StateInstance <decimal>(WithdrawCashFromRegister),
                                                      new StateInstance(Continue));
                }
                else
                {
                    throw new CashierAutorizeException();
                }
                break;

            //case PosMessage.RECEIVE_CHECK:
            //    cr.State = EnterCurrency.Instance(PosMessage.CASH_AMOUNT,
            //                                   new StateInstance<decimal>(WithdrawCheckFromRegister),
            //                                   new StateInstance(Continue));
            //    break;
            //case PosMessage.RECEIVE_CREDIT:
            //    cr.State = EnterCurrency.Instance(PosMessage.CASH_AMOUNT,
            //                                   new StateInstance<decimal>(WithdrawCreditSlipsFromRegister),
            //                                   new StateInstance(Continue));
            //    break;
            case PosMessage.COMMAND_CALCULATOR:
                cr.State = States.Calculator.Instance();
                break;

            case PosMessage.TALLYING:
                cr.State = States.Teller.Instance();
                break;
            }
        }