private void OnWithdrawPleaseWait()
        {
            var amount = WithdrawBut ? (Cashpool - Amount) : Amount;
            var text   = TranslationProvider.Translate(MultistringTags.U_WANT_TO_WITHDRAW_X_MONEY, amount, Currency);

            QuestionWindowService.ShowMessage(text, null, null, messageWindow_YesClick, messageWindow_NoClick);
        }
 private void OnBindCard()
 {
     try
     {
         var cards = WsdlRepository.GetIdCardInfo(EditUser.AccountId, Role.User);
         if (cards != null && cards.Any(card => card.active == "1"))
         {
             var text = TranslationProvider.Translate(MultistringTags.USER_HAVE_ACTIVE_CARD_IT_WILL_BE_BLOCKED);
             if (!StationRepository.IsIdCardEnabled)
             {
                 text = TranslationProvider.Translate(MultistringTags.USER_HAVE_ACTIVE_BARCODECARD_IT_WILL_BE_BLOCKED);
             }
             QuestionWindowService.ShowMessage(text, null, null, model_YesClick, null);
         }
         else
         {
             model_YesClick(null, null);
         }
     }
     catch (FaultException <HubServiceException> exception)
     {
         if (exception.Detail.code == 169)
         {
             model_YesClick(null, null);
         }
     }
 }
Esempio n. 3
0
        //
        private void OnNewPin()
        {
            var text          = TranslationProvider.Translate(MultistringTags.TERMINAL_NEW_PIN).ToString();
            var yesButtonText = TranslationProvider.Translate(MultistringTags.SHOP_FORM_OK) as string;
            var noButtonText  = TranslationProvider.Translate(MultistringTags.SHOP_FORM_CANCEL) as string;

            QuestionWindowService.ShowMessage(text, yesButtonText, noButtonText, OnDefinedPIN, null);
        }
Esempio n. 4
0
        public void CloseBalance()
        {
            decimal cashoutCurrentAmount = 0;

            var text = TranslationProvider.Translate(MultistringTags.TERMINAL_COLLECT_CASH, _cashinCurrentAmount, StationRepository.Currency);

            QuestionWindowService.ShowMessage(text, null, null, askWindow_YesClick, null);
        }
Esempio n. 5
0
        public void AskPrintCreditNote()
        {
            amount = ChangeTracker.CurrentUser.Cashpool;

            var text          = TranslationProvider.Translate(MultistringTags.CASHOUT_TOCREDITNOTE, string.Format("{0:f2}", amount), Currency);
            var yesButtonText = TranslationProvider.Translate(MultistringTags.SHOP_FORM_OK) as string;
            var noButtonText  = TranslationProvider.Translate(MultistringTags.SHOP_FORM_CANCEL) as string;

            QuestionWindowService.ShowMessage(text, yesButtonText, noButtonText, PrintCreditNoteYes, null);
        }
Esempio n. 6
0
        private void OnBlockCardOperator()
        {
            var text = TranslationProvider.Translate(MultistringTags.TERMINAL_BLOCK_ID_CONFIRMATION).ToString();

            if (!StationRepository.IsIdCardEnabled)
            {
                text = TranslationProvider.Translate(MultistringTags.TERMINAL_BLOCK_BARCODE_ID_CONFIRMATION).ToString();
            }
            QuestionWindowService.ShowMessage(text, null, null, questionViewModel_YesClick, null, true);
        }
 private void OnBlockCard()
 {
     if (StationRepository.IsIdCardEnabled)
     {
         QuestionWindowService.ShowMessage(TranslationProvider.Translate(MultistringTags.BLOCK_CARD_QUESTION).ToString(), null, null, BlockClick, null);
     }
     else
     {
         QuestionWindowService.ShowMessage(TranslationProvider.Translate(MultistringTags.BLOCK_BARCODECARD_QUESTION).ToString(), null, null, BlockClick, null);
     }
 }
 private void OnActivate()
 {
     if (!EditUser.IsVerified)
     {
         var text = TranslationProvider.Translate(MultistringTags.CHECK_DOCUMENTS_OF_USER).ToString();
         QuestionWindowService.ShowMessage(text, null, null, verifyUserClick, null);
     }
     else
     {
         ToggleAccountState();
     }
 }
