Exemple #1
0
        /// <summary>
        /// Get values for the profit chart
        /// </summary>
        /// <param name="date"></param>
        /// <param name="ticker"></param>
        /// <returns></returns>
        public RadObservableCollection <KeyValuePair <String, double> > GetRadarProfitData(String date, String ticker)
        {
            int id_fga = GetSectorFromTicker(ticker);

            Dictionary <object, object> values =
                connection.ProcedureStockeeDico("ACT_Radar_Growth", new List <String> {
                "@date", "@Pres", "@TICKER", "@FGA", "@MM"
            },
                                                new List <Object> {
                date, "Qualite", ticker, id_fga.ToString(), ""
            });

            RadObservableCollection <KeyValuePair <String, double> > res = new RadObservableCollection <KeyValuePair <string, double> >();

            foreach (var o in values)
            {
                if (o.Value == null || o.Value.ToString() == "")
                {
                    res.Add(new KeyValuePair <String, double>(o.Key.ToString(), 0));
                }
                else
                {
                    res.Add(new KeyValuePair <String, double>(o.Key.ToString(), (double)o.Value));
                }
            }

            return(res);
        }
Exemple #2
0
        /// <summary>
        /// get all univers from the database
        /// </summary>
        /// <returns></returns>
        public RadObservableCollection <String> getUnivers()
        {
            RadObservableCollection <String> collection = new RadObservableCollection <String>();

            collection.Add("");
            collection.Add("ALL");
            collection.Add("USA");
            collection.Add("EUROPE");
            collection.Add("EUROPE EX EMU");
            collection.Add("EMU");
            collection.Add("FRANCE");
            collection.Add("");
            collection.Add("FEDERIS NORTH AMERICA");
            collection.Add("FEDERIS ISR AMERIQUE");
            collection.Add("FEDERIS EUROPE ACTIONS");
            collection.Add("FEDERIS EX EURO");
            collection.Add("FEDERIS EURO ACTIONS");
            collection.Add("AVENIR EURO");
            collection.Add("FEDERIS ISR EURO");
            collection.Add("FEDERIS ACTIONS");
            collection.Add("FEDERIS IRC ACTIONS");
            collection.Add("FEDERIS CROISSANCE EURO");
            collection.Add("FEDERIS VALUE EURO");
            collection.Add("FEDERIS FRANCE ACTIONS");

            return(collection);
        }
        private void Init()
        {
            #region Dates

            _dates         = _model.GetDates();
            _selectedDate  = _dates[0];
            _selectedDate2 = _dates[0];

            #endregion

            #region Pays

            _pays          = _model.GetPays();
            _selectedPays1 = _pays[0];
            _selectedPays2 = _pays[0];

            #endregion

            #region Maturity

            _maturities        = _model.GetMaturity();
            _selectedMaturity  = _maturities[0];
            _selectedMaturity2 = _maturities[0];

            #endregion

            #region Source

            _source         = _model.GetSource();
            _selectedSource = _source[0];

            #endregion
        }
 private void InitCollections()
 {
     this.Albums         = new RadObservableCollection <FacebookAlbum>();
     this.UpcomingEvents = new RadObservableCollection <FacebookUpcomingEvent>();
     this.PastEvents     = new RadObservableCollection <FacebookPastEvent>();
     this.PublicInfos    = new RadObservableCollection <FacebookPublicInfo>();
     this.RecentPlaces   = new RadObservableCollection <FacebookRecentPlace>();
 }
Exemple #5
0
 /// <summary>
 ///     Initializes a new instance of the MainViewModel class.
 /// </summary>
 public MainViewModel()
 {
     BoxesInTimeline = new ObservableCollection <BaseBox>();
     NewBoxList      = new RadObservableCollection <BaseBox> {
         NewNSRBox(), NewPVCBox(), NewPauseBox()
     };
     BoxesInTimeline.Add(NewNSRBox());
     NewBoxList.CollectionChanged += NewBoxListOnCollectionChanged;
 }
        public RepartitionValeurViewModel()
        {
            _model = new RepartitionValeurModel();

            Dates            = _model.GetDates();
            SelectedDate     = _dates[0];
            AvailableTickers = _model.GetAllTickers();
            SelectedTickers  = new RadObservableCollection <string>();
        }
 private void displayGraph()
 {
     centerAvgGraph.Clear();
     centerAvgGraph          = GenerateRandomSerie(10, new DateTime(2000, 1, 1));
     XAxis.MajorTickInterval = 2;
     MaxY          = MaxScale + 10.0;
     YAxis.Maximum = MaxY;
     ReferenceGraph.Series[0].ItemsSource = centerAvgGraph;
     ReferenceGraph.Series[1].ItemsSource = GenerateRandomSerie(5, new DateTime(2000, 1, 1));
     ReferenceGraph.Series[2].ItemsSource = GenerateRandomSerie(5, new DateTime(2000, 6, 1));
 }
        public SimpleViewModel()
        {
            var data = new RadObservableCollection<SalesInfo>();
            DateTime startDate = new DateTime(2012, 12, 15);
            for (int i = 0; i < 20; i += 1)
            {
                data.Add(new SalesInfo() { Time = startDate.AddDays(i), Value = i });
            }

            this.Data = data;
        }
