protected override async Task OnInitializedAsync() { Saved = false; int.TryParse(QuestId, out var questId); int.TryParse(ViewId, out var viewId); Quests = (await QuestDataService.GetAllQuests()).ToList(); if (questId != 0) { IsEdit = true; QuestId = questId.ToString(); } if (viewId == 0) //new quest is being created { //add some defaults View = new ViewForUpdateDto { IsPrivate = false, Age = -1 }; } else { ViewDto = await ViewDataService.GetViewById(questId, viewId, true); View = Mapper.Map <ViewForUpdateDto>(ViewDto); Title = $"Details for {View.Description}"; } if (questId == 0 && Quests?.Count > 0) { QuestId = Quests[0].Id.ToString(); } }
protected override async Task OnInitializedAsync() { Saved = false; int.TryParse(QuestId, out var questId); int.TryParse(DataPointId, out var dataPointId); Quests = (await QuestDataService.GetAllQuests()).ToList(); if (questId == 0 || dataPointId == 0) //new quest is being created { //add some defaults DataPoint = new DataPointForUpdateDto { IsPrivate = false, IsNegative = false, TimeStamp = DateTimeOffset.Now }; } else { DataPointDto = await DataPointDataService.GetDataPointForQuest(questId, dataPointId); QuestId = DataPointDto.QuestId.ToString(); DataPoint = Mapper.Map <DataPointForUpdateDto>(DataPointDto); Title = $"Details for {DataPoint.Description}"; } }
protected override async Task OnInitializedAsync() { Saved = false; int.TryParse(QuestId, out var questId); int.TryParse(DataPointId, out var dataPointId); Quests = (await QuestDataService.GetAllQuests()).ToList(); if (questId != 0) { IsEdit = true; QuestId = questId.ToString(); } if (questId == 0 || dataPointId == 0) //new datapoint is being created { //add some defaults DataPoint = new DataPointForUpdateDto { IsPrivate = false, IsNegative = false, TimeStamp = DateTimeOffset.Now }; if (questId == 0 && Quests?.Count > 0) { QuestId = Quests[0].Id.ToString(); } } else { DataPointDto = await DataPointDataService.GetDataPointForQuest(questId, dataPointId); QuestId = DataPointDto.QuestId.ToString(); DataPoint = Mapper.Map <DataPointForUpdateDto>(DataPointDto); MapMarkers = new List <Marker> { new Marker { Description = $"{DataPoint.Description}", ShowPopup = false, X = DataPoint.Longitude, Y = DataPoint.Latitude, RadiusMeters = DataPoint.RadiusMeters, IsNegative = DataPoint.IsNegative, Certainty = DataPoint.Certainty } }; Title = $"Details for {DataPoint.Description}"; } }
protected override async Task OnInitializedAsync() { Quests = (await QuestDataService.GetAllQuests())?.ToList(); Zones = (await ZoneDataService.GetAllZones())?.ToList(); }