Esempio n. 9
0
        private void OnEnablePin()
        {
            var text = ChangeTracker.CurrentUser.PinEnabled
                                         ? TranslationProvider.Translate(
                MultistringTags.TERMINAL_FORM_PIN_WILL_BE_DISABLED) as string
                                         : TranslationProvider.Translate(
                MultistringTags.TERMINAL_FORM_PIN_WILL_BE_ENABLED) as string;

            var yesButtonText = TranslationProvider.Translate(MultistringTags.SHOP_FORM_OK) as string;
            var noButtonText  = TranslationProvider.Translate(MultistringTags.SHOP_FORM_CANCEL) as string;

            QuestionWindowService.ShowMessage(text, yesButtonText, noButtonText, onEnablePinYesClicked, null);
        }
Esempio n. 10
0
        private void OnNewPin()
        {
            var text = TranslationProvider.Translate(MultistringTags.TERMINAL_NEW_PIN).ToString();

            if (!StationRepository.IsIdCardEnabled)
            {
                text = TranslationProvider.Translate(MultistringTags.TERMINAL_NEW_BARCODE_PIN).ToString();
            }
            var yesButtonText = TranslationProvider.Translate(MultistringTags.SHOP_FORM_OK) as string;
            var noButtonText  = TranslationProvider.Translate(MultistringTags.SHOP_FORM_CANCEL) as string;

            QuestionWindowService.ShowMessage(text, yesButtonText, noButtonText, OnDefinedPIN, null);
        }
Esempio n. 11
0
        private void OnLogoutQuestion()
        {
            StationRepository.DisableCashIn();
            if (ChangeTracker.CurrentUser.IsLoggedInWithIDCard && StationRepository.IsIdCardEnabled)
            {
                ShowError(TranslationProvider.Translate(MultistringTags.REMOVE_CARD));
                return;
            }

            var text = TranslationProvider.Translate(MultistringTags.TERMINAL_LOGOUT_CONFIRMATION);

            QuestionWindowService.ShowMessage(text, null, null, questionViewModel_YesClick, questionViewModel_NoClick, true, 5);
        }
        public void OnCloseBalance()
        {
            decimal cashoutCurrentAmount = 0;

            BusinessPropsHelper.GetAccountingAmount(out _cashinCurrentAmount, out cashoutCurrentAmount);

            if (_cashinCurrentAmount - cashoutCurrentAmount > 0)
            {
                string text = TranslationProvider.Translate(MultistringTags.TERMINAL_COLLECT_CASH, _cashinCurrentAmount, StationRepository.Currency);
                QuestionWindowService.ShowMessage(text, null, null, askWindow_YesClick, null);
            }
            else
            {
                ShowError(TranslationProvider.Translate(MultistringTags.TERMINAL_NO_CASH), null, false, 3);
            }
        }
        private void OnVerifyStation()
        {
            decimal cashoutCurrentAmount = 0;
            decimal cashinCurrentAmount  = 0;

            BusinessPropsHelper.GetAccountingAmount(out cashinCurrentAmount, out cashoutCurrentAmount);
            if (cashinCurrentAmount - cashoutCurrentAmount > 0)
            {
                var text          = TranslationProvider.Translate(MultistringTags.TERMINAL_EMPTY_BOX_BEFORE_VALIDATION).ToString();
                var yesButtonText = TranslationProvider.Translate(MultistringTags.SHOP_FORM_OK) as string;
                var noButtonText  = TranslationProvider.Translate(MultistringTags.SHOP_FORM_CANCEL) as string;
                QuestionWindowService.ShowMessage(text, yesButtonText, noButtonText, OnCloseBalance, null);
                return;
            }

            OnAcceptCommand();
        }