Exemple #9
0
        public RadObservableCollection <String> GetAllTickers()
        {
            List <object> tmp = _connection.SqlWithReturn("SELECT TICKER FROM DATA_FACTSET WHERE DATE = (SELECT MAX(DATE) FROM DATA_FACTSET)");

            RadObservableCollection <String> res = new RadObservableCollection <string>();

            foreach (var v in tmp)
            {
                res.Add(v.ToString());
            }

            return(res);
        }
        public RadObservableCollection <String> GetDates()
        {
            RadObservableCollection <String> collection = new RadObservableCollection <String>();

            if (coBase.State == ConnectionState.Open)
            {
                foreach (DateTime d in SelectDistinctSimple("DATA_FACTSET", "DATE", "DESC"))
                {
                    collection.Add(d.ToShortDateString());
                }
            }
            return(collection);
        }
Exemple #11
0
        public void showChart4()
        {
            DataList4 = new RadObservableCollection <KeyValuePair <string, float> >();

            foreach (DataRow row in _ratesDataSource4.Rows)
            {
                string date = row["Date"].ToString();
                date = date.Substring(0, 10);
                string ratetmp = row["Valeur"].ToString();
                float  rate    = float.Parse(ratetmp) * 10;
                DataList4.Add(new KeyValuePair <string, float>(date, rate));
            }
        }
Exemple #12
0
        public RadObservableCollection <String> GetDates()
        {
            String sql = "select distinct DATE from TX_AGGREGATE_DATA order by Date";
            RadObservableCollection <String> collection = new RadObservableCollection <String>();

            if (co.IsOpen())
            {
                foreach (DateTime d in co.SqlWithReturn(sql))
                {
                    collection.Add(d.ToShortDateString());
                }
            }
            return(collection);
        }
Exemple #13
0
        public RadObservableCollection <String> GetPays()
        {
            String sql = "select distinct key2 from TX_AGGREGATE_DATA WHERE key1 = 'YTM_I' order by key2";
            RadObservableCollection <String> collection = new RadObservableCollection <string>();

            if (co.IsOpen())
            {
                foreach (String d in co.SqlWithReturn(sql))
                {
                    collection.Add(d.ToString());
                }
            }
            return(collection);
        }
Exemple #14
0
        public RadObservableCollection <String> GetSource()
        {
            String sql = "select distinct key5 from TX_AGGREGATE_DATA";
            RadObservableCollection <String> collection = new RadObservableCollection <string>();

            if (co.IsOpen())
            {
                foreach (String s in co.SqlWithReturn(sql))
                {
                    collection.Add(s.ToString());
                }
            }
            return(collection);
        }
        public RepartitionViewModel()
        {
            _model = new RepartitionModel();

            _dates       = _model.GetDates();
            SelectedDate = _dates[0];

            _tickers       = _model.GetAllTickers();
            _portefeuilles = new RadObservableCollection <string> {
                "6100002", "6100030",
                "AVEURO", "6100004", "6100063", "AVEUROPE", "6100001",
                "6100033", "6100062", "6100026", "6100024"
            };
        }
        public RadObservableCollection <String> getIsin()
        {
            String sql = "select distinct ISINId from ref_security.PRICE where Price_Source = 'IBOXX_EUR' or Price_Source = 'BARCLAYS' order by ISINId";
            RadObservableCollection <String> collection = new RadObservableCollection <String>();

            if (_connection.IsOpen())
            {
                foreach (String d in _connection.SqlWithReturn(sql))
                {
                    collection.Add(d.ToString());
                }
            }
            return(collection);
        }
        public RadObservableCollection <KeyValuePair <string, int> > GetQuintiles(String ticker, String dateMin, String dateMax)
        {
            RadObservableCollection <KeyValuePair <string, int> > res = new RadObservableCollection <KeyValuePair <string, int> >();

            String request = "SELECT CONVERT(DATE, date, 103) as Date, GARPN_QUINTILE_S as Quint FROM DATA_FACTSET WHERE TICKER='" + ticker + "' AND GARPN_QUINTILE_S IS NOT NULL AND DATE <= '" + dateMin + "' AND DATE >= '" + dateMax + "' ORDER BY DATE";
            List <KeyValuePair <string, int> > values = _connection.sqlToListKeyValuePair(request);

            foreach (var v in values)
            {
                res.Add(new KeyValuePair <string, int>(v.Key.Substring(0, 10), v.Value));
            }

            return(res);
        }
