示例#1
0
        private void ChangePinStatus(object sender, EventArgs e)
        {
            valueForm valueForm = new valueForm();
            var       fields    = new List <valueField>();

            valueField field = new valueField();

            field.name  = "card_pin_enabled";
            field.value = IoCContainer.Kernel.Get <IChangeTracker>().UserPinSetting == 0 ? "1" : "0";
            fields.Add(field);
            valueForm.fields = fields.ToArray();

            string result = WsdlRepository.UpdateProfile((int)ChangeTracker.CurrentUser.AccountId, StationRepository.GetUid(ChangeTracker.CurrentUser), valueForm);

            if (result == "true")
            {
                // change button captions / visibility
                IoCContainer.Kernel.Get <IChangeTracker>().UserPinSetting =
                    IoCContainer.Kernel.Get <IChangeTracker>().UserPinSetting == 0 ? 1 : 0;
            }

            OnPropertyChanged("IsPinButtonEnabled");
            OnPropertyChanged("IsPinButtonVisible");
            OnPropertyChanged("PinButtonCaption");
        }
示例#2
0
        public valueForm Values()
        {
            valueForm valueForm = new valueForm();
            var       fields    = new List <valueField>();

            foreach (var entry in ChangeUserProfileFields)
            {
                if (entry.Type == FieldType.Date)
                {
                    valueField field = new valueField();
                    field.name = entry.Name;
                    DateTime selDate;
                    DateTime.TryParse(entry.Value, new DateTimeFormatInfo {
                        DateSeparator = ".", ShortDatePattern = "ddMMyyyy"
                    }, DateTimeStyles.AllowWhiteSpaces, out selDate);
                    field.value = selDate.ToString("dd.MM.yyyy");
                    if (string.IsNullOrEmpty(field.value))
                    {
                        field.value = "";
                    }
                    fields.Add(field);
                }
                else if (entry.Name != "password2" && entry.Name != "card_pin_enabled")
                {
                    valueField field = new valueField();
                    field.name  = entry.Name;
                    field.value = entry.Value;
                    if (string.IsNullOrEmpty(field.value))
                    {
                        field.value = "";
                    }
                    fields.Add(field);
                }
                if (entry.Name == "card_pin_enabled")
                {
                    valueField field = new valueField();
                    field.name = entry.Name;
                    if (entry.Value == TranslationProvider.Translate(MultistringTags.TERMINAL_PIN_ENABLE).ToString())
                    {
                        field.value = "1";
                    }
                    else
                    {
                        field.value = "0";
                    }
                    fields.Add(field);
                }
            }
            valueForm.fields = fields.ToArray();
            return(valueForm);
        }
