Ejemplo n.º 1
0
        public async Task ReloadData()
        {
            _DataSource.Clear();
            HideAll();
            ICPFeeds Service  = DependencyService.Get <ICPFeeds>();
            var      response = await Service.m_GetCOVIDSurvey();

            if (response.Count() > 0)
            {
                foreach (SurveyAsk item in response)
                {
                    item.TypeField = TYPE_FIELD.CHECKBOX;
                    _DataSource.Add(item: item);
                }

                String phoneValue = "";
                if (!string.IsNullOrEmpty(Settings.sUserNameLogin))
                {
                    List <string> split_login = Settings.sUserNameLogin
                                                .Split("_")
                                                .ToList();

                    if (split_login.Count() > 1)
                    {
                        phoneValue = split_login[1];
                    }
                }

                _DataSource.Add(SurveyAsk.BuildTextField("telefono", phoneValue, "Teléfono", true));
                _DataSource.Add(SurveyAsk.BuildTextField("cp", "", "Código postal", true));

                ShowDataButton();
                return;
            }
            ShowDataError();
        }