public void LoadGrids()
        {
            DataTable tmpV = new DataTable();
            DataTable tmpP = new DataTable();

            bool first = true;

            foreach (String str in _selectedTickers)
            {
                if (first)
                {
                    tmpV  = _model.GetValueDataSource(SelectedDate, str);
                    tmpP  = _model.GetPositionsDataSource(SelectedDate, str);
                    first = false;
                }
                else
                {
                    tmpV.Merge(_model.GetValueDataSource(SelectedDate, str));
                    tmpP.Merge(_model.GetPositionsDataSource(SelectedDate, str));
                }
            }
            CompanyNameCleaner cleaner = new CompanyNameCleaner();

            ValuesDataSource    = cleaner.CleanCompanyName(tmpV, "Ticker", "Company");
            PositionsDataSource = cleaner.CleanCompanyName(tmpP, "Ticker", "Company");
        }
Example #2
0
        public void LoadChanges(bool filter1, bool isStart = false)
        {
            CompanyNameCleaner cleaner = new CompanyNameCleaner();
            DateTime           dmin    = DateTime.Parse(SelectedDate2);
            DateTime           dmax    = DateTime.Parse(SelectedDate1);

            if (dmin > dmax)
            {
                String tmp = SelectedDate2;
                SelectedDate2 = SelectedDate1;
                SelectedDate1 = tmp;
            }
            ChangesDataSource = cleaner.CleanCompanyName(_model.GetChanges(SelectedDate2, SelectedDate1, filter1), "TICKER", "COMPANY");

            if (isStart)
            {
                String name = "dailyScoreChange_" + SelectedDate1.Replace("/", "-");
                try
                {
                    ExtractTableToPDF(ChangesDataSource, name);
                }
                catch
                { }
            }
        }
        private void ProceedDatas()
        {
            var dpb = new GenericDataPointBinding <KeyValuePair <int, double>, int>();

            dpb.ValueSelector = pair => pair.Key;

            if (SelectedDate == null || SelectedUniverse == null ||
                SelectedSuperSector == null || SelectedSuperSector == "")
            {
                return;
            }

            _valuesDataSource = new DataTable();

            InvokeOnUIThread(() =>
            {
                this.BusyContent = string.Concat("Loading Values And Cleaning Companies\n");
            });

            DataTable tmp = cleaner.CleanCompanyName(_model.FillValeursAnalyse(SelectedDate, SelectedUniverse,
                                                                               SelectedSuperSector, SelectedSector), "TICKER", "Company Name");

            for (int i = 0; i < tmp.Columns.Count; i++)
            {
                _valuesDataSource.Columns.Add(tmp.Columns[i].ToString());
                _valuesDataSource.Columns[i].DataType = typeof(String);
            }


            this.ValuesDataSource = FillAndSetFormat(tmp, this._valuesDataSource);
            this.ValuesDataSource.DefaultView.Sort = ("Note DESC");

            GlobalInfos.tickerQuintQaunt = new Dictionary <string, int>();
            foreach (DataRow dr in ValuesDataSource.Rows)
            {
                GlobalInfos.tickerQuintQaunt.Add(dr["Ticker"].ToString(), int.Parse(dr["Quint Quant"].ToString()));
            }

            InvokeOnUIThread(() =>
            {
                this.BusyContent += string.Concat("Recreating all tables for filters\n");
            });

            FillColsValid();
            ValuesDataSource = RecreateTables(ValuesDataSource);
        }
        public void ProceedDatas()
        {
            String selectedRestriction = "All";

            if (ValuesRestrictionChecked)
            {
                selectedRestriction = "Valeurs";

                GlobalInfos.areValues     = true;
                GlobalInfos.areEnsemble   = false;
                GlobalInfos.areIndustries = false;
            }
            else if (IndustriesRestrictionChecked)
            {
                selectedRestriction = "Industries";

                GlobalInfos.areValues     = false;
                GlobalInfos.areEnsemble   = false;
                GlobalInfos.areIndustries = true;
            }
            else
            {
                selectedRestriction = "All";

                GlobalInfos.areValues     = false;
                GlobalInfos.areEnsemble   = true;
                GlobalInfos.areIndustries = false;
            }

            if (SelectedSuperSector != null && SelectedSuperSector != "")
            {
                GlobalInfos.areValues     = false;
                GlobalInfos.areEnsemble   = false;
                GlobalInfos.areIndustries = false;
            }

            ValuesDataSource = cleaner.CleanCompanyName(_model.GetValuesData(SelectedUniverse, SelectedSuperSector, SelectedSector, selectedRestriction));
            HistoDataSource  = new DataTable();
        }