Пример #1
0
 public void AddDcfOutput(DcfOutput dco)
 {
     _dcfOutput = dco;
 }
Пример #2
0
 private void btnCalculateForecast_Click(object sender, RoutedEventArgs e)
 {
     if (_finDataAdapter == null)
     {
         MessageBox.Show("Load data first.");
     }
     else
     {
         MessageBox.Show("Calculating forecast");
         //DcfDataDao dcfDataDao= new DcfDataDao();
         //_finDataAdapter.addDcfDataDao(dcfDataDao);
         //DcfCalculator.GenerateDcfData(_finDataAdapter.FinDataDao.FinDatas, dcfDataDao);
         //DcfInput dcfInput = new DcfInput();
         //_finDataAdapter.AddDcfInput(dcfInput);
         //DcfCalculator.CalculateQuaterlyForecasts(dcfDataDao.DcfDatas,dcfInput);
         if (_finDataAdapter.FinDataDao.FinDatas.Count > 0)
         {
             DcfOutput dcfOutput = new DcfOutput();
             _finDataAdapter.AddDcfOutput(dcfOutput);
             _dcfVM.PrepareCalculations(dataGridForecast, _finDataAdapter.DcfDataDao, _dci,
                                        _finDataAdapter.FinDataDao, _finDataAdapter);
             _dcfVM.GetDcf();
             _dcfVM.ClearTable();
             _dcfVM.PrepareTable(_finDataAdapter.DcfDataDao.DcfDatas);
             panelDcfOutput.DataContext = _dcfVM;
             panelForecast.DataContext = _dcfVM;
         }
         else
         {
             MessageBox.Show("No data available. Please load new XML or retrieve data from the web.");
         }
     }
     /*YChartsExcelScraperTest yExcel = new YChartsExcelScraperTest();
     XDocument data = yExcel.GetData("CSCO");
     FinDataAdapter finDataAdapter = new FinDataAdapter("csco", FinDataAdapter.DataSource.XLS, data);
     finDataAdapter.PrepareData();
     FinAnalysisVM finAnalysisVm = new FinAnalysisVM(finDataAdapter.FinDataDao.FinDatas, dataGrid);
     panelQuarterlyData.DataContext = finAnalysisVm;*/
 }