Exemple #1
0
        public Technology Find()
        {
            LoadCategoryOperation lco = new LoadCategoryOperation(connection, 3, 10);

            lco.Execute();
            if (lco.Categories == null)
            {
                return(null);
            }
            Technology technology = new Technology();

            foreach (var category in lco.Categories)
            {
                LoadGoodsOperation lgo = new LoadGoodsOperation(connection, category.ID);
                lgo.Execute();
                if (lgo.Goodss == null)
                {
                    continue;                    // 类别下没有产品
                }
                var validGoodss = lgo.Goodss.Where(s => s.IsValid);
                if (validGoodss.Count() == 0)
                {
                    continue;                         // 产品没有关联条文
                }
                TechnologyProduct tp = new TechnologyProduct();
                tp.Name             = category.Name;
                tp.URL              = Host + category.rootPath + "/" + category.urlPath + "/";
                tp.Items            = validGoodss.Select(s => s.Item).ToList();
                tp.LatestUpdateTime = lgo.Goodss.Max(s => s.UpdateTime);
                technology.Table.Add(tp);
            }
            return(technology);
        }
Exemple #2
0
 public TechnologyOperation(string standard, DbStandardGateway dbStandardGateway, TechnologyProduct technologyProduct)
 {
     this.standard          = standard;
     this.dbStandardGateway = dbStandardGateway;
     this.technologyProduct = technologyProduct;
 }