Exemplo n.º 1
0
 public override void Escape()
 {
     lastPassword = "";
     cr.State     = EnterPassword.Instance(PosMessage.SERVICE_PASSWORD,
                                           new StateInstance <String>(ExitService),
                                           new StateInstance(PrinterBlockingError.Instance));
 }
Exemplo n.º 2
0
        public static new IState Instance()
        {
            lastPassword = "";

            String orderNum = cr.Printer.GetOrderNum();
            String tmp      = String.Format("(ÝK:{0})", orderNum);

            return(EnterPassword.Instance(PosMessage.SERVICE_PASSWORD + tmp,
                                          new StateInstance <String>(CheckPassword),
                                          new StateInstance(PrinterBlockingError.Instance)));
        }
Exemplo n.º 3
0
        private static void SelectSystemMenuAction(Object menu)
        {
            string message = ((MenuLabel)menu).ToString();

            message = message.Substring(message.IndexOf('\n') + 1);
            switch (message)
            {
            case PosMessage.SHUTDOWN_SYSTEM:
                Chassis.ShutDown(false);
                break;

            case PosMessage.RESTART_SYSTEM:
                Chassis.ShutDown(true);
                break;

            case PosMessage.RESTART_POS:
                Quit();
                break;

            case PosMessage.SHUTDOWN_POS:
                cr.State = EnterPassword.Instance(PosMessage.AUTHORIZED_PASSWORD, new StateInstance <string>(ShutdownPOS), Instance);
                break;

            case PosMessage.UPDATE_ONLINE:
                cr.State = States.EnterPassword.Instance(PosMessage.AUTHORIZED_PASSWORD,
                                                         new StateInstance <string>(CheckCashierPwdForUpdate),
                                                         new StateInstance(Instance));
                break;

            case PosMessage.UPDATE_FOLDER:
                cr.State = States.EnterPassword.Instance(PosMessage.AUTHORIZED_PASSWORD,
                                                         new StateInstance <string>(CheckCashierPwdForUpdate),
                                                         new StateInstance(Instance));
                break;

            case PosMessage.SOUND_SETTINGS:
                cr.State = ShowVolumeRate();
                break;
            }
        }
Exemplo n.º 4
0
        public override void Enter()
        {
            String msg = ((MenuLabel)ie.Current).ToString();

            if (msg.IndexOf("\n") > -1)
            {
                msg = msg.Substring(msg.IndexOf("\n") + 1);
            }

            switch (msg)
            {
            case PosMessage.MENU_DAILY_MEMORY_FORMAT:
                cr.State = ConfirmCashier.Instance(new Confirm(PosMessage.PROMPT_DAILY_MEMORY_FORMAT,
                                                               new StateInstance(FormatMemory),
                                                               new StateInstance(Continue)));
                break;

            case PosMessage.MENU_DATE_AND_TIME:
                cr.State = EnterString.Instance("FORMAT: yyyyMMddHHmm",
                                                DateTime.Now.ToString("yyyyMMddHHmm"),
                                                new StateInstance <String>(SetDateAndTime),
                                                new StateInstance(Continue));
                break;

            case PosMessage.MENU_FACTORY_SETTING:
                cr.State = ConfirmCashier.Instance(new Confirm(PosMessage.LOAD_FACTOR_SETTINGS,
                                                               new StateInstance(LoadFactorySettings),
                                                               new StateInstance(Continue)));
                break;

            case PosMessage.MENU_CLOSE_FM:
                cr.State = ConfirmCashier.Instance(new Confirm(PosMessage.CLOSE_FISCAL_MEMORY,
                                                               new StateInstance(CloseFiscalMemory),
                                                               new StateInstance(Continue)));
                break;

            case PosMessage.MENU_START_FM_TEST:
                cr.State = ConfirmCashier.Instance(new Confirm(PosMessage.START_FM_TEST,
                                                               new StateInstance(StartFMTest),
                                                               new StateInstance(Continue)));
                break;

            case PosMessage.MENU_EXTERNAL_DEV_SETTINGS:
                defPort  = 4444;
                cr.State = EnterIP.Instance(PosMessage.TCP_IP_ADDRESS,
                                            GetIPAddress(),
                                            new StateInstance <String>(SetIPAddress),
                                            new StateInstance(Continue));
                break;

            case PosMessage.MENU_LOGO:
                cr.State = ShowLogoMenu();
                break;

            case PosMessage.MENU_VAT_RATES:
                cr.State = ShowTaxRatesMenu();
                break;

            case PosMessage.MENU_PRINT_LOGS:
                cr.State = EnterString.Instance("FORMAT: ddMMyyyy",
                                                DateTime.Now.ToString("ddMMyyyy"),
                                                new StateInstance <String>(PrintLogs),
                                                new StateInstance(Continue));
                break;

            case PosMessage.MENU_CREATE_DB:
                cr.State = ConfirmCashier.Instance(new Confirm(PosMessage.CREATE_DB,
                                                               new StateInstance(CreateDB),
                                                               new StateInstance(Continue)));
                break;

            case PosMessage.MENU_UPDATE_FIRMWARE:
                cr.State = EnterIP.Instance(PosMessage.TCP_IP_ADDRESS,
                                            GetIPAddress(),
                                            new StateInstance <String>(SetIPAddress),
                                            new StateInstance(Continue));
                break;

            case PosMessage.MENU_EXIT_SERVICE:
                lastPassword = "";
                cr.State     = EnterPassword.Instance(PosMessage.SERVICE_PASSWORD,
                                                      new StateInstance <String>(ExitService),
                                                      new StateInstance(PrinterBlockingError.Instance));
                break;
            }
        }