示例#3
0
        public valueForm Values()
        {
            valueForm         valueForm = new valueForm();
            List <valueField> temp      = new List <valueField>();

            //valueForm.fields = new valueFields();
            foreach (global::ViewModels.Registration entry in ChangeUserProfileFields)
            {
                if (entry.Type == FieldType.Date)
                {
                    valueField field = new valueField();
                    field.name = entry.Name;
                    DateTime selDate;
                    DateTime.TryParse(entry.Value, new DateTimeFormatInfo {
                        DateSeparator = ".", ShortDatePattern = "ddMMyyyy"
                    }, DateTimeStyles.AllowWhiteSpaces, out selDate);
                    field.value = selDate.ToString("dd.MM.yyyy");
                    if (string.IsNullOrEmpty(field.value))
                    {
                        field.value = "";
                    }
                    temp.Add(field);
                }
                else if (entry.Name != "password2")
                {
                    valueField field = new valueField();
                    field.name = entry.Name;
                    if (entry.Name == "card_pin_enabled" && entry.Value == "")
                    {
                        field.value = "1";
                    }
                    else
                    {
                        field.value = entry.Value;
                    }
                    if (string.IsNullOrEmpty(field.value))
                    {
                        field.value = "";
                    }
                    temp.Add(field);
                }
            }

            valueForm.fields = temp.ToArray();
            return(valueForm);
        }
        public StationWS GetStationProperties(string stationNumber, string sIpAddress, string teamViewerId, string serverVersion,
                                              PeripheralInfo pi, out valueForm hubResponse,
                                              out BsmHubConfigurationResponse hubConfigurationResponse, DriverInfo[] drivers)
        {
            StationWS testProperties = new StationWS();

            testProperties.isAnonymousBettingEnabled = true;
            testProperties.isStatisticsEnabled       = true;
            testProperties.allowMultiBet             = false;
            testProperties.allowOffLine = false;
            testProperties.barcodeScannerAlwayActive = false;
            testProperties.stationAutorestartTime    = "NONE";
            testProperties.doRestart                       = 0;
            testProperties.active                          = 3;
            testProperties.propertyPrematch                = 1;
            testProperties.propertyLiveMatch               = 0;
            testProperties.printingDefaultLanguage         = 7;
            testProperties.printingLanguageSetting         = 1;
            testProperties.propertyIdCard                  = 1;
            testProperties.propertyAutoLogout              = 0;
            testProperties.stationName                     = "Test Terminal";
            testProperties.locationName                    = "Test Location";
            testProperties.franchisorName                  = "Test Franchisor";
            testProperties.userCardPinSetting              = 3;
            testProperties.operatorCardPinSetting          = 1;
            testProperties.authorizedTicketScanning        = true;
            testProperties.creditNoteExpireDays            = 60;
            testProperties.payoutExpiredPaymentCreditNotes = false;
            testProperties.stationStoreTicketEnabled       = false;
            testProperties.allowMixedStakes                = true;
            testProperties.multiBetBonusFromOdd            = 2;
            testProperties.maxStakeSingleBet               = 500;
            testProperties.logRotationFileSize             = 20;
            testProperties.logRotationNumber               = 50;
            testProperties.maxOdd                          = 1000;
            testProperties.minStakeCombiBet                = 1;
            testProperties.maxStakeCombi                   = 500;
            testProperties.maxWinSingleBet                 = 2000;
            testProperties.minStakeSingleBet               = 1;
            testProperties.maxStakeSystemBet               = 1000;
            testProperties.minStakeSystemBet               = 1;
            testProperties.maxWinSystemBet                 = 10000;
            testProperties.displayTaxField                 = false;
            testProperties.maxSystemBet                    = 4;
            testProperties.stationAllowFutureMatches       = true;
            testProperties.enableOddsChangeIndication      = true;
            testProperties.sngLiveBetTicketAcceptTime      = 30;
            testProperties.combiLiveBetTicketAcceptTime    = 0;
            testProperties.minCombination                  = 2;
            testProperties.maxCombination                  = 20;
            testProperties.printLogo                       = true;
            testProperties.syncInterval                    = 1000;
            testProperties.cashAcceptorAlwayActive         = true;
            testProperties.franchisorID                    = 777;
            testProperties.locationID                      = 888;
            testProperties.vflVideoSourceType              = 0;
            testProperties.bonusRanges                     = new BonusRangeWS[0];
            testProperties.combiLimits                     = new CombiLimitWS[0];

            hubResponse        = new valueForm();
            hubResponse.fields = new valueField[0];

            hubConfigurationResponse = new BsmHubConfigurationResponse();

            return(testProperties);
        }
 public int RegisterAccount(valueForm valueForm, string stationNumber, bool isVerified, out string registration_note_number)
 {
     throw new NotImplementedException();
 }
 public string UpdateProfile(uid uidFromUser, valueForm valueForm)
 {
     throw new NotImplementedException();
 }