Exemple #18
0
        public static RadObservableCollection <Club> GetClubs()
        {
            RadObservableCollection <Club> clubs = new RadObservableCollection <Club>();

            Club club;

            for (int i = 0; i < 20; i++)
            {
                club = new Club("Liverpool" + i, new DateTime(1892, 1, 1), i);
                clubs.Add(club);
            }

            return(clubs);
        }
Exemple #19
0
        public PlotStats()
        {
            plots = new RadObservableCollection <plot>();
            var filiere = from f in cl.filiere select f;

            foreach (var x in filiere)
            {
                var tmp = from e in cl.etudiant
                          where e.id_filiere == x.id_filiere
                          select e;


                plots.Add(new plot(x.nom_filiere, tmp.Count()));
            }
        }
        public void showChart2()
        {
            DataList2 = new RadObservableCollection <KeyValuePair <string, float> >();

            foreach (DataRow row in _ratesDataSource2.Rows)
            {
                string date = row["Date"].ToString();
                int    year = int.Parse(date.Substring(6, 4));
                date = date.Substring(0, 6) + year.ToString();

                String rateTmp = row["Rate"].ToString();
                float  rate    = float.Parse(rateTmp);
                DataList2.Add(new KeyValuePair <String, float>(date, rate));
            }
        }
Exemple #21
0
        public SimpleViewModel()
        {
            var      data      = new RadObservableCollection <SalesInfo>();
            DateTime startDate = new DateTime(2012, 12, 15);

            for (int i = 0; i < 20; i += 1)
            {
                data.Add(new SalesInfo()
                {
                    Time = startDate.AddDays(i), Value = i
                });
            }

            this.Data = data;
        }
 public void showZero()
 {
     if (containsNegative)
     {
         ZeroLine = new RadObservableCollection <KeyValuePair <string, float> >();
         foreach (var v in DataList3)
         {
             ZeroLine.Add(new KeyValuePair <string, float>(v.Key, 0));
         }
         containsNegative = false;
     }
     else
     {
         ZeroLine         = null;
         containsNegative = false;
     }
 }
        public void showChart3(ObservableCollection <KeyValuePair <string, float> > Datalist, RadObservableCollection <KeyValuePair <string, float> > Datalist2)
        {
            DataList3 = new RadObservableCollection <KeyValuePair <string, float> >();

            for (int i = 0; i < ((Datalist.Count < Datalist2.Count) ? DataList.Count : Datalist2.Count); i++)
            {
                if (Datalist[i].Key == Datalist2[i].Key)
                {
                    float val = Datalist[i].Value - Datalist2[i].Value;
                    if (val < 0)
                    {
                        containsNegative = true;
                    }
                    DataList3.Add(new KeyValuePair <string, float>(Datalist[i].Key, val));
                }
            }
        }
Exemple #24
0
        public RadObservableCollection <int> GetMaturity()
        {
            String sql = "select distinct key4 from TX_AGGREGATE_DATA order by key4";
            RadObservableCollection <int> collection = new RadObservableCollection <int>();

            if (co.IsOpen())
            {
                foreach (object i in co.SqlWithReturn(sql))
                {
                    if (i.ToString() != "")
                    {
                        collection.Add(int.Parse(i.ToString()));
                    }
                }
            }
            return(Sort(collection));
        }
