Esempio n. 1
0
        /// <summary>
        /// Used for the rss feed
        /// </summary>
        /// <returns>all the last funds' investments</returns>
        public static List <FundInvestment> GetNewFundInvestmentList()
        {
            DateTime lastUpdate      = ExecutionUpdater.GetLastDateRss();
            var      fundInvestments = InvestmentDataAccess.GetNewFundInvestments(lastUpdate);

            return(fundInvestments);
        }
Esempio n. 2
0
        /// <summary>
        /// Used for the rss feed
        /// </summary>
        /// <returns>all the last funds' investments</returns>
        public static List <FundIncubation> GetNewFundIncubationList()
        {
            DateTime lastUpdate      = ExecutionUpdater.GetLastDateRss();
            var      fundIncubations = IncubationDataAccess.GetNewFundIncubation(lastUpdate);

            return(fundIncubations);
        }
Esempio n. 3
0
        public static void GetInvestmentsFromFeed()
        {
            try
            {
                DateTime    lastUpdate  = ExecutionUpdater.GetLastUpdateInvestment();
                var         feeds       = FeedStream.GetStartupFeed();
                List <Feed> investments = feeds.Where(f => f.item.typeValue == Entities.FeedTypes.StartupRole &&
                                                      f.timestamp.ToDateTime() > lastUpdate &&
                                                      !string.IsNullOrEmpty(f.description) &&
                                                      f.description.Contains(Constants.INVEST_IN)).ToList();

                //var group = investments.GroupBy(f => f.actor).ToDictionary(k => k.Key.name, v => v.ToList());
                var group = investments.GroupBy(f => f.actor.id);

                Dictionary <Entity, List <Investment> > investmentsFeedGrouped = new Dictionary <Entity, List <Investment> >();
                foreach (var item in group)
                {
                    investmentsFeedGrouped.Add(new Entity()
                    {
                        Id      = item.First().actor.id,
                        Name    = item.First().actor.name,
                        TagLine = item.First().actor.tagline,
                        Url     = item.First().actor.angellist_url
                    }
                                               , (item.Select(investment => new Investment()
                    {
                        Id = investment.id,
                        FundId = investment.actor.id,
                        Startup = new Entity()
                        {
                            Id = investment.target.id,
                            Name = investment.target.name,
                            Url = investment.target.angellist_url,
                            TagLine = investment.target.tagline,
                        },
                        Description = investment.description,
                        DateActivityFeed = investment.timestamp
                    })).ToList());
                }

                SaveDailyActivity(investmentsFeedGrouped);

                //	ExecutionUpdater.InsertFirst();
                ExecutionUpdater.UpdateInvestment();

                //	return investmentsFeedGrouped;
            }
            catch (Exception ex)
            {
                Log.Error("GetInvestmentsFromFeed", "error", ex);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Used for the CRM
        /// </summary>
        /// <returns></returns>
        public static Dictionary <Entity, List <Investment> > GetNewFundInvestment()
        {
            //	ExecutionUpdater.UpdateCrmSent();
            DateTime lastUpdate = ExecutionUpdater.GetLastDateCrmSent();
            List <FundInvestment> newFundInvestments = InvestmentDataAccess.GetNewFundInvestments(lastUpdate);

            Dictionary <Entity, List <Investment> > dic = new Dictionary <Entity, List <Investment> >();

            foreach (var fund in newFundInvestments)
            {
                dic.Add(fund.Fund, fund.Investments);
            }

            return(dic);
        }