Esempio n. 14
0
        private void OnBindCard()
        {
            try
            {
                Blur();
                var cards = WsdlRepository.GetIdCardInfo((int)ChangeTracker.CurrentUser.AccountId, Role.Operator);

                UnBlur();
                if (cards != null && cards.Any(card => card.active == "1"))
                {
                    var text = TranslationProvider.Translate(MultistringTags.USER_HAVE_ACTIVE_CARD_IT_WILL_BE_BLOCKED).ToString();
                    if (!StationRepository.IsIdCardEnabled)
                    {
                        text = TranslationProvider.Translate(MultistringTags.USER_HAVE_ACTIVE_BARCODECARD_IT_WILL_BE_BLOCKED).ToString();
                    }
                    QuestionWindowService.ShowMessage(text, null, null, model_YesClick, null);
                }
                else
                {
                    Mediator.SendMessage <long>(ChangeTracker.CurrentUser.AccountId, MsgTag.BindOperatorCard);
                    OnPropertyChanged("IsCardButtonsActive");
                    OnPropertyChanged("BlockCardButtonsActive");
                }
            }
            catch (FaultException <HubServiceException> error)
            {
                UnBlur();
                if (error.Detail.code == 169)
                {
                    Mediator.SendMessage <long>(ChangeTracker.CurrentUser.AccountId, MsgTag.BindOperatorCard);
                    OnPropertyChanged("IsCardButtonsActive");
                    OnPropertyChanged("BlockCardButtonsActive");
                }
                else
                {
                    ShowError(error.Reason.Translations.Where(x => x.XmlLang.ToLowerInvariant() == SelectedLanguage.ToLowerInvariant()).Select(x => x.Text).FirstOrDefault());
                }
            }
            OnPropertyChanged("IsEnablePinButtonVisible");
            OnPropertyChanged("IsNewPinButtonVisible");

            //Mediator.SendMessage<long>(ChangeTracker.CurrentUser.AccountId, MsgTag.BindOperatorCard);
        }
        private void OnVerifyStation()
        {
            decimal billsAmount;
            decimal coinsamount;
            int     billscount;
            int     coinscount;
            var     amount = WsdlRepository.GetStationCashInfo(StationRepository.StationNumber, out billsAmount, out billscount, out coinsamount, out coinscount);

            if (amount > 0)
            {
                var text          = TranslationProvider.Translate(MultistringTags.TERMINAL_EMPTY_BOX_BEFORE_VALIDATION).ToString();
                var yesButtonText = TranslationProvider.Translate(MultistringTags.SHOP_FORM_OK) as string;
                var noButtonText  = TranslationProvider.Translate(MultistringTags.SHOP_FORM_CANCEL) as string;
                QuestionWindowService.ShowMessage(text, yesButtonText, noButtonText, OnCloseBalance, null);
                return;
            }

            OnAcceptCommand();
        }
Esempio n. 16
0
        private void onProduceSettlementCommand()
        {
            if (SelectedOperator == null)
            {
                return;
            }

            bool result = WsdlRepository.CheckForEmptyBoxAndPayments(StationRepository.LocationID, SelectedOperator.id);

            if (!result)
            {
                ProduceSettlement(null, null);
            }
            else
            {
                var text = TranslationProvider.Translate(MultistringTags.TERMINAL_CONTINUE_WITH_SETTLEMENT, SelectedOperator.firstname, SelectedOperator.surname);

                QuestionWindowService.ShowMessage(text, null, null, ProduceSettlement, NotContinue);
            }
        }
        public void OnCloseBalance()
        {
            // BusinessPropsHelper.GetAccountingAmount(out _cashinCurrentAmount, out cashoutCurrentAmount);
            decimal billsAmount;
            int     billscount;
            decimal coinsamount;
            int     coinscount;
            decimal amount;

            amount = WsdlRepository.GetStationCashInfo(StationRepository.StationNumber, out billsAmount, out billscount, out coinsamount, out coinscount);
            if (amount > 0)
            {
                string text = TranslationProvider.Translate(MultistringTags.TERMINAL_COLLECT_CASH, amount, StationRepository.Currency);
                QuestionWindowService.ShowMessage(text, null, null, askWindow_YesClick, null);
            }
            else
            {
                ShowError(TranslationProvider.Translate(MultistringTags.TERMINAL_NO_CASH), null, false, 3);
            }
        }
        private void BlockClick(object sender, EventArgs ev)
        {
            try
            {
                var cards = WsdlRepository.GetIdCardInfo(EditUser.AccountId, Role.User);

                var  result = "";
                bool isDone = true;
                if (cards != null)
                {
                    foreach (var card in cards.Where(x => x.active == "1"))
                    {
                        result = WsdlRepository.UpdateIdCard(card.number, "1", false, null);
                        if (result != null && Boolean.Parse(result))
                        {
                            isDone = Boolean.Parse(result) && isDone;
                        }
                    }
                }
                if (isDone)
                {
                    EditUser.HasCard = 0;
                    QuestionWindowService.ShowMessage(TranslationProvider.Translate(MultistringTags.TERMINAL_FORM_DONE).ToString(), null, null, null, null, false);
                }
            }
            catch (FaultException <HubServiceException> exception)
            {
                ShowError(exception.Detail.message);
            }
            catch (Exception e)
            {
                Log.Error(e.Message, e);
            }

            OnPropertyChanged("IsCardButtonsActive");
            OnPropertyChanged("BlockCardButtonsActive");
            OnPropertyChanged("IsEnabledBindCard");
            OnPropertyChanged("ActiveCardText");
            OnPropertyChanged("EditUser");
        }
