Пример #1
0
 public void CheckStatus()
 {
     Console.WriteLine("check status");
     expireDate       = MySQLCommands.GetNewestPayment(ID);
     expireDateFormat = DateTime.Parse(expireDate);
     if (expireDateFormat >= DateTime.Today)
     {
         Console.WriteLine("cActives");
         tb_Status.Text       = "Active";
         tb_Status.Foreground = System.Windows.Media.Brushes.GreenYellow;
         btn_Pay.IsEnabled    = false;
     }
     else
     {
         Console.WriteLine("cActives not active");
         tb_Status.Text       = "Not Active";
         tb_Status.Foreground = System.Windows.Media.Brushes.Red;
         btn_Pay.IsEnabled    = true;
     }
 }
Пример #2
0
 public Payments(int _id, string _name, string _surname, string _phone, string _gender, DateTime _regDate, string _cardID)
 {
     InitializeComponent();
     ID                  = _id;
     name                = _name;
     surname             = _surname;
     phone               = _phone;
     regDate             = _regDate;
     tb_Name.Text        = name;
     tb_Surname.Text     = surname;
     tb_PhoneNumber.Text = phone;
     tb_CardID.Text      = _cardID;
     cardID              = _cardID;
     expireDate          = MySQLCommands.GetNewestPayment(ID);
     if (expireDate != null)
     {
         expireDateFormat = DateTime.Parse(expireDate);
     }
     RefreshPaymentList();
     rb_1Month.IsChecked = true;
 }