示例#7
0
        private void PleaseWaitOnSave()
        {
            string result = "";

            try
            {
                valueForm form = Values();
                result = WsdlRepository.UpdateProfile((int)ChangeTracker.CurrentUser.AccountId, StationRepository.GetUid(new LoggedInUser(EditUserId.AccountId, null, 0, 0, 0, 0)), form);
            }
            catch (FaultException <HubServiceException> ex)
            {
                switch (ex.Detail.code)
                {
                case 101:
                    foreach (global::ViewModels.Registration registrationField in ChangeUserProfileFields)
                    {
                        if (registrationField.Name == "username")
                        {
                            registrationField.ErrorText = TranslationProvider.Translate(MultistringTags.USERNAME_ALREADY_REGISTERED).ToString();
                            break;
                        }
                    }
                    break;

                case 102:
                    foreach (global::ViewModels.Registration registrationField in ChangeUserProfileFields)
                    {
                        if (registrationField.Name == "email")
                        {
                            registrationField.ErrorText = TranslationProvider.Translate(MultistringTags.MAIL_ALREADY_REGISTERED).ToString();
                            break;
                        }
                    }
                    break;

                case 103:
                    if (ex.Message.Contains("date_of_birth"))
                    {
                        foreach (global::ViewModels.Registration registrationField in ChangeUserProfileFields.Where(registrationField => registrationField.Name == "date_of_birth"))
                        {
                            registrationField.ErrorText = TranslationProvider.Translate(MultistringTags.TERMINAL_FORM_INVALIDVALUE).ToString();
                            break;
                        }
                    }
                    if (ex.Message.Contains("firstname"))
                    {
                        foreach (global::ViewModels.Registration registrationField in ChangeUserProfileFields.Where(registrationField => registrationField.Name == "firstname"))
                        {
                            registrationField.ErrorText = TranslationProvider.Translate(MultistringTags.TERMINAL_FORM_INVALIDVALUE).ToString();
                            break;
                        }
                    }
                    if (ex.Message.Contains("lastname"))
                    {
                        foreach (global::ViewModels.Registration registrationField in ChangeUserProfileFields.Where(registrationField => registrationField.Name == "lastname"))
                        {
                            registrationField.ErrorText = TranslationProvider.Translate(MultistringTags.TERMINAL_FORM_INVALIDVALUE).ToString();
                            break;
                        }
                    }
                    if (ex.Message.Contains("password"))
                    {
                        foreach (global::ViewModels.Registration registrationField in ChangeUserProfileFields.Where(registrationField => registrationField.Name == "password"))
                        {
                            registrationField.ErrorText = TranslationProvider.Translate(MultistringTags.TERMINAL_FORM_INVALIDVALUE).ToString();
                            break;
                        }
                    }
                    if (ex.Message.Contains("email"))
                    {
                        foreach (global::ViewModels.Registration registrationField in ChangeUserProfileFields.Where(registrationField => registrationField.Name == "email"))
                        {
                            registrationField.ErrorText = TranslationProvider.Translate(MultistringTags.TERMINAL_FORM_EMAIL_WRONGFORMAT).ToString();
                            break;
                        }
                    }
                    if (ex.Message.Contains("address"))
                    {
                        foreach (global::ViewModels.Registration registrationField in ChangeUserProfileFields.Where(registrationField => registrationField.Name == "address"))
                        {
                            registrationField.ErrorText = TranslationProvider.Translate(MultistringTags.TERMINAL_INVALID_ADRESS).ToString();
                            break;
                        }
                    }
                    if (ex.Message.Contains("document_number"))
                    {
                        foreach (global::ViewModels.Registration registrationField in ChangeUserProfileFields.Where(registrationField => registrationField.Name == "document_number"))
                        {
                            registrationField.ErrorText = TranslationProvider.Translate(MultistringTags.TERMINAL_INVALID_DOCUMENT_NUMBER).ToString();
                            break;
                        }
                    }
                    if (ex.Message.Contains("phone"))
                    {
                        foreach (global::ViewModels.Registration registrationField in ChangeUserProfileFields.Where(registrationField => registrationField.Name == "phone"))
                        {
                            registrationField.ErrorText = TranslationProvider.Translate(MultistringTags.TERMINAL_INVALID_PHONE_NUMBER).ToString();
                            break;
                        }
                    }
                    break;

                case 104:
                    foreach (global::ViewModels.Registration registrationField in ChangeUserProfileFields)
                    {
                        if (registrationField.Name == "username")
                        {
                            registrationField.ErrorText = ex.Reason.Translations.Where(x => x.XmlLang.ToLowerInvariant() == SelectedLanguage.ToLowerInvariant()).Select(x => x.Text).FirstOrDefault();
                            break;
                        }
                    }
                    break;

                default:
                    ShowError(ex.Detail.message);
                    break;
                }
            }
            if (result == "true")
            {
                IsEnabledForEditing = false;
                Mediator.SendMessage(MsgTag.HideKeyboard, MsgTag.HideKeyboard);

                List <global::ViewModels.Registration> temp = new List <global::ViewModels.Registration>(ChangeUserProfileFields);
                foreach (var field in temp)
                {
                    field.IsEnabled       = false;
                    field.IsFocused       = false;
                    field.EmptyValidation = field.IsEnabled;
                }

                ChangeUserProfileFields = new List <global::ViewModels.Registration>(temp);
            }
        }