Esempio n. 19
0
        private void OnPinStatusChange()
        {
            string text = null;

            if (ChangeTracker.UserPinSetting == 0)
            {
                // set to enabled
                text = TranslationProvider.Translate(MultistringTags.TERMINAL_PIN_ENABLED).ToString();
            }
            else
            {
                // set to disabled
                text = TranslationProvider.Translate(MultistringTags.TERMINAL_PIN_DISABLED).ToString();
                if (!StationRepository.IsIdCardEnabled)
                {
                    text = TranslationProvider.Translate(MultistringTags.TERMINAL_BARCODECARD_PIN_DISABLED).ToString();
                }
            }

            var yesButtonText = TranslationProvider.Translate(MultistringTags.SHOP_FORM_OK) as string;
            var noButtonText  = TranslationProvider.Translate(MultistringTags.SHOP_FORM_CANCEL) as string;

            QuestionWindowService.ShowMessage(text, yesButtonText, noButtonText, ChangePinStatus, null);
        }
 private void OnBlockCard()
 {
     QuestionWindowService.ShowMessage(TranslationProvider.Translate(MultistringTags.BLOCK_CARD_QUESTION).ToString(), null, null, BlockClick, null);
 }
Esempio n. 21
0
        private void OnLoadPaymentNote(string paymentNoteNumber)
        {
            Log.Debug("BARCODE: LoadPaymentNote(2)");
            Blur();
            PaymentNoteNumber = paymentNoteNumber;
            if (_paymentNoteChecked)
            {
                Log.Debug("Paymentnote number:" + PaymentNoteNumber);
            }
            else
            {
                Log.Debug("Credit number:" + PaymentNoteNumber);
            }
            try
            {
                if (_paymentNoteChecked)
                {
                    amount = 0;

                    if (StationRepository.IsImmediateWithdrawEnabled)
                    {
                        OnRegisterPaymentNote();
                    }
                    else
                    {
                        var userData = WsdlRepository.LoadPaymentNote(PaymentNoteNumber, StationRepository.GetUid(ChangeTracker.CurrentUser), out amount);
                        //var username = userData.fields.Where(x => x.name == "username").Select(x => x.value).FirstOrDefault();
                        var firstname      = "";
                        var lastname       = "";
                        var documentType   = "";
                        var documentNumber = "";


                        foreach (var formField in userData.fields)
                        {
                            if (formField.name == "firstname")
                            {
                                firstname = formField.value ?? "";
                            }
                            if (formField.name == "lastname")
                            {
                                lastname = formField.value ?? "";
                            }
                            if (formField.name == "document_type")
                            {
                                documentType = formField.value ?? "";
                            }
                            if (formField.name == "document_number")
                            {
                                documentNumber = formField.value ?? "";
                            }
                        }
                        var amountEuros = (int)amount;
                        int amountCents = (int)((amount - amountEuros) * 100);

                        var text = TranslationProvider.Translate(MultistringTags.PAY_PAYMENTNOTE, amount, StationRepository.Currency, firstname, lastname) + "\r\n";
                        text += TranslationProvider.Translate(MultistringTags.TERMINAL_FORM_DOCUMENT_TYPE, TranslationProvider.Translate(MultistringTag.Assign(documentType, documentType)).ToString()) + "\r\n";
                        text += TranslationProvider.Translate(MultistringTags.TERMINAL_FORM_DOCUMENT_NUMBER, documentNumber) + "\r\n";

                        var yesButtonText = TranslationProvider.Translate(MultistringTags.PAYMENT_DONE).ToString();
                        var noButtonText  = TranslationProvider.Translate(MultistringTags.SHOP_FORM_CANCEL).ToString();

                        QuestionWindowService.ShowMessage(text, yesButtonText, noButtonText, model_YesClick, model_NoClick);
                    }
                }
                else
                {
                    if (!StationRepository.AllowAnonymousBetting)
                    {
                        UnBlur();
                        ShowError(TranslationProvider.Translate(MultistringTags.ANONYMOUS_BETTING_IS_DISABLED_CREDITNOTE) as string);
                        return;
                    }
                    if (StationRepository.IsCreditNoteImmediatelyPaid)
                    {
                        OnRegisterCreditNote();
                    }
                    else
                    {
                        var creditNote =
                            WsdlRepository.LoadCreditNote(PaymentNoteNumber.Substring(0, PaymentNoteNumber.Length - 4),
                                                          PaymentNoteNumber.Substring(PaymentNoteNumber.Length - 4),
                                                          StationRepository.StationNumber);

                        amount      = creditNote.amount;
                        _expiryDate = creditNote.expireDate;
                        var    amountEuros = (int)creditNote.amount;
                        int    amountCents = (int)((creditNote.amount - amountEuros) * 100);
                        string text        = null;

                        var yesButtonText = TranslationProvider.Translate(MultistringTags.PAYMENT_DONE).ToString();
                        var noButtonText  = TranslationProvider.Translate(MultistringTags.SHOP_FORM_CANCEL).ToString();

                        if (_expiryDate < DateTime.Now && StationRepository.PayoutExpiredPaymentCreditNotes)
                        {
                            text =
                                string.Format(
                                    TranslationProvider.Translate(MultistringTags.PAY_EXPIRED_CREDITNOTE).ToString(),
                                    creditNote.amount, StationRepository.Currency);

                            QuestionWindowService.ShowMessage(text, null, null, modelCreditNote_YesClick, null,
                                                              warning: true);
                        }
                        else if (_expiryDate < DateTime.Now && !StationRepository.PayoutExpiredPaymentCreditNotes)
                        {
                            ErrorWindowService.ShowError(
                                TranslationProvider.Translate(MultistringTags.EXPIRED_CREDITNOTE).ToString());
                        }
                        else
                        {
                            text =
                                TranslationProvider.Translate(MultistringTags.PAY_CREDITNOTE,
                                                              creditNote.amount, StationRepository.Currency) + "\r\n";
                            QuestionWindowService.ShowMessage(text, yesButtonText, noButtonText,
                                                              modelCreditNote_YesClick, model_NoClick);
                        }
                    }
                }
            }
            catch (FaultException <HubServiceException> error)
            {
                switch (error.Detail.code)
                {
                case 170:
                    ErrorWindowService.ShowError(TranslationProvider.Translate(MultistringTags.PAYMENTNOTE_NOTFOUND).ToString());
                    break;

                case 171:
                    ErrorWindowService.ShowError(TranslationProvider.Translate(MultistringTags.PAYMENT_NOTE_EXPIRED).ToString());
                    break;

                case 174:
                    ErrorWindowService.ShowError(TranslationProvider.Translate(MultistringTags.PAYMENT_NOTE_PAID).ToString());
                    break;

                case 179:
                    ErrorWindowService.ShowError(TranslationProvider.Translate(MultistringTags.TERMINAL_NOTE_INVALIDLOCATION).ToString());
                    break;

                case 1791:
                    ErrorWindowService.ShowError(TranslationProvider.Translate(MultistringTags.TERMINAL_NOTE_INVALIDFRANCHISOR).ToString());
                    break;

                case 401:
                    ErrorWindowService.ShowError(TranslationProvider.Translate(MultistringTags.CREDIT_NOTE_ALREADY_EXISTS).ToString());
                    break;

                case 402:
                    ErrorWindowService.ShowError(TranslationProvider.Translate(MultistringTags.TERMINAL_FORM_CREDIT_NOTE_NOT_ACTIVE).ToString());
                    break;

                case 403:
                    ErrorWindowService.ShowError(TranslationProvider.Translate(MultistringTags.TERMINAL_FORM_CREDIT_NOTE_INVALID_AMOUNT).ToString());
                    break;

                case 404:
                    ErrorWindowService.ShowError(TranslationProvider.Translate(MultistringTags.TERMINAL_FORM_PAID_CREDITNOTE).ToString());
                    break;

                case 405:
                    ErrorWindowService.ShowError(TranslationProvider.Translate(MultistringTags.CREDIT_NOTE_EXPIRED).ToString());
                    break;

                default:
                    ErrorWindowService.ShowError(error.Detail.message);

                    break;
                }
            }
            catch (Exception e)
            {
                Log.Error(e.Message, e);
            }
            UnBlur();
        }
