public decimal Calculate(decimal price, Enums.States state, string zip) { var taxPrice = default(decimal); // Call Real Web Service to determine the Sales Tax. switch (state) { case Enums.States.Arizona: taxPrice = CalculateTaxPriceInternal(price, 7.125, zip); break; case Enums.States.Illinois: taxPrice = CalculateTaxPriceInternal(price, 3.75, zip); break; case Enums.States.Massachusetts: taxPrice = CalculateTaxPriceInternal(price, 6.25, zip); break; case Enums.States.California: taxPrice = CalculateTaxPriceInternal(price, 2.50, zip); break; case Enums.States.Washington: taxPrice = CalculateTaxPriceInternal(price, 3.10, zip); break; case Enums.States.NewJersey: taxPrice = CalculateTaxPriceInternal(price, 7.00, zip); break; case Enums.States.Texas: taxPrice = CalculateTaxPriceInternal(price, 8.15, zip); break; default: taxPrice = 0; break; } return taxPrice; }
private void RequestChangeState(Enums.States state) { EventManager.Instance.Notice(new ChangeStateEvent() { NextState = state }); }
/// <summary> /// Change state to next state by exiting current state and entering next one /// </summary> public void ChangeState(Enums.States nextState) { if (Options.Instance.IsLoading && (nextState == Enums.States.Edition || nextState == Enums.States.OfflineGame || nextState == Enums.States.OnlineGame)) { MessageHelper.ShowMessage("Musique en chargement", "La musique est en train d'etre charger, veuillez patienter un peu"); return; } _currentState.ExitState(); _currentState = _stateDictionnary[(int)nextState]; _currentState.EnterState(); }