Exemplo n.º 1
0
        /// <summary>
        /// 更新資料庫
        /// </summary>
        /// <param name="lottotype"></param>
        private void UpdateDataNow(TableType lottotype) //更新資料庫
        {
            taskBarItemInfo1.ProgressState = System.Windows.Shell.TaskbarItemProgressState.Normal;
            taskBarItemInfo1.ProgressValue = 0;
            DataTable tblCsvFile = new CGLFunc().ReadCsvFile(lottotype);

            new CGLFunc().UpdateData(lottotype, tblCsvFile);
            //ShowLastNumbers();
            GoMainPage();
            ShowDataUpdate(lottotype, tblCsvFile);
            //pbStatusProcessBar.Visibility = Visibility.Hidden;
            taskBarItemInfo1.ProgressState = System.Windows.Shell.TaskbarItemProgressState.None;
        }
Exemplo n.º 2
0
        private void MiUpdatePurple_Click(object sender, RoutedEventArgs e) //紫微更新
        {
            taskBarItemInfo1.ProgressState = System.Windows.Shell.TaskbarItemProgressState.Normal;
            taskBarItemInfo1.ProgressValue = 0;
            DataTable dtPurpleDate = new CGLFunc().GetPurpleDate();
            Window    UpdatePurple = new Window()
            {
                WindowState = WindowState.Minimized,
                Visibility  = Visibility.Hidden,
                WindowStyle = WindowStyle.None
            };
            delegateUpdateData delUpdateData = new delegateUpdateData(new CGLFunc().GetPurple);
            var       dtResult       = UpdatePurple.Dispatcher.Invoke(delUpdateData, DispatcherPriority.Background, dtPurpleDate);
            DataTable dtPurpleUpdate = (DataTable)dtResult;

            new CGLFunc().UpdateData(TableType.DataPurple, dtPurpleUpdate);
            ShowDataUpdate(TableType.DataPurple, dtPurpleUpdate);
            //pbStatusProcessBar.Visibility = Visibility.Hidden;
            // tiDisplay01.Focus();
            taskBarItemInfo1.ProgressState = System.Windows.Shell.TaskbarItemProgressState.None;
        }