Example #1
0
        private async void DoRefreshQueriesAsync(object obj)
        {
            Loading = true;
            try
            {
                ClearQuery.Execute(this);
                Queries = new ObservableCollection <QueryVM>();
                var result = await RestHub.MyQueries();

                if (result.UserObject != null)
                {
                    MyQueriesDTO    myQueriesDto = (MyQueriesDTO)result.UserObject;
                    List <QueryDTO> dtos         = myQueriesDto.Queries;
                    foreach (var dto in dtos)
                    {
                        Queries.Add(new QueryVM
                        {
                            Id           = dto.Id,
                            TanId        = dto.TanId,
                            DocumentPath = dto.DocumentPath,
                            TanNumber    = dto.TanNumber,
                            Comment      = dto.Comment,
                            Page         = dto.Page,
                            QueryType    = dto.QueryType,
                            Title        = dto.Title
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                AppErrorBox.ShowErrorMessage("Error while loading Queries", ex.ToString());
            }
            Loading = false;
        }