示例#1
0
 private void GetFuelVolume(string currencyValue, bool isCashButtonPressed)
 {
     if (_isEditingAmount)
     {
         PerformAction(async() =>
         {
             var selectedPumpId = Pumps.ElementAt(SelectedPumpIndex).Id;
             if (!isCashButtonPressed)
             {
                 VolumeString = await _fuelPumpBusinessLogic.GetFuelVolume(_gradeId, selectedPumpId, currencyValue);
             }
             Amount = currencyValue;
             if (!isCashButtonPressed)
             {
                 ResetNumberPadValues();
             }
         });
     }
     else
     {
         Volume = currencyValue;
         ResetNumberPadValues();
         AddPropane();
     }
 }
示例#2
0
 private void AddPropane()
 {
     PerformAction(async() =>
     {
         try
         {
             var amount         = string.IsNullOrEmpty(Amount) ? Volume : Amount;
             var selectedPumpId = Pumps.ElementAt(SelectedPumpIndex).Id;
             var response       = await _fuelPumpBusinessLogic.AddPropane(_gradeId, selectedPumpId, amount,
                                                                          !string.IsNullOrEmpty(Amount));
             MessengerInstance.Send(response.ToModel(), "UpdateSale");
             NavigateService.Instance.NavigateToHome();
         }
         catch (Exception)
         {
             _volume      = _amount = string.Empty;
             VolumeString = null;
             RaisePropertyChanged(nameof(Volume));
             RaisePropertyChanged(nameof(Amount));
             throw;
         }
     });
 }