private async Task SetPrepay() { var isAmountCash = false; var grade = GradeTypes.ElementAt(SelectedGradeIndex); if (!CacheBusinessLogic.SupportCashCreditpricing) { isAmountCash = true; } else { isAmountCash = CashTypes.ElementAt(SelectedCashIndex).Equals("Cash"); } var response = await _fuelBusinessLogic.AddPrepay(_pumpId, Amount, grade, isAmountCash); MessengerInstance.Send(response.ToModel(), "UpdateSale"); PerformHomeNavigation(); }
/// <summary> /// 通过构造方法传入收费类型,获取不同的收费策略 /// </summary> /// <param name="super"></param> public CashContext(CashTypes cashType) { switch (cashType) { case CashTypes.Nommarl: _cashSuper = new CashNomarl(); break; case CashTypes.Discount: _cashSuper = new CashDiscount(0.8); break; case CashTypes.Return: _cashSuper = new CashReturn(300, 10); break; default: break; } }