Пример #1
0
        /// <summary>
        /// Start the loading of the filters.
        /// </summary>
        public void BegingFilterLoadProcess()
        {
            DateTime today = DateTime.Now.Date;

            dp_PRFromDate.Value           = today;
            dp_PRToDate.Value             = today;
            dp_POFromDate.Value           = today;
            dp_POToDate.Value             = today;
            dp_finalReceiptFromDate.Value = today;
            dp_finalReciptToDate.Value    = today;

            // Bring the loading screen to the front.
            ActivateLoadingScreen("Loading Filters...");

            ms_applicaitonMenuStrip.Enabled      = false;
            FilterUtils.FiltersLoaded            = false;
            FilterUtils.FilterLoadProcessStarted = false;
            FiltersTimer.Start();
        }
Пример #2
0
        /// <summary>
        /// Once an import, filter apply and filter removal occur, this timer will initiate. The data contained within
        /// the access database will then be loaded into the application where calculations will occur.        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DataLoaderTimer_Tick(object sender, EventArgs e)
        {
            NavigationLocked = true;
            if (!PRPO_DB_Utils.DataLoadProcessStarted)
            {
                PRPO_DB_Utils.DataLoadProcessStarted = true;
                PRPO_DB_Utils.KPITablesLoaded        = false;

                pnl_activePage.Controls.Clear();
                pnl_loadingScreen.Visible = true;
                pnl_loadingScreen.BringToFront();
                lbl_loadingStatus.Text = "Loading Data...";


                Thread KPA_PlanThread = new Thread(() =>
                {
                    overallData.kpa.plan.LoadData();
                });


                Thread KPA_PurchThread = new Thread(() =>
                {
                    overallData.kpa.purch.LoadData();
                });


                Thread KPA_PurchSubThread = new Thread(() =>
                {
                    overallData.kpa.purchSub.LoadData();
                });


                Thread KPA_PurchTotalThread = new Thread(() =>
                {
                    overallData.kpa.purchTotal.LoadData();
                });


                Thread KPA_FollowUpThread = new Thread(() =>
                {
                    overallData.kpa.followUp.LoadData();
                });


                Thread KPA_HotJobs = new Thread(() =>
                {
                    overallData.kpa.hotJobs.LoadData();
                });



                Thread KPA_CurrPlanVsActualThread = new Thread(() =>
                {
                    overallData.kpa.currPlanVsActual.LoadData();
                });



                PRPO_DB_Utils.ScheduledDataLoads = 16;

                Thread tableLoadThread = new Thread(() => {
                    overallData.LoadKPITables(Overall.SelectedCountry);
                });



                KPA_PlanThread.Start();
                KPA_PurchThread.Start();
                KPA_PurchSubThread.Start();
                KPA_PurchTotalThread.Start();
                KPA_FollowUpThread.Start();
                KPA_HotJobs.Start();
                KPA_CurrPlanVsActualThread.Start();
                tableLoadThread.Start();
            }


            if (PRPO_DB_Utils.KPITablesLoaded)
            {
                PRPO_DB_Utils.KPITablesLoaded = false;

                // KPI
                Thread KPI_PlanThread = new Thread(() =>
                {
                    overallData.kpi.plan.LoadData();
                });

                Thread KPI_PurchThread = new Thread(() =>
                {
                    overallData.kpi.purch.LoadData();
                });


                Thread KPI_FollowUpThread = new Thread(() =>
                {
                    overallData.kpi.followUp.LoadData();
                });


                Thread KPI_PurchTwoThread = new Thread(() =>
                {
                    overallData.kpi.purchTwo.LoadData();
                });


                Thread KPI_PurchSubThread = new Thread(() =>
                {
                    overallData.kpi.purchSub.LoadData();
                });


                Thread KPI_PurchTotalThread = new Thread(() =>
                {
                    overallData.kpi.purchTotal.LoadData();
                });


                Thread KPI_PurchPlanThread = new Thread(() =>
                {
                    overallData.kpi.purchPlan.LoadData();
                });

                Thread KPI_OtherThread = new Thread(() =>
                {
                    overallData.kpi.other.LoadData();
                });


                KPI_PlanThread.Start();
                KPI_PurchThread.Start();
                KPI_FollowUpThread.Start();
                KPI_PurchTwoThread.Start();
                KPI_PurchSubThread.Start();
                KPI_PurchTotalThread.Start();
                KPI_PurchPlanThread.Start();
                KPI_OtherThread.Start();
            }



            if (PRPO_DB_Utils.DataLoaded)
            {
                DataLoaderTimer.Stop();
                PRPO_DB_Utils.DataLoaded = false;

                if (!FiltersApplied)
                {
                    FilterUtils.FiltersLoaded            = false;
                    FilterUtils.FilterLoadProcessStarted = false;
                    FiltersTimer.Start();
                }
                else
                {
                    pnl_loadingScreen.Visible = false;
                    tblpnl_Filters.BringToFront();
                    btn_clearFilters.Enabled = true;
                    NavigationLocked         = false;
                }

                if (Overall.SelectedCountry == AccessInfo.MainTables.US_PRPO)
                {
                    using (StreamReader sr = new StreamReader(AppDirectoryUtils.logFiles[(int)AppDirectoryUtils.LogFiles.LoadedUSDate]))
                    {
                        lbl_dashboardDate.Text = sr.ReadLine();
                    }
                }
                else
                {
                    using (StreamReader sr = new StreamReader(AppDirectoryUtils.logFiles[(int)AppDirectoryUtils.LogFiles.LoadedMXDate]))
                    {
                        lbl_dashboardDate.Text = sr.ReadLine();
                    }
                }
            }
        }