NoMoneyWindow.xaml.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Shapes;
  14. namespace FillingColumn
  15. {
  16. /// <summary>
  17. /// Логика взаимодействия для NoMoneyWindow.xaml
  18. /// </summary>
  19. public partial class NoMoneyWindow : Window
  20. {
  21. public NoMoneyWindow(decimal MissingAmount, bool CreditCardIsEnable, int AvailableAmountFuel)
  22. {
  23. InitializeComponent();
  24. Helper.TypeOfNoMoney = 0;
  25. TxtRefulingOnAll.Text = $"Заправить {AvailableAmountFuel} литров за накопленные баллы";
  26. BtnAddOnCreditCard.IsEnabled = CreditCardIsEnable;
  27. TxtAddOnCreditCard.Text = $"Добавить недостающую сумму {MissingAmount.ToString("F2")} рублей с помощью кредитной карты";
  28. }
  29. private void BtnPaymentOFCard_Click(object sender, RoutedEventArgs e)
  30. {
  31. Helper.TypeOfNoMoney = 1;
  32. this.Close();
  33. }
  34. private void BtnRefulingOnAll_Click(object sender, RoutedEventArgs e)
  35. {
  36. Helper.TypeOfNoMoney = 2;
  37. this.Close();
  38. }
  39. private void BtnAddOnCreditCard_Click(object sender, RoutedEventArgs e)
  40. {
  41. Helper.TypeOfNoMoney = 3;
  42. this.Close();
  43. }
  44. }
  45. }