Exemplo n.º 1
0
 protected override List <T> GetCache(DashboardFilter filter)
 {
     return(DashboardQueries.GetTable(GetCommand(filter))
            .AsEnumerable()
            .Select(x => GetInstanceFromDataRow(x))
            .ToList());
 }
Exemplo n.º 2
0
        protected override List <DashboardAR> GetCache(DashboardFilter filter)
        {
            DateTime firstOfMonth = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);

            filter.DateTo   = filter.DateTo < firstOfMonth ? filter.DateTo : firstOfMonth;
            filter.DateFrom = new DateTime(filter.DateFrom.Year, filter.DateFrom.Month, 1);
            return(DashboardQueries.GetAR(filter.DateFrom, filter.DateTo, DashboardARs.Refresh(filter.DateFrom)));
        }
Exemplo n.º 3
0
 public void FillData()
 {
     Cursor        = Cursors.Wait;
     textDate.Text = DateShowing.ToString("ddd") + " " + DateShowing.ToShortDateString();
     table         = DashboardQueries.GetProvList(DateShowing);
     FillScreen();
     Cursor = Cursors.Arrow;
 }
Exemplo n.º 4
0
 protected override List <T> GetCache(DashboardFilter filter)
 {
     if (filter.UseProvFilter && filter.ProvNum == 0)
     {
         return(new List <T>());
     }
     return(DashboardQueries.GetTable(GetCommand(filter), UseReportServer)
            .AsEnumerable()
            .Select(x => GetInstanceFromDataRow(x))
            .ToList());
 }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
0
 public void FillData()
 {
     YMultFactor = 1000;
     //colors-------------------------------------------------------------------------------
     ListColors = new List <Color>();
     ListColors.Add(Colors.MediumBlue);       //production
     ListColors.Add(Colors.Green);            //income
     //data---------------------------------------------------------------------------------
     ListData = DashboardQueries.GetProdInc(DateStart, DateEnd);
     FillGraph();
     visibleIndices = new List <int>();
     visibleIndices.Add(0);
     visibleIndices.Add(1);
     visibleIndicesOld = new List <int>(visibleIndices);
 }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
0
 public DashboardQueriesTest()
 {
     _moqhttpContextAccessor = new Mock <IHttpContextAccessor>();
     _sut = new DashboardQueries(InitialData.context, _moqhttpContextAccessor.Object);
 }
Exemplo n.º 9
0
 public void FillData()
 {
     textDate.Text = DateShowing.ToString("ddd") + " " + DateShowing.ToShortDateString();
     table         = DashboardQueries.GetProvList(DateShowing);
     FillScreen();
 }