Exemple #25
0
        public void showChart6()
        {
            DataList6 = new RadObservableCollection <KeyValuePair <string, float> >();

            foreach (DataRow row in _ratesDataSource6.Rows)
            {
                string date = row["Date"].ToString();
                date = date.Substring(0, 10);
                string ratetmp = row["Valeur"].ToString();
                float  rate    = float.Parse(ratetmp) * 10;
                if (rate < 0)
                {
                    containsNegative = true;
                }
                DataList6.Add(new KeyValuePair <string, float>(date, rate));
            }
        }
        public void FillSectorsChart()
        {
            _sectorsChartDataSource = new RadObservableCollection <ChartSerie>();

            RadObservableCollection <ChartSerie> tmpChart = new RadObservableCollection <ChartSerie>();

            foreach (DataRow row in SectorsDataSource.Rows)
            {
                ChartSerie tmp =
                    _model.GetChartDataForSector(_selectedPortefeuille, row["SECTOR GICS"].ToString());
                if (tmp.Data.Count > 0)
                {
                    tmpChart.Add(tmp);
                }
            }
            SectorsChartDataSource = tmpChart;
        }
Exemple #27
0
        /// <summary>
        /// Get all SuperSectors (GICS Sectors) from the database
        /// </summary>
        /// <returns></returns>
        public RadObservableCollection <Sector> getSuperSectors()
        {
            RadObservableCollection <Sector> collection = new RadObservableCollection <Sector>();

            String sql = "SELECT CODE AS Id, LABEL AS Libelle FROM ref_security.SECTOR WHERE";

            sql += " class_name = 'GICS'";
            sql += " and [level] = 0 ORDER BY label";
            collection.Add(new Sector(-1, ""));
            collection.Add(new Sector(-1, ALLSUPERSECTORS));
            foreach (Sector s in co.sqlToListObject(sql, () => new Sector()))
            {
                collection.Add(s);
            }

            return(collection);
        }
Exemple #28
0
        /// <summary>
        /// Fill the List used for the datagrid
        /// </summary>
        public void FillStocks()
        {
            List <Dictionary <String, object> > tmp = _model.GetDoublonsData(FIND_DOUBLE_EQUITY_SQL);

            StockList = new RadObservableCollection <S_Stock>();


            foreach (Dictionary <String, object> stock in tmp)
            {
                StockList.Add(new S_Stock(stock["date"].ToString(),
                                          stock["name"].ToString(),
                                          stock["isin"].ToString(),
                                          stock["country"].ToString(),
                                          stock["ticker"].ToString())
                              );
            }
        }
Exemple #29
0
        public RadObservableCollection <KeyValuePair <string, int> > GetQuintile(String ticker)
        {
            RadObservableCollection <KeyValuePair <string, int> > res = new RadObservableCollection <KeyValuePair <string, int> >();

            String request = "SELECT CONVERT(DATE, date, 103) as Date, GARPN_QUINTILE_S as Quint FROM DATA_FACTSET WHERE TICKER='" + ticker + "' AND GARPN_QUINTILE_S IS NOT NULL ORDER BY DATE";
            List <KeyValuePair <string, int> > values = connection.sqlToListKeyValuePair(request);

            // VOIR DANS LE CAHIER L'ALGO.
            values = GetfinDeMois(values);
            values = GetLastDates(values, 12);

            foreach (var v in values)
            {
                res.Add(new KeyValuePair <string, int>(v.Key.Substring(0, 10), v.Value));
            }

            return(res);
        }
Exemple #30
0
        public RadObservableCollection <int> Sort(RadObservableCollection <int> collection)
        {
            for (int j = 1; j < collection.Count; j++)
            {
                for (int i = j; i < collection.Count; i++)
                {
                    int a = collection[i - 1];
                    int b = collection[i];

                    if (a > b)
                    {
                        collection[i]     = a;
                        collection[i - 1] = b;
                    }
                }
            }
            return(collection);
        }