Esempio n. 22
0
        public void ShowErrorTest()
        {
            var ErrorWindowService    = new ErrorWindowService();
            var QuestionWindowService = new QuestionWindowService();
            var EnterPinWindowService = new EnterPinWindowService();

            AuthorizationService = new AuthorizationService();


            StationRepository   = MockRepository.GenerateStub <IStationRepository>();
            LanguageRepository  = MockRepository.GenerateStub <ILanguageRepository>();
            LineProvider        = MockRepository.GenerateStub <ILineProvider>();
            BusinessPropsHelper = MockRepository.GenerateStub <IBusinessPropsHelper>();
            DataBinding         = MockRepository.GenerateStub <IDataBinding>();


            IoCContainer.Kernel.Bind <IDataBinding>().ToConstant <IDataBinding>(DataBinding).InSingletonScope();
            IoCContainer.Kernel.Bind <IAuthorizationService>().ToConstant <IAuthorizationService>(AuthorizationService).InSingletonScope();
            IoCContainer.Kernel.Bind <IStationRepository>().ToConstant <IStationRepository>(StationRepository).InSingletonScope();
            IoCContainer.Kernel.Bind <ILanguageRepository>().ToConstant <ILanguageRepository>(LanguageRepository).InSingletonScope();
            IoCContainer.Kernel.Bind <ILineProvider>().ToConstant <ILineProvider>(LineProvider).InSingletonScope();
            IoCContainer.Kernel.Bind <IBusinessPropsHelper>().ToConstant <IBusinessPropsHelper>(BusinessPropsHelper).InSingletonScope();
            IoCContainer.Kernel.Bind <IErrorWindowService>().ToConstant <IErrorWindowService>(ErrorWindowService).InSingletonScope();
            IoCContainer.Kernel.Bind <IQuestionWindowService>().ToConstant <IQuestionWindowService>(QuestionWindowService).InSingletonScope();
            IoCContainer.Kernel.Bind <IEnterPinWindowService>().ToConstant <IEnterPinWindowService>(EnterPinWindowService).InSingletonScope();


            DataBinding.Expect(x => x.TipListInfo).Return(new TipListInfo());



            SessionWS sessionId = new SessionWS();

            sessionId.balance  = new accountBalance();
            sessionId.username = "******";
            SessionWS sessionIdNull = null;


            WsdlRepository.BackToRecord();
            WsdlRepository.Expect(x => x.OpenSession("", true, "", "", false)).Return(new SessionWS()).IgnoreArguments();
            WsdlRepository.Expect(x => x.ValidateIdCard("1234", "0024", false, out sessionId)).Return(true).OutRef(sessionIdNull);
            WsdlRepository.Expect(x => x.LoginWithIdCard("0024", "1234", "1234")).Return(sessionId);
            WsdlRepository.Replay();

            StationRepository.TurnOffCashInInit = true;
            StationRepository.Expect(x => x.AllowAnonymousBetting).Return(true);
            StationRepository.Expect(x => x.IsReady).Return(true);
            StationRepository.Expect(x => x.Active).Return(1);
            StationRepository.Expect(x => x.StationNumber).Return("0024");
            StationRepository.Expect(x => x.HubSettings).Return(new Dictionary <string, string>());
            StationRepository.Currency = "EUR";

            ChangeTracker                           = IoCContainer.Kernel.Get <IChangeTracker>();
            ChangeTracker.CurrentUser               = new AnonymousUser("1", 1);
            ChangeTracker.CurrentUser.Cashpool      = 100000;
            ChangeTracker.CurrentUser.AvailableCash = 100000;



            BaseClass.Dispatcher.Invoke(() =>
            {
                BaseClass.Window = MyRegionManager.FindWindowByViewModel <MainViewModel>();
                BaseClass.Window.Show();
            });



            Thread.Sleep(1000);

            var mainModel = MyRegionManager.CurrentViewModelInRegion(RegionNames.ContentRegion);

            Task.Run(() =>
            {
                MessageMediator.SendMessage("1234", MsgTag.CardInserted);
            });

            while (EnterPinWindowService.Model == null)
            {
                Thread.Sleep(10);
            }

            Thread.Sleep(1000);

            EnterPinWindowService.Model.Pin       = "1234";
            EnterPinWindowService.Model.PinMasked = "1234";
            EnterPinWindowService.Model.ProceedCommand.Execute("");

            Task.Run(() =>
                     { mainModel.ShowMessage("msg1"); });
            Thread.Sleep(1000);

            QuestionWindowService.Model.YesCommand.Execute("");

            Task.Run(() =>
                     { mainModel.ShowError("error1"); });
            Thread.Sleep(1000);


            ErrorWindowService.Model.OKCommand.Execute("");


            Task.Run(() =>
                     { mainModel.ShowMessage("msg2"); });
            Thread.Sleep(1000);
            QuestionWindowService.Model.YesCommand.Execute("");

            Task.Run(() =>
                     { mainModel.ShowError("error2"); });
            Thread.Sleep(1000);
            ErrorWindowService.Model.OKCommand.Execute("");


            Task.Run(() =>
                     { QuestionWindowService.ShowMessage("mgs3", null, null, null, null, false, 1); });
            Thread.Sleep(3000);

            BaseClass.Dispatcher.Invoke(() =>
            {
                BaseClass.Window.Close();
            });
        }
 private void OnShutdown()
 {
     QuestionWindowService.ShowMessage(TranslationProvider.Translate(MultistringTags.TERMINAL_SHUTDOWN_QUESTION), null, null, ShutdownYes, null);
 }
