Exemplo n.º 1
0
        private async void LoadChallengeList()
        {
            if (selectedDogShow == null)
            {
                return;
            }

            ChallengeList = new List <IShowChallengeEntity>();
            ChallengeList = await _inShowChallengeService.GetListAsync <ShowChallengeEntity>(selectedDogShow.Id);
        }
        private async void ExecuteCommand(IDogShowEntity obj)
        {
            List <IBreedEntryEntityWithAdditionalData> items = await _breedEntryService.GetBreedEntryListAsync <BreedEntryEntityWithAdditionalData>();

            var data = items.Where(i => i.ShowId == obj.Id).ToList();

            List <IShowChallengeEntity> showChallenges = await _showChallengeService.GetListAsync <ShowChallengeEntity>(obj.Id);

            var listOfGroups = items.Select(i => i.BreedGroupName).Distinct();

            List <string> positions = new List <string>();

            positions.Add("1st");
            positions.Add("2nd");
            positions.Add("3rd");
            positions.Add("4th");

            //var magicdata2 = from breedEntry in data
            //                 from challenge in showChallenges
            //                 select new DataForThisInShowReport()
            //                 {
            //                     BreedName = breedEntry.BreedName,
            //                     BreedGroupName = breedEntry.BreedGroupName,
            //                     ShowJudgeName = breedEntry.BreedGroupJudgeName,
            //                     BreedGroupChallengeName = challenge.Name,
            //                     BreedChallengeAbbreviation = challenge.RelatedBreedGroupChallengeName,
            //                     EntryCount = 1
            //                 };

            var magicdata = from breedEntry in data
                            from challenge in showChallenges
                            from position in positions
                            select new DataForThisInShowReport()
            {
                BreedName         = breedEntry.BreedName,
                BreedGroupName    = breedEntry.BreedGroupName,
                ShowJudgeName     = challenge.ChallengeJudgeName,
                ShowChallengeName = challenge.Name,
                BreedGroupChallengeAbbreviation = challenge.RelatedBreedGroupChallengeName,
                EntryCount   = position == "1st" ? 1 : 0,
                PositionText = position,
                JudgingOrder = challenge.JudginOrder
            };

            //var moremagic = magicdata.Where(i => i.BreedName == "Great Dane" && i.BreedChallengeAbbreviation == "BOB");
            //var moremagic2 = magicdata2.Where(i => i.BreedName == "Great Dane" && i.BreedChallengeAbbreviation == "BOB");


            List <IHandlerEntryEntityWithAdditionalData> handleritems = await _handlerEntryService.GetHandlerEntryListAsync <HandlerEntryEntityWithAdditionalData>();

            var handlerdata = handleritems.Where(i => i.ShowId == obj.Id).ToList();

            Dictionary <string, object> datasources = new Dictionary <string, object>();

            datasources.Add("dsMagic", magicdata);


            var ds = new List <IDogShowEntity>();

            ds.Add(obj);
            datasources.Add("DSShowInfo", ds);

            var ds2 = new List <ReportExecutionProperties>();

            ds2.Add(new ReportExecutionProperties()
            {
                Mode = _mode
            });
            datasources.Add("DSExecutionProperties", ds2);

            _reportViewerService.ShowReport(@"Reports\InShowResultsSheet.rdlc", datasources, null);
        }