コード例 #1
0
        /// <summary>
        /// Updates user preferences
        /// </summary>
        /// <param name="userPreference"></param>
        private void UpdatePreferences(EUserPreferences userPreference)
        {
            switch (userPreference)
            {
            case EUserPreferences.TV:
                UserPreferences.SaveTVValue(TVvalue);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Megas3:
                UserPreferences.Save3MegasValue(Megas3Value);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Megas5:
                UserPreferences.Save5MegasValue(Megas5Value);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Megas7:
                UserPreferences.Save7MegasValue(Megas7Value);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Megas10:
                UserPreferences.Save10MegasValue(Megas10Value);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Combo3TV:
                UserPreferences.SaveCombo3TV(ComboTV3Value);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Combo3Internet:
                UserPreferences.SaveCombo3Internet(ComboInternet3Value);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Combo5TV:
                UserPreferences.SaveCombo5TV(ComboTV5Value);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Combo5Internet:
                UserPreferences.SaveCombo5Internet(ComboInternet5Value);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Combo7TV:
                UserPreferences.SaveCombo7TV(ComboTV7Value);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Combo7Internet:
                UserPreferences.SaveCombo7Internet(ComboInternet7Value);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Combo10TV:
                UserPreferences.SaveCombo10TV(ComboTV10Value);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Combo10Internet:
                UserPreferences.SaveCombo10Internet(ComboInternet10Value);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Reconexion:
                UserPreferences.SaveReconexionValue(ReconexionValue);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Afiliacion:
                UserPreferences.SaveAfiliacionValue(AfiliacionValue);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Derivacion:
                UserPreferences.SaveDerivacionValue(DerivacionValue);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Traslado:
                UserPreferences.SaveTrasladoValue(TrasladoValue);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Descuento:
                UserPreferences.SaveDescuento(DescuentoValue);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Recibos:
                UserPreferences.SaveRecibosLocation(RecibosValue);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Facturas:
                UserPreferences.SaveFacturasLocation(FacturasValue);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.Archivos:
                UserPreferences.SavePreferredLocation(UbicacionValue);
                SystemSounds.Beep.Play();
                MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                return;

            case EUserPreferences.NumeroRecibo:
                if (IsNumeroReciboValid())
                {
                    UserPreferences.SaveNumeroRecibo(NumeroReciboValue);
                    SystemSounds.Beep.Play();
                    MessageBox.Show(Messages.SuccesfulOperation.PreferenceWasUpdatedSuccesfully, Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else
                {
                    SystemSounds.Beep.Play();
                    MessageBox.Show("Valor invalido!", Messages.Titles.Success, MessageBoxButton.OK, MessageBoxImage.Warning);
                }
                return;

            default:
                Debugger.Break();
                return;
            }
        }