示例#8
0
        private static void PreMatchSync(ThreadContext tc)
        {
            try
            {
                var arrUpdateRecords = WsdlRepository.GetLatestConfidenceFactorsUpdate(StationNumber);

                ProviderHelper.UpdateDatabase(DateTime.Now, DalStationSettings.Instance.UseDatabaseForOthers, DataArrayToList(arrUpdateRecords));
            }
            catch (Exception e)
            {
            }

            while (!tc.IsToStop)
            {
                int?iTotal = 0;

                try
                {
                    if (true)
                    {
                        /*
                         * using (StreamReader streamReader = new StreamReader(@"C:\Library\Data.xml", Encoding.UTF8))
                         * {
                         *  string sXml = streamReader.ReadToEnd();
                         *
                         *  SportRadarLineContainer srlc = SportRadarLineContainer.FromXmlString(sXml);
                         *
                         *  LineSr.SyncRoutines(eUpdateType.PreMatches, "Test", "None", null, delegate(object obj)
                         *  {
                         *      ProviderHelper.MergeFromSportRadarLineContainer(srlc);
                         *  });
                         * }
                         */

                        while (!StationRepository.IsReady)
                        {
                            Thread.Sleep(1000);
                        }

                        valueForm vf = null;
                        BsmHubConfigurationResponse bhcr = null;

                        string sStationNumber = StationNumber;

                        var            stringsUpdateId = UpdateFileEntrySr.GetLastUpdate(eDataSyncCacheType.String);
                        var            id = stringsUpdateId == null ? 0 : stringsUpdateId.DataSyncCacheID;
                        UpdateRecord[] arrUpdateRecords = WsdlRepository.UpdateLocalization(sStationNumber, id);
                        ProviderHelper.UpdateDatabase(DateTime.Now, DalStationSettings.Instance.UseDatabaseForOthers, DataArrayToList(arrUpdateRecords));
                        if (arrUpdateRecords != null && arrUpdateRecords.Length > 0)
                        {
                            DataCopy.UpdateLanguages();
                        }
                        // Lock Offer
                        long[] arrLockedTournamentIds = null;
                        long[] arrLockedOddIds        = WsdlRepository.GetLockedOffer(sStationNumber, out arrLockedTournamentIds);

                        // Sync Locked Odds
                        LineSr.Instance.LockedObjects.SyncLockedOdds(arrLockedOddIds);
                        int counter = 0;
                        do
                        {
                            var lastUpdateId = UpdateFileEntrySr.GetLastUpdate(eDataSyncCacheType.Match);
                            id = lastUpdateId == null ? 0 : lastUpdateId.DataSyncCacheID;
                            arrUpdateRecords = WsdlRepository.UpdateLine(sStationNumber, id, DateTime.MinValue, out iTotal);

                            if (iTotal > 0 && arrUpdateRecords != null)
                            {
                                iTotal = iTotal + arrUpdateRecords.Length;
                            }
                            DataCopy.UpdateProgressBar(iTotal);

                            ProviderHelper.UpdateDatabase(DateTime.Now, DalStationSettings.Instance.UseDatabaseForPreMatches, DataArrayToList(arrUpdateRecords));
                            LineSr.ProcessDataSqlUpdateSucceeded(eUpdateType.PreMatches, "SportRadar Pre-Match Update.");
                        } while (iTotal > 0 && counter++ < 100);

                        /*
                         * // Sync Locked Groups
                         * SyncList<long> lLockedGroupIds = new SyncList<long>();
                         *
                         * // Tournament IDs to Group IDs
                         * foreach (long lTournamentId in arrLockedTournamentIds)
                         * {
                         *  GroupLn group = LineSr.Instance.AllObjects.Groups.SafelyGetGroupByKeyName(GroupLn.GROUP_TYPE_GROUP_T, lTournamentId);
                         *
                         *  if (group != null)
                         *  {
                         *      lLockedGroupIds.SafelyAdd(group.GroupId);
                         *  }
                         * }
                         *
                         * LineSr.Instance.LockedObjects.SyncLockedGroups(lLockedGroupIds);
                         */
                    }
                }
                catch (Exception excp)
                {
                }
                var syncinterval = Convert.ToInt32(ConfigurationManager.AppSettings["STATIONPROPERTY_SYNC_INTERVAL"]);
                if (StationRepository.SyncInterval > 0)
                {
                    syncinterval = StationRepository.SyncInterval;
                }
                if (iTotal > 0)
                {
                    syncinterval = 0;
                }
                Thread.Sleep(syncinterval * 1000);
            }
        }