private async void ExecuteCommand(IDogShowEntity obj) { 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("DSHandlerEntriesForShow", handlerdata); 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\HandlerResultsSheet.rdlc", datasources, null); }
public Task UpdateEntityAsync(IDogShowEntity entity) { Task t = Task <int> .Run(() => { UpdateEntity(entity); }); return(t); }
public Task <int> CreateEntityAsync(IDogShowEntity entity) { Task <int> t = Task <int> .Run(() => { int newid = CreateEntity(entity); return(newid); }); return(t); }
private void UpdateEntity(IDogShowEntity entity) { using (var ctx = new HappyDogShowContext()) { DogShow foundEntity = ctx.DogShows.Where(d => d.ID == entity.Id).First(); if (foundEntity != null) { foundEntity.Name = entity.DogShowName; foundEntity.ShowDate = entity.ShowDate; ctx.SaveChanges(); } } }
private async void ExecuteCommand(IDogShowEntity obj) { List <IBreedEntryEntityWithAdditionalData> items = await _breedEntryService.GetBreedEntryListAsync <BreedEntryEntityWithAdditionalData>(); var data = items.Where(i => i.ShowId == obj.Id).ToList(); Dictionary <string, object> datasources = new Dictionary <string, object>(); datasources.Add("DSBreedEntriesForShow", data); Dictionary <string, string> parms = new Dictionary <string, string>(); parms.Add("parmClubName", ReportConstants.CLUB_NAME); parms.Add("parmDogShowName", obj.DogShowName); parms.Add("parmDogShowDate", obj.ShowDate.ToString("yyyy-MM-dd")); _reportViewerService.ShowReport(@"Reports\BreedBreakdownForShow.rdlc", datasources, parms); }
private int CreateEntity(IDogShowEntity entity) { int newid = -1; using (var ctx = new HappyDogShowContext()) { DogShow newEntity = new DogShow() { ID = entity.Id, Name = entity.DogShowName, ShowDate = entity.ShowDate }; ctx.DogShows.Add(newEntity); ctx.SaveChanges(); newid = newEntity.ID; } return(newid); }
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); }
public override void GetValuesFromNavigationParameters(NavigationContext navigationContext) { SelectedDogShow = navigationContext.Parameters["entity"] as IDogShowEntity; }
private async void ExecuteCommand(IDogShowEntity obj) { List <IBreedEntryEntityWithAdditionalData> items = await _breedEntryService.GetBreedEntryListAsync <BreedEntryEntityWithAdditionalData>(); var data = items.Where(i => i.ShowId == obj.Id).ToList(); List <IBreedEntryClassEntry> classEntryItems = await _breedEntryService.GetBreedEntryClassEntryListAsync <BreedEntryClassEntry>(); var classEntryData = classEntryItems.Where(i => i.ShowId == obj.Id).ToList(); var rankeddata = classEntryData.GroupBy(d => d.ReportGroupingKey) .SelectMany(g => g.OrderBy(y => y.ReportSortingKey) .Select((x, i) => new { g.Key, Item = x, Rank = i + 1 })); foreach (var i in rankeddata) { i.Item.ReportingRank = i.Rank; } var tempData = from c in classEntryData select new { TempShowName = c.ShowName, TempBreedGroupName = c.BreedGroupName, TempBreedName = c.BreedName }; var moreTempData = tempData.Distinct().ToList(); List <IBreedChallengeEntity> breedChallenges = await _breedChallengeService.GetListAsync <BreedChallengeEntity>(); foreach (IBreedChallengeEntity breedChallenge in breedChallenges) { foreach (var tempydatay in moreTempData) { classEntryData.Add(new BreedEntryClassEntry() { ShowName = tempydatay.TempShowName, BreedGroupName = tempydatay.TempBreedGroupName, BreedName = tempydatay.TempBreedName, GenderName = "ALL", EntryNumber = "", EnteredClassName = breedChallenge.Name, JudgingOrder = breedChallenge.JudginOrder }); } } 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); 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\ResultsSheet.rdlc", datasources, null); }