private async void Init()
        {
            StatusQuestions = new ObservableCollection <StatusQuestionsCardModel>();
            BackToManagerQuestionsCommand = new RelayCommand(() => PopPushViewUtil.PopNavModalAsync <StatusSuggestionsView>(true));

            using IMaterialModalPage dialog = await MaterialDialog.Instance.LoadingDialogAsync("Recolhendo informaçoes...");

            IRestResponse response = await ManagerQuestionsService.StatusQuestionsTaskAsync();

            if (response.StatusCode == HttpStatusCode.OK)
            {
                (await DeselializeAsync(response)).ForEach(question =>
                {
                    StatusQuestions.Add(new StatusQuestionsCardModel
                    {
                        Question          = question,
                        ViewStatusCommand = new RelayCommand <IQuestion>(ViewStatus)
                    });
                });
            }
            else
            {
                await MaterialDialog.Instance.AlertAsync("Algo de errado nao está certo", "Ops");
            }
        }
Esempio n. 2
0
        public void InitializeTests()
        {
            this.db = MockDbContext.GetTestDb();

            var question = new Question()
            {
                Id         = 1,
                AuthorName = "Pesho",
                EventId    = 1
            };

            this.db.Questions.Add(question);

            this.db.SaveChanges();

            this.service = new ManagerQuestionsService(this.db, null);
        }
Esempio n. 3
0
        public void InitializeTests()
        {
            this.db     = MockDbContext.GetTestDb();
            this.mapper = MockAutoMapper.GetAutoMapper();

            var question = new Question()
            {
                Id         = 1,
                AuthorName = "Pesho",
                EventId    = 1,
                IsArchived = true
            };

            this.db.Questions.Add(question);

            this.db.SaveChanges();

            this.service = new ManagerQuestionsService(this.db, this.mapper);
        }