예제 #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            contrDashProvList.FillData();
            //prodProvs
            List <Color>       listColorsProd = DashboardQueries.GetProdProvColors();
            List <List <int> > listDataProd   = DashboardQueries.GetProdProvs(contrDashProdProvs.DateStart, contrDashProdProvs.DateEnd);

            contrDashProdProvs.FillData(Lans.g(this, "Production by Prov"), 1000, listColorsProd, listDataProd);
            //A/R
            List <Color> listColorsAR = new List <Color>();

            listColorsAR.Add(Colors.Firebrick);
            List <DashboardAR> listDashARIn = DashboardARs.Refresh(contrDashAR.DateStart);

            if (listDashARIn.Count == 0)
            {
                //Make a guess as to how long the user might have to wait.
                double agingInMilliseconds = Ledgers.GetAgingComputationTime();
                //Aging will be run a total of 13 times.
                agingInMilliseconds = agingInMilliseconds * 13;
                TimeSpan timeSpan     = TimeSpan.FromMilliseconds(agingInMilliseconds);
                string   timeEstimate = "";
                if (timeSpan.Minutes > 0)
                {
                    timeEstimate += timeSpan.Minutes + " " + Lans.g(this, "minutes and") + " ";
                }
                timeEstimate += timeSpan.Seconds + " " + Lans.g(this, "seconds");
                MessageBoxResult result = MessageBox.Show(Lans.g(this,
                                                                 "A one-time routine needs to be run that will take about") + "\r\n"
                                                          + timeEstimate + ".  " + Lans.g(this, "Continue?"), "", MessageBoxButton.OKCancel);
                if (result != MessageBoxResult.OK)
                {
                    Close();
                    return;
                }
            }
            List <DashboardAR> listDashAROut = DashboardQueries.GetAR(contrDashAR.DateStart, contrDashAR.DateEnd, listDashARIn);
            List <List <int> > listDataAR    = new List <List <int> >();

            //1 dimensional for now.
            listDataAR.Add(listDashAROut.OrderBy(x => x.DateCalc).Select(x => (int)x.BalTotal).ToList());
            contrDashAR.FillData(Lans.g(this, "Accounts Receivable"), 1000, listColorsAR, listDataAR);
            //ProdInc
            contrDashProdInc.FillData();
            //new pat
            List <Color> listColorsNP = new List <Color>();

            listColorsNP.Add(Colors.Chocolate);
            List <List <int> > listDataNP = DashboardQueries.GetNewPatients(contrDashNewPat.DateStart, contrDashNewPat.DateEnd);

            contrDashNewPat.FillData(Lans.g(this, "New Patients"), 1, listColorsNP, listDataNP);
        }
예제 #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            contrDashProvList.FillData();
            //prodProvs
            List <Color>       listColorsProd = DashboardQueries.GetProdProvColors();
            List <List <int> > listDataProd   = DashboardQueries.GetProdProvs(contrDashProdProvs.DateStart, contrDashProdProvs.DateEnd);

            contrDashProdProvs.FillData(Lans.g(this, "Production by Prov"), 1000, listColorsProd, listDataProd);
            //A/R
            List <Color> listColorsAR = new List <Color>();

            listColorsAR.Add(Colors.Firebrick);
            List <DashboardAR> listDashAR = DashboardARs.Refresh(contrDashAR.DateStart);

            if (listDashAR.Count == 0)
            {
                MessageBoxResult result = MessageBox.Show(Lans.g(this,
                                                                 "A one-time routine needs to be run that will take a few moments."), "", MessageBoxButton.OKCancel);
                if (result != MessageBoxResult.OK)
                {
                    Close();
                    return;
                }
            }
            List <List <int> > listDataAR = DashboardQueries.GetAR(contrDashAR.DateStart, contrDashAR.DateEnd, listDashAR);

            contrDashAR.FillData(Lans.g(this, "Accounts Receivable"), 1000, listColorsAR, listDataAR);
            //ProdInc
            contrDashProdInc.FillData();
            //new pat
            List <Color> listColorsNP = new List <Color>();

            listColorsNP.Add(Colors.Chocolate);
            List <List <int> > listDataNP = DashboardQueries.GetNewPatients(contrDashNewPat.DateStart, contrDashNewPat.DateEnd);

            contrDashNewPat.FillData(Lans.g(this, "New Patients"), 1, listColorsNP, listDataNP);
        }