Esempio n. 1
0
        private async Task LoadCategories(IOutcomeReportCategoryServiceProvider categoryServiceProvider)
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            using (var categoryService = categoryServiceProvider.GetService())
            {
                var response = await categoryService.GetAllAsync(new GetAllCategoriesRequest());

                if (ReferenceEquals(response.Exception, null))
                {
                    foreach (var ct in response.Categories)
                    {
                        Categories.Add(ct);
                    }
                }
                else
                {
                    Debug.WriteLine(response.Exception.Message);
                }
            }

            IsBusy = false;
        }
Esempio n. 2
0
        private async Task AddCategoryInternl(IOutcomeReportCategoryServiceProvider provider, string item)
        {
            using (var service = provider.GetService())
            {
                var categoriesResponse = await service.CreateCategoryAsync(new CreateCategoriesRequest(item));

                if (ReferenceEquals(categoriesResponse.Exception, null) == false)
                {
                    Debug.WriteLine(categoriesResponse.Exception);
                }
            }

            await LoadDate(provider);
        }
        private async Task LoadCategories(IOutcomeReportCategoryServiceProvider categoryServiceProvider)
        {
            using (var categoryService = categoryServiceProvider.GetService())
            {
                var response = await categoryService.GetAllAsync(new GetAllCategoriesRequest());

                if (ReferenceEquals(response.Exception, null))
                {
                    foreach (var c in response.Categories)
                    {
                        Categories.Add(c);
                    }
                }
                else
                {
                    Debug.WriteLine(response.Exception);
                }
            }
        }
Esempio n. 4
0
        private async Task LoadDate(IOutcomeReportCategoryServiceProvider provider)
        {
            using (var service = provider.GetService())
            {
                var categoriesResponse = await service.GetAllAsync(new ApplicationService.GetAllCategoriesRequest());

                if (ReferenceEquals(categoriesResponse.Exception, null))
                {
                    Categories.Clear();

                    foreach (var cat in categoriesResponse.Categories)
                    {
                        Categories.Add(cat);
                    }
                }
                else
                {
                    Debug.WriteLine(categoriesResponse.Exception);
                }
            }
        }