예제 #1
0
        public static List <MockSurveyCorporateFindingsReport> GetSaferMatrixRDLC(SearchCorporateER search)
        {
            var saferMatrixList = new List <MockSurveyCorporateFindingsReport>();
            var mockSurveyList  = GetSaferMatrixData(search);
            int limit           = int.MaxValue;
            var list            = new List <MockSurveyCorporateFindingsReport>();

            using (var dbmDbEntityContainer = new DBMEdition01_Entities())
            {
                foreach (var safer in dbmDbEntityContainer.GetSafterMap())
                {
                    var shortList = mockSurveyList.Where(item => item.CorporateFinalScoreID == safer.ScoreID).DistinctBy(x => new { x.SiteID, x.StandardLabel });
                    shortList = GroupBySite(shortList);
                    var shortListCount = shortList.Count();
                    MockSurveyCorporateFindingsReport addItem = ReturnCorpFindingsRDLC(safer, shortList.Take(limit));
                    if (shortListCount > limit)
                    {
                        addItem.FullEP = string.Format("{0}+({1}) more EP(s)", addItem.FullEP, (shortList.Count() - limit).ToString());
                    }

                    list.Add(addItem);
                }
            }

            return(list);
        }
예제 #2
0
        public static SaferMatrixMap GetSaferMatrix(SearchCorporateER search)
        {
            int limit          = 8;
            var mockSurveyList = GetSaferMatrixData(search);

            if (mockSurveyList.Count < 1)
            {
                return(null);
            }

            var saferMatrixMap = new SaferMatrixMap();

            using (var dbmDbEntityContainer = new DBMEdition01_Entities())
            {
                foreach (var safer in dbmDbEntityContainer.GetSafterMap())
                {
                    var shortList = mockSurveyList.Where(item => item.CorporateFinalScoreID == safer.ScoreID).DistinctBy(x => new { x.SiteID, x.StandardLabel });

                    shortList = GroupBySite(shortList);
                    var shortListCount = shortList.Count();
                    var fullEP         = ReturnCorpFindings(safer, shortList.Take(limit));
                    if (shortListCount > limit)
                    {
                        fullEP = string.Format("{0}+({1}) more EP(s)", fullEP, (shortList.Count() - limit).ToString());
                    }

                    AssignEPValue(saferMatrixMap, fullEP, safer.ScoreID);
                }
            }
            return(saferMatrixMap);
        }