예제 #1
0
        public async void AddDataPointDialog_OnDialogClose()
        {
            int.TryParse(QuestId, out var qId);
            MapMarkers = new List <Marker>();

            if (qId != 0)
            {
                var quest = await QuestDataService.GetQuestDetails(qId);

                DataPoints = quest.DataPoints;
                foreach (var dataPoint in DataPoints)
                {
                    MapMarkers.Add(
                        new Marker
                    {
                        Description  = $"{dataPoint.Description}",
                        ShowPopup    = false,
                        X            = dataPoint.Longitude,
                        Y            = dataPoint.Latitude,
                        IsNegative   = dataPoint.IsNegative,
                        RadiusMeters = dataPoint.RadiusMeters,
                        Certainty    = dataPoint.Certainty
                    });
                }
            }
            StateHasChanged();
        }
예제 #2
0
        protected override async Task OnInitializedAsync()
        {
            Saved = false;
            int.TryParse(QuestId, out var questId);

            if (questId == 0) //new quest is being created
            {
                //add some defaults
                Quest = new QuestForUpdateDto
                {
                    IsPrivate = false,
                    ZoneId    = 1
                };
            }
            else
            {
                QuestDp = await QuestDataService.GetQuestDetails(questId);

                DataPoints = QuestDp.DataPoints;

                Quest            = Mapper.Map <QuestForUpdateDto>(QuestDp);
                Quest.DataPoints = Mapper.Map <IEnumerable <DataPointForCreationDto> >(QuestDp.DataPoints).ToList();
                Title            = $"Details for {Quest.Description}";
                Views            = new List <ViewDto>(await ViewDataService.GetAllViews(questId));
            }


            Zones  = (await ZoneDataService.GetAllZones()).ToList();
            ZoneId = Quest.ZoneId.ToString();
        }
예제 #3
0
        protected override async Task OnInitializedAsync()
        {
            int.TryParse(QuestId, out var questId);

            Quest = await QuestDataService.GetQuestDetails(questId);

            Views = new List <ViewDto>(await ViewDataService.GetAllViews(questId));
        }
예제 #4
0
        protected override async Task OnInitializedAsync()
        {
            Saved = false;
            int.TryParse(QuestId, out var questId);
            MapMarkers = new List <Marker>();

            if (questId == 0) //new quest is being created
            {
                //add some defaults
                Quest = new QuestForUpdateDto
                {
                    IsPrivate = false,
                    ZoneId    = -1
                };
            }
            else
            {
                QuestDp = await QuestDataService.GetQuestDetails(questId);

                DataPoints = QuestDp.DataPoints;

                Quest            = Mapper.Map <QuestForUpdateDto>(QuestDp);
                Quest.DataPoints = Mapper.Map <IEnumerable <DataPointForCreationDto> >(QuestDp.DataPoints).ToList();
                Title            = $"Details for {Quest.Description}";
                Views            = new List <ViewDto>(await ViewDataService.GetAllViews(questId));
                foreach (var dataPoint in Quest.DataPoints)
                {
                    MapMarkers.Add(
                        new Marker
                    {
                        Description  = $"{dataPoint.Description}",
                        ShowPopup    = false,
                        X            = dataPoint.Longitude,
                        Y            = dataPoint.Latitude,
                        RadiusMeters = dataPoint.RadiusMeters,
                        IsNegative   = dataPoint.IsNegative,
                        Certainty    = dataPoint.Certainty
                    });
                }
            }

            Zones  = (await ZoneDataService.GetAllZones()).ToList();
            ZoneId = Quest?.ZoneId.ToString();
        }
예제 #5
0
        protected override async Task OnInitializedAsync()
        {
            int.TryParse(QuestId, out var questId);

            Quest = await QuestDataService.GetQuestDetails(questId);

            Views      = new List <ViewDto>(await ViewDataService.GetAllViews(questId));
            MapMarkers = new List <Marker>();
            foreach (var dataPoint in Quest?.DataPoints)
            {
                MapMarkers.Add(
                    new Marker
                {
                    Description  = $"{dataPoint.Description}",
                    ShowPopup    = false,
                    X            = dataPoint.Longitude,
                    Y            = dataPoint.Latitude,
                    RadiusMeters = dataPoint.RadiusMeters,
                    IsNegative   = dataPoint.IsNegative,
                    Certainty    = dataPoint.Certainty
                });
            }
        }