Exemple #31
0
        /// <summary>
        /// Get all date from the database in DESC ORDER
        /// </summary>
        /// <returns>All Dates as Collection of Strings</returns>
        public RadObservableCollection <String> getDates()
        {
            RadObservableCollection <String> collection = new RadObservableCollection <String>();

            if (co.IsOpen())
            {
                try
                {
                    foreach (DateTime d in co.SelectDistinctSimple("DATA_FACTSET", "DATE", "DESC"))
                    {
                        collection.Add(d.ToShortDateString());
                    }
                }
                catch
                { }
            }
            return(collection);
        }
        //private Random rand = new Random();
        public void BindData()
        {
            if (ChartData == null)
            {
                ChartData = new RadObservableCollection<BarChartDataPoint>();

                for (int i = 0; i < XAsisCategories.Length; i++)
                    ChartData.Add(new BarChartDataPoint(YAxisValues[i], XAsisCategories[i]));

                NotifyOfPropertyChange(() => this.ChartData);
            }
            else
            {
                ChartData.SuspendNotifications();
                var max = 0L;

                for (int i = 0; i < XAsisCategories.Length; i++)
                {
                    // NOTE: for testing data changes
                    //var nextRand = rand.Next(0, 2);
                    //nextRand = nextRand == 0 ? -1 : nextRand;
                    //var nextVal = WidgetData[i].Amount + nextRand;
                    //nextVal = nextVal < 0 ? 0 : nextVal;
                    //WidgetData[i].Amount = nextVal;

                    ChartData[i].Amount = YAxisValues[i];

                    max = ChartData[i].Amount > max ? ChartData[i].Amount : max;
                }

                YAxisMaxValue = max + 1;
                ChartData.ResumeNotifications();
            }

            NotifyOfPropertyChange(() => this.YAxisMaxValue);
        }
        private void cmsWebServiceClient_GetIssueRelatedOverrideCompleted(object sender, GetIssueRelatedOverrideCompletedEventArgs e)
        {
            IssueRelatedOverrides = new RadObservableCollection<IssueRelatedOverride>(e.Result);
            mIssue.ModifiedObjects.OverridesModified = true;

            mDictionary = Utils.BuildDictionaryForCollection(mIssue.IssueRelatedOverrides.Select(x => x.InterlockId).ToList());

            RaisePropertyChanged("IssueRelatedOverrides");
        }
		/// <summary>
		/// Initializes a new instance of the <see cref="HierarchicalNodeViewModel" /> class.
		/// </summary>
		public HierarchicalNodeViewModel()
		{
			this.children = new RadObservableCollection<HierarchicalNodeViewModel>();
		}
 void cmsWebServiceClient_GetIssueResponsesCompleted(object sender, GetIssueResponsesCompletedEventArgs e)
 {
     IssueResponses = new RadObservableCollection<IssueResponse>(e.Result.OrderByDescending(x => x.Date));
     Loaded();
     RaisePropertyChanged("IssueResponses");
 }
        private void LoadData()
        {
            Task.Run(() => CalendarRepository.LoadData());
            CalendarRepository.GetResourceTypes(items =>
            {
                this.resourceTypes = new RadObservableCollection<ResourceType>(items);
                this.OnPropertyChanged("ResourceTypes");
            });

            CalendarRepository.GetTimeMarkers(items =>
            {
                this.timeMarkers = new RadObservableCollection<TimeMarker>(items);
                this.OnPropertyChanged("TimeMarkers");
            });
        }
		public CustomersViewModel()
		{
			NorthwindDomainContext context = new NorthwindDomainContext();
			EntityQuery<DistinctValue> contactTitlesQuery = context.GetDistinctValuesQuery("ContactTitle");
			context.Load<DistinctValue>(contactTitlesQuery
				, LoadBehavior.RefreshCurrent
				, this.OnDistinctContactTitlesLoaded
				, this.contactTitles);
			
			EntityQuery<Customer> getCustomersQuery = context.GetCustomersQuery();
			this.view = new QueryableDomainServiceCollectionView<Customer>(context, getCustomersQuery);
			
			this.view.PageSize = 10;
			this.view.AutoLoad = true;
			this.view.PropertyChanged += this.OnViewPropertyChanged;
			this.view.LoadedData += this.OnViewLoadedData;

			this.loadCommand = new DelegateCommand(this.ExecuteLoadCommand, this.LoadCommandCanExecute);

			this.countrySortDescriptor = new SortDescriptor() { Member = "Country" };
			this.citySortDescriptor = new SortDescriptor() { Member = "City" };

			this.contactTitles = new RadObservableCollection<string>();
			this.contactTitles.Add(CustomersViewModel.ClearSelectionString);
			
			this.contactTitleFilterDescriptor = new FilterDescriptor("ContactTitle", FilterOperator.IsEqualTo, FilterDescriptor.UnsetValue);
			this.view.FilterDescriptors.Add(this.contactTitleFilterDescriptor);
		}
Exemple #38
0
       public static RadObservableCollection<Club> GetClubs()
        {
            RadObservableCollection<Club> clubs = new RadObservableCollection<Club>();
           
            Club club;

            for (int i = 0; i < 20; i++)
            {
                club = new Club("Liverpool" + i, new DateTime(1892, 1, 1), i);
                clubs.Add(club);
            }

            return clubs;
        }