Esempio n. 1
0
        public void DownloadCompany()
        {
            CrawlerCompanyService s = new CrawlerCompanyService();

            StockRepository        a  = new StockRepository();
            StockCompanyRepository sc = new StockCompanyRepository();

            List <T_StockCompany> datas = new List <T_StockCompany>();
            var data = a.GetAll().Where(x => x.Stock_Catetory_ID > 1 && x.Stock_Catetory_ID < 28);

            foreach (var item in data)
            {
                var ddd = s.GetCompany(item.Stock_Catetory_ID, item.Stock_ID);
                datas.Add(new T_StockCompany()
                {
                    Stock_ID             = item.Stock_ID,
                    Company_Url          = item.Stock_Url,
                    Catetory_ID          = item.Stock_Catetory_ID,
                    CompanyCreateDate    = ddd.CompanyCreateDate,
                    StockCreateDate      = ddd.StockCreateDate,
                    Stock_Capital        = ddd.Stock_Capital,
                    Revenue              = ddd.Revenue,
                    Company_Official_Url = ddd.Company_Official_Url,
                    Company_Fatory       = ddd.Company_Fatory
                });
            }
            sc.CreateAll(datas);
        }
Esempio n. 2
0
        public StockCompanyViewModel GetCompanyById(string stock_id)
        {
            StockCompanyRepository rep = new StockCompanyRepository();
            var data = rep.Get(x => x.Stock_ID == stock_id);

            return(ConvertToViewModel(data));
        }