Ejemplo n.º 1
0
        private IEnumerable <CompanyChain> GetCompanyChainsWithUpdateReportCompanies(int targetCompanyId, ICollection <NPReportCompany> reportCompanies)
        {
            var chains       = new List <CompanyChain>();
            var idirectPaths = GetPaths(targetCompanyId).Where(x => x.Count() > 1);

            foreach (var path in idirectPaths)
            {
                var chainCompanies = new List <NPReportCompany>();
                foreach (var edge in path)
                {
                    var reportCompany = reportCompanies.SingleOrDefault(x => x.ProjectCompany.Id == edge.Target);
                    if (reportCompany == null)
                    {
                        var factShare = factShares.First(x => x.DependentProjectCompanyId == edge.Target);//
                        reportCompany = new NPReportCompany(factShare, companyNumberContainer);
                        reportCompanies.Add(reportCompany);
                    }
                    chainCompanies.Add(reportCompany);
                }
                chains.Add(new CompanyChain(chains.Count() + 1, chainCompanies));
            }
            return(chains);
        }
 protected NPCompanySheetBase(ExcelWorksheet sheet, NPReportCompany company, int pageNumber)
     : base(sheet, company.OwnerCompany, pageNumber)
 {
     Company = company;
 }