private async void ValidateResponseDepartments(ResponseDepartments response)
        {
            Departaments = new ObservableCollection <Departament>();

            if (await validatorService.ValidateResponse(response) == false)
            {
                return;
            }

            Departaments = new ObservableCollection <Departament>(response.Departaments);
        }
        private async void ValidateResponseServiceChatAgent(ResponseServiceChatAgent response)
        {
            if (await validatorService.ValidateResponse(response) == false)
            {
                return;
            }

            string url = string.Format("{0}?name={1}", response.ChatAgent.UrlChatApp, string.Format("{0}({1}-{2})", loginViewModel.User.NameOne, loginViewModel.User.DocumentTypeName, loginViewModel.User.Document));

            if (string.IsNullOrEmpty(loginViewModel.User.UserName) == false)
            {
                url += string.Format("&email={0}", loginViewModel.User.UserName);
            }

            if (string.IsNullOrEmpty(loginViewModel.User.CellPhone) == false)
            {
                url += string.Format("&phone={0}", loginViewModel.User.CellPhone);
            }

            url += $"&urlService={AppConfigurations.UrlBaseMiddleware}/{AppConfigurations.ServicesController}/{AppConfigurations.ServiceChatAgent}";
            url += $"&urlServiceApiKey={AppConfigurations.Subscriptionkey}";
            url += $"&serviceType={(int)ServiceType.Other}";
            url += $"&environment={AppConfigurations.Environment}";

            byte[] utf8bytes = Encoding.UTF8.GetBytes(url);
            string r         = Encoding.UTF8.GetString(utf8bytes, 0, utf8bytes.Length);

            HtmlSource.Url = r;
        }
        private async Task <bool> ValidateResponseAffiliate(ResponseAffiliate response)
        {
            if (await validatorService.ValidateResponse(response) == false)
            {
                return(false);
            }

            ViewModelHelper.SetAffiliateToPersonalDataViewModel(this, response.PersonalData);
            return(true);
        }
예제 #4
0
        private async void ValidateResponseInvoiceDetail(ResponseInvoiceDetail response)
        {
            if (await validatorService.ValidateResponse(response) == false)
            {
                await navigationService.Back();

                return;
            }

            InvoiceNumber  = string.Format("{0} - {1}", response.DetailInvoicesResponse.Series, response.DetailInvoicesResponse.Number);
            GeneratedDate  = response.DetailInvoicesResponse.GeneratedDate;
            ExpirationDate = response.DetailInvoicesResponse.ExpirationDate;
            Amount         = response.DetailInvoicesResponse.State == PaymentState.Impaga.ToString() ? response.DetailInvoicesResponse.InvoiceBalance : response.DetailInvoicesResponse.Importe;
            LoadBeneficiaries(response);
            State                  = response.DetailInvoicesResponse.State;
            Paymentmode            = response.DetailInvoicesResponse.Paymentmode == PaymentMode.Debito.ToString() ? "Débito" : response.DetailInvoicesResponse.Paymentmode;
            CompanyPayment         = response.DetailInvoicesResponse.CompanyPayment;
            AddressCharge          = response.DetailInvoicesResponse.AddressCharge;
            IsVisibleAddressCharge = response.DetailInvoicesResponse.Paymentmode == PaymentMode.Domicilio.ToString();
            BankCardPayment        = response.DetailInvoicesResponse.BankCardPayment;
            IsVisibleCompany       = response.DetailInvoicesResponse.Paymentmode == PaymentMode.Convenio.ToString();
            IsVisibleBank          = response.DetailInvoicesResponse.Paymentmode == PaymentMode.Debito.ToString();
            IsVisibleButtonPagar   = response.DetailInvoicesResponse.State == PaymentState.Impaga.ToString();
            AmountTitle            = response.DetailInvoicesResponse.State == PaymentState.Impaga.ToString() ? "Saldo:" : "Importe:";
            HeightRequestList      = (80 * response.DetailInvoicesResponse.BeneficiaryAndProduct.Count) + (10 * response.DetailInvoicesResponse.BeneficiaryAndProduct.Count);

            switch (response.DetailInvoicesResponse.Paymentmode.ToString())
            {
            case "Debito":
                IconPaymentMethod = "ic_credit_card.png";
                break;

            case "Domicilio":
                IconPaymentMethod = "domain.png";
                break;

            default:
                IconPaymentMethod = "Group_23.png";
                break;
            }
        }
        private async void ValidateResponseGetPersons(ResponseBeneficiaries response)
        {
            People           = new ObservableCollection <PersonViewModel>();
            ServicesEnableds = new ObservableCollection <ServicesEnabledViewModel>();
            if (await validatorService.ValidateResponse(response) == false)
            {
                return;
            }

            foreach (var person in response.Beneficiaries)
            {
                PersonViewModel personViewModel = new PersonViewModel();
                ViewModelHelper.SetPersonToPersonViewModel(personViewModel, person);
                People.Add(personViewModel);
            }
        }
        private async void ValidateResponseServiceQualify(ResponseServiceQualify response)
        {
            Questions = new ObservableCollection <QuestionViewModel>();

            if (await validatorService.ValidateResponse(response) == false)
            {
                await navigationService.BackToRoot();

                return;
            }

            ServiceName = response.ServiceQualify.ServiceName;
            foreach (Question item in response.ServiceQualify.Questions)
            {
                QuestionViewModel questionViewModel = new QuestionViewModel();
                ViewModelHelper.SetQuestionToQuestionViewModel(questionViewModel, item);
                Questions.Add(questionViewModel);
            }
        }
        public async Task LoadData()
        {
            dialogService.ShowProgress();

            RequestMinorAuthorizations requestMinor = new RequestMinorAuthorizations
            {
                DocumentType = loginViewModel.User.DocumentType,
                Document     = loginViewModel.User.Document
            };

            Minors.Clear();

            ResponseMinorAuthorizations responseMinor = await apiService.GetMinorAuthorizations(requestMinor);

            dialogService.HideProgress();

            if (await validatorService.ValidateResponse(responseMinor) == false)
            {
                await navigationService.Back();

                return;
            }

            dialogService.ShowProgress();

            MinorSelected = new Minor
            {
                Document     = loginViewModel.User.Document,
                DocumentType = loginViewModel.User.DocumentType,
                NameOne      = loginViewModel.User.NameOne,
                NameTwo      = loginViewModel.User.NameTwo,
                LastNameOne  = loginViewModel.User.LastNameOne,
                LastNameTwo  = loginViewModel.User.LastNameTwo
            };

            IsVisiblePatient = SetUserAutenticated = responseMinor.Minors != null && responseMinor.Minors.Where(x => x.Status.Equals("1")).ToList().Count > 0;

            if (IsVisiblePatient)
            {
                Minors.Add(MinorSelected);

                foreach (Minor minor in responseMinor.Minors)
                {
                    if (minor.Status == "1")
                    {
                        Minors.Add(minor);
                    }
                }
            }

            RequestServicesHistoryLists request = new RequestServicesHistoryLists
            {
                Document     = loginViewModel.User.Document,
                DocumentType = loginViewModel.User.DocumentType
            };

            ResponseServicesHistoryLists response = await apiService.GetServicesHistoryLists(request);

            ValidateResponseServicesHistoryLists(response);
            dialogService.HideProgress();
        }