예제 #1
0
        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();
        }
예제 #2
0
 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();
 }
예제 #3
0
 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();
 }
예제 #4
0
        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;
            }
        }
예제 #5
0
        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();
            }
        }