public async override void Prepare()
        {
            DogShowList = await _dogShowService.GetDogShowListAsync <DogShowDetail>();

            BreedGroupList = await _breedGroupService.GetListAsync <BreedGroupDetail>();

            ChallengeList = await _breedGroupChallengeService.GetListAsync <BreedGroupChallengeEntity>();

            ChallengeResults = new ChallengeResultCollection <IChallengeResult>();

            CurrentEntity = ChallengeResults as ValidatableBindableBase;
        }
Exemplo n.º 2
0
        private async void ExecuteCommand(IDogShowEntity obj)
        {
            List <IBreedEntryEntityWithAdditionalData> items = await _breedEntryService.GetBreedEntryListAsync <BreedEntryEntityWithAdditionalData>();

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

            List <IBreedGroupChallengeEntity> breedGroupChallenges = await _breedGroupChallengeService.GetListAsync <BreedGroupChallengeEntity>();

            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 magicdata = from breedgroup in listOfGroups
            //                 from challenge in breedGroupChallenges
            //                 from position in positions
            //                 select new DataForThisReport()
            //                 {
            //                     BreedGroupName = breedgroup,
            //                     BreedGroupChallengeName = challenge.Name,
            //                     PositionText = position
            //                 };

            var magicdata2 = from breedEntry in data
                             from challenge in breedGroupChallenges
                             select new DataForThisReport()
            {
                BreedName                  = breedEntry.BreedName,
                BreedGroupName             = breedEntry.BreedGroupName,
                BreedGroupJudgeName        = breedEntry.BreedGroupJudgeName,
                BreedGroupChallengeName    = challenge.Name,
                BreedChallengeAbbreviation = challenge.RelatedBreedChallengeName,
                EntryCount                 = 1
            };

            var magicdata = from breedEntry in data
                            from challenge in breedGroupChallenges
                            from position in positions
                            select new DataForThisReport()
            {
                BreedName                  = breedEntry.BreedName,
                BreedGroupName             = breedEntry.BreedGroupName,
                BreedGroupJudgeName        = breedEntry.BreedGroupJudgeName,
                BreedGroupChallengeName    = challenge.Name,
                BreedChallengeAbbreviation = challenge.RelatedBreedChallengeName,
                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("DSBreedEntriesForShow", data);
            //datasources.Add("DSHandlerEntriesForShow", handlerdata);
            //datasources.Add("DSBreedEntryClassEntriesForShow", classEntryData);
            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);

            //Dictionary<string, string> parms = new Dictionary<string, string>();
            //parms.Add("parmClubName", "Overberg Kennel Club");
            //parms.Add("parmDogShowName", obj.DogShowName);
            //parms.Add("parmDogShowDate", obj.ShowDate.ToString("yyyy-MM-dd"));


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