Esempio n. 24
0
 private void OnHardRestartCommand()
 {
     QuestionWindowService.ShowMessage(TranslationProvider.Translate(MultistringTags.TERMINAL_HARD_RESTART_QUESTION), null, null, HardRestartYes, null);
 }
Esempio n. 25
0
 private void OnResetDB()
 {
     QuestionWindowService.ShowMessage(TranslationProvider.Translate(MultistringTags.TERMINAL_RESET_DB_QUESTION), null, null, ResetDBYes, null);
 }
Esempio n. 26
0
        private void DoLogin()
        {
            Validate(true);
            try
            {
                int sucess = PleaseWaitLogin();

                if (sucess == 1)
                {
                    HideWindow();
                    if (ChangeTracker.CurrentUser is OperatorUser)
                    {
                        WaitOverlayProvider.ShowWaitOverlay();

                        ChangeTracker.SelectedLive          = false;
                        ChangeTracker.SelectedResults       = false;
                        ChangeTracker.SelectedTicket        = false;
                        ChangeTracker.SelectedSports        = false;
                        ChangeTracker.SelectedVirtualSports = false;
                        MyRegionManager.NavigateUsingViewModel <UserManagementViewModel>(RegionNames.ContentRegion);
                    }
                    else if (ChangeTracker.CurrentUser is LoggedInUser)
                    {
                        WaitOverlayProvider.DisposeAll();

                        //check terms and conditions
                        profileForm form = WsdlRepository.LoadProfile(StationRepository.GetUid(ChangeTracker.CurrentUser));
                        if (form != null)
                        {
                            foreach (formField accountingField in form.fields)
                            {
                                if (accountingField.name == "terms_and_cond_version")
                                {
                                    string value = "";
                                    if (accountingField.value == null)
                                    {
                                        value = "1.0";
                                    }
                                    else
                                    {
                                        value = accountingField.value;
                                    }

                                    if (value != ChangeTracker.TermsAndConditionsVersion)
                                    {
                                        ChangeTracker.NewTermsAccepted = false;
                                        Mediator.SendMessage <bool>(false, MsgTag.AcceptNewTermsVersion);
                                    }
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        WaitOverlayProvider.DisposeAll();
                    }
                }
                else if (sucess == 0)
                {
                    ShowError(TranslationProvider.Translate(MultistringTags.SERVER_ERROR) as string);
                }
                else if (sucess == 2) //passwordreminder
                {
                    QuestionWindowService.ShowMessage(TranslationProvider.Translate(MultistringTags.TERMINAL_PASSWORD_NOT_CHANGED).ToString(), null, null, DoChangePassword, CancelPasswordChange);
                }
                else if (sucess == 3) // forced reminder
                {
                    QuestionWindowService.ShowMessage(TranslationProvider.Translate(MultistringTags.TERMINAL_PASSWORD_NOT_CHANGED).ToString(), null, null, DoChangePasswordForced, CancelForcedPassChange);
                }
            }
            catch (FaultException <HubServiceException> exception)
            {
                WaitOverlayProvider.DisposeAll();
                switch (exception.Detail.code)
                {
                case 111:
                    OnPropertyChanged("PasswordMasked");
                    DoRaisePropertyChanged(new Tuple <string, string>("UserName", TranslationProvider.Translate(MultistringTags.SHOP_FORM_CHECK_USERNAME).ToString()));
                    UsernameLoginError = false;
                    break;

                case 112:
                    DoRaisePropertyChanged(new Tuple <string, string>("PasswordMasked", TranslationProvider.Translate(MultistringTags.INVALID_PASSWORD).ToString()));
                    PasswordLoginError = false;
                    break;

                case 113:
                    ShowError(TranslationProvider.Translate(MultistringTags.LOGIN_FRANCHISOR_INCORRECT).ToString());
                    PasswordLoginError = false;
                    break;

                case 114:
                    DoRaisePropertyChanged(new Tuple <string, string>("UserName", TranslationProvider.Translate(MultistringTags.USER_IS_NOT_VERIFIED).ToString()));
                    PasswordLoginError = false;
                    break;

                case 115:
                    ShowError(TranslationProvider.Translate(MultistringTags.CANNOT_LOGIN_TO_THIS_STATION).ToString());
                    PasswordLoginError = false;
                    break;

                case 116:
                    ShowError(TranslationProvider.Translate(MultistringTags.LOGIN_RESTRICTED).ToString());
                    PasswordLoginError = false;
                    break;

                case 117:
                    ShowError(TranslationProvider.Translate(MultistringTags.USER_INACTIVE).ToString());
                    PasswordLoginError = false;
                    break;

                case 118:
                    ShowError(TranslationProvider.Translate(MultistringTags.INVALIDLOCATION).ToString());
                    PasswordLoginError = false;
                    break;

                case 172:
                    PasswordLoginError = false;

                    string sTime     = "";
                    string sUsername = "";
                    if (exception.Detail.parameters != null)
                    {
                        //if (exception.Detail.parameters[2].name == "blockedUntil")
                        //{
                        //    sTime = exception.Detail.parameters[2].value;
                        //    long milliSeconds = Int64.Parse(sTime);
                        //    DateTime UTCBaseTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
                        //    DateTime dt = UTCBaseTime.Add(new TimeSpan(milliSeconds * TimeSpan.TicksPerMillisecond)).ToLocalTime();
                        //    dt = LocalDateTime.Get(dt);
                        //    sTime = dt.ToString("dd.MM.yyyy HH:mm");
                        //    sUsername = exception.Detail.parameters[1].value;
                        //}
                        //else
                        //{
                        //    sTime = exception.Detail.parameters[1].value;
                        //    sUsername = exception.Detail.parameters[1].value;
                        //}

                        for (int i = 0; i < exception.Detail.parameters.Length; i++)
                        {
                            if (exception.Detail.parameters[i].name == "blockedUntil")
                            {
                                sTime = exception.Detail.parameters[i].value;
                                long     milliSeconds = Int64.Parse(sTime);
                                DateTime UTCBaseTime  = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
                                DateTime dt           = UTCBaseTime.Add(new TimeSpan(milliSeconds * TimeSpan.TicksPerMillisecond)).ToLocalTime();
                                sTime = dt.ToString("dd.MM.yyyy HH:mm");
                            }

                            if (exception.Detail.parameters[i].name == "username")
                            {
                                sUsername = exception.Detail.parameters[i].value;
                            }
                        }
                    }
                    ShowError(TranslationProvider.Translate(MultistringTags.TERMINAL_USERNAME_BLOCKED, sUsername, sTime));

                    break;

                case 124:
                    ShowError(TranslationProvider.Translate(MultistringTags.TERMINAL_ADMIN_LOGIN_PROHIBITED).ToString());
                    PasswordLoginError = false;
                    break;

                default:     // 113, 114
                    ShowError(exception.Detail.message);
                    break;
                }
            }
        }
Esempio n. 27
0
        private void OnBlockCardOperator()
        {
            var text = TranslationProvider.Translate(MultistringTags.TERMINAL_BLOCK_ID_CONFIRMATION).ToString();

            QuestionWindowService.ShowMessage(text, null, null, questionViewModel_YesClick, null, true);
        }