private void RecalculateVal2() { if (Val2DoubleUpDown == null || Val2IsFirstCapitalCheckBox == null || Val2CasesComboBox == null || Val2DoubleUpDown.Value == null) { return; } var comboBoxItem = Val2CasesComboBox.SelectedItem as ComboBoxItem; if (comboBoxItem == null) { Result2TextBox.Text = string.Empty; return; } var nullableTextCase = comboBoxItem.Content as TextCase?; if (nullableTextCase == null || Val2IsFirstCapitalCheckBox.IsChecked == null) { Result2TextBox.Text = string.Empty; return; } var value = (double)Val2DoubleUpDown.Value; var precision = GetPrecision(value); var textCase = (TextCase)nullableTextCase; var isFirstCapital = (bool)Val2IsFirstCapitalCheckBox.IsChecked; Result2TextBox.Text = RuDateMoneyConverter.NumeralsDoubleToTxt(value, precision, textCase, isFirstCapital); }
private void RecalculateVal1() { if (Val1LongUpDown == null || Val1IsMaleCheckBox == null || Val1IsFirstCapitalCheckBox == null || Val1CasesComboBox == null || Val1LongUpDown.Value == null) { return; } var comboBoxItem = Val1CasesComboBox.SelectedItem as ComboBoxItem; if (comboBoxItem == null) { Result1TextBox.Text = string.Empty; return; } var nullableTextCase = comboBoxItem.Content as TextCase?; if (nullableTextCase == null || Val1IsFirstCapitalCheckBox.IsChecked == null || Val1IsMaleCheckBox.IsChecked == null) { Result1TextBox.Text = string.Empty; return; } var value = (long)Val1LongUpDown.Value; var textCase = (TextCase)nullableTextCase; var isMale = (bool)Val1IsMaleCheckBox.IsChecked; var isFirstCapital = (bool)Val1IsFirstCapitalCheckBox.IsChecked; Result1TextBox.Text = RuDateMoneyConverter.NumeralsToTxt(value, textCase, isMale, isFirstCapital); }
private void Val7DatePicker_OnSelectedDateChanged(object senderIsDatePicker, SelectionChangedEventArgs eventArgs) { var nullableDateTime = Val7DatePicker.SelectedDate; if (nullableDateTime == null) { Result7TextBox.Text = string.Empty; return; } Result7TextBox.Text = RuDateMoneyConverter.DateToTextQuarter(nullableDateTime.Value); }
private void RecalculateVal5() { if (Val5DoubleUpDown == null || Val5IsFirstCapitalCheckBox == null || Val5DoubleUpDown.Value == null || Val5IsFirstCapitalCheckBox.IsChecked == null) { return; } var value = (double)Val5DoubleUpDown.Value; var isFirstCapital = (bool)Val5IsFirstCapitalCheckBox.IsChecked; Result5TextBox.Text = RuDateMoneyConverter.CurrencyToTxtShort(value, isFirstCapital); }