Esempio n. 1
0
        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}";
            }
        }
Esempio n. 2
0
        protected override async Task OnInitializedAsync()
        {
            int.TryParse(QuestId, out var questId);
            int.TryParse(DataPointId, out var dataPointId);

            DataPoint = await DataPointDataService.GetDataPointForQuest(questId, dataPointId);
        }
Esempio n. 3
0
        protected override async Task OnInitializedAsync()
        {
            int.TryParse(QuestId, out var questId);
            int.TryParse(DataPointId, out var dataPointId);

            DataPoint = await DataPointDataService.GetDataPointForQuest(questId, dataPointId);

            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
                }
            };
        }
Esempio n. 4
0
        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}";
            }
        }