//Return a list of weekly or monthly sales figures public List <Report> returnFigures(timeFrame frame) { getFigures(); switch (frame) { case timeFrame.week: return(_MonthlySales); case timeFrame.month: return(_MonthlySales); } return(new List <Report>()); //This should never be reached, it's just here so it will compile }
//Return prediction to be passed to GUI public List <Report> getPrediction(timeFrame frame) { //Reset the predictions getAllPredictions(); //Return switch (frame) { case timeFrame.week: return(_weekPredictions); case timeFrame.month: return(_monthPredictions); } return(new List <Report>()); //This should never be returned, it's just there for semantics. }
//Return sales to be passed to GUI public List <SalesReport> getSales(timeFrame frame) { //Reset the sales getAllSales(); //Return switch (frame) { case timeFrame.week: return(_weekSales); case timeFrame.month: return(_monthSales); } return(new List <SalesReport>()); }
//Load Report private void LoadReport(timeFrame time) { //Set the current timeframe for exporting currentTimeFrame = time; //Hide other panels and show this one if (Panel_SalesReport.Visibility == Visibility.Hidden) { HidePanels(); cleartext(); HideWarnings(); Panel_SalesReport.Visibility = Visibility.Visible; } //Set correct data source and title if (time == timeFrame.week) { //Set Data Source to Weekly - FINISH THIS ReportGrid.ItemsSource = Manager.Figures.returnFigures(timeFrame.week); //Show the correct title WeeklySalesReportTitle.Visibility = Visibility.Visible; MonthlySalesReportTitle.Visibility = Visibility.Hidden; } else if (time == timeFrame.month) { //Set Data Source to Monthly - FINISH THIS ReportGrid.ItemsSource = Manager.Figures.returnFigures(timeFrame.month); //Show the correct title MonthlySalesReportTitle.Visibility = Visibility.Visible; WeeklySalesReportTitle.Visibility = Visibility.Hidden; } //Populate(Combo_ReportPeriod, timeFrameList); }
//Load Predictions private void LoadPredictions(timeFrame time) { //SET THE CURRENT TIMEFRAME - USED FOR EXPORTING currentTimeFrame = time; //Hide other panels and show Predictions panel if (Panel_SalesPredictions.Visibility == Visibility.Hidden) { HidePanels(); cleartext(); HideWarnings(); Panel_SalesPredictions.Visibility = Visibility.Visible; } //Set Weekly or Monthly Sales Predictions if (time == timeFrame.week) { //Set Data Source to Weekly //PredictionsGrid.ItemsSource = Manager.Sales.SalesRecords; PredictionsGrid.ItemsSource = Manager.Predictions.getPrediction(timeFrame.week); //Show the correct title WeeklySalesPredictionTitle.Visibility = Visibility.Visible; MonthlySalesPredictionTitle.Visibility = Visibility.Hidden; } else if (time == timeFrame.month) { //Set Data Source to Monthly - FINISH THIS PredictionsGrid.ItemsSource = Manager.Predictions.getPrediction(timeFrame.month); //Show the correct title MonthlySalesPredictionTitle.Visibility = Visibility.Visible; WeeklySalesPredictionTitle.Visibility = Visibility.Hidden; } }
public void addTimeFrame(timeFrame TimeFrame) { trackingHistorySet.Add(TimeFrame); }