Example #1
0
        private void txt_MoneyOrTime_TextChanged(object sender, TextChangedEventArgs e)
        {
            delayAction.Debounce(500, SynchronizationContext, async() =>
            {
                if (!chargerViewModel.LocalMoneyOrTime.HasValue)
                {
                    return;
                }
                if (chargerViewModel.LocalMoneyOrTime.HasValue && chargerViewModel.LocalMoneyOrTime == 0)
                {
                    return;
                }
                //计算金额
                if (Tsh_Time.IsChecked.HasValue && Tsh_Time.IsChecked.Value)
                {
                    var money = FareRule?.CalculateFees(DateTime.Now, DateTime.Now.AddMinutes((double)chargerViewModel.LocalMoneyOrTime.Value), 0, true) ?? 0;

                    chargerViewModel.Pay -= money;
                }
                else if (Tsh_Money.IsChecked.HasValue && Tsh_Money.IsChecked.Value)
                {
                    chargerViewModel.Pay -= chargerViewModel.LocalMoneyOrTime.Value;
                }

                //更新显示屏
                await _ledManager.SpeakAndShowText(Deviceable, CarOutModel, OutEnum.CalculationFee);

                //调用平台接口
            });
        }
Example #2
0
 private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     delayAction.Debounce(500, DispatcherSynchronizationContext.Current, async() =>
     {
         var result = await _parkAppService.GetParkListByName(new PagedResultRequestDto()
         {
             MaxResultCount = 7, SkipCount = 0
         }, Txt_ParkName.Text);
         ShowPanel.Children.Clear();
         _mainWindowViewModel.SelectParkDto = null;
         AddShowPanel(result);
     });
 }