private void Button_Click_now_month(object sender, RoutedEventArgs e) { month = DateTime.Now.Month; year = DateTime.Now.Year; CalculationData.get_array_days(year, month); month_year.Text = array_string_month[month - 1] + " " + year.ToString(); }
private void Button_Click_old(object sender, RoutedEventArgs e) { month--; if (month <= 0) { month = 12; year--; } CalculationData.get_array_days(year, month); month_year.Text = array_string_month[month - 1] + " " + year.ToString(); }
private void Button_Click_next(object sender, RoutedEventArgs e) { month++; if (month > 12) { month = 1; year++; } CalculationData.get_array_days(year, month); month_year.Text = array_string_month[month - 1] + " " + year.ToString(); }
private void OnTimedEvent(object sender, EventArgs e) { timer.Interval = new TimeSpan(0, 0, 0, 0, 1000); if (yesturday != DateTime.Today) { CalculationData.get_array_days(year, month); month_year.Text = array_string_month[month - 1] + " " + year.ToString(); if (CalculationData.is_work(DateTime.Now.Date)) { CalculationData.nowDayObject.start_auto_update(); } yesturday = DateTime.Today; } }
public MainWindow() { InitializeComponent(); //Запускаем таймер timer = new DispatcherTimer(); timer.Tick += new EventHandler(OnTimedEvent); timer.Interval = new TimeSpan(0, 0, 0, 0, 0); timer.Start(); ListT.ItemsSource = CalculationData.get_array_days(year, month); month_year.Text = array_string_month[month - 1] + " " + year.ToString(); if (CalculationData.is_work(DateTime.Now.Date) && SQLConnector.GetTypeDay(DateTime.Now.Date) == 0) { CalculationData.nowDayObject.start_auto_update(); } }