public async Task <newResponseModel <medicSpecialityDTO> > m_SolicitaMedico(bool?bEsAgendada, int?iIdUsuario, DateTime?dtFechaVencimiento)
        {
            newResponseModel <medicSpecialityDTO> response = new newResponseModel <medicSpecialityDTO>();

            try
            {
                wsConnexion ws = new wsConnexion();
                Settings.sError = "";
                var uri = $"{Settings.sUrl}/Api/Colaborador/Get/Colaborador/ObtenerSala?bEsAgendada={bEsAgendada}&iIdUsuario={iIdUsuario}";
                response = await ws.Get <newResponseModel <medicSpecialityDTO> >(uri);

                try
                {
                    if (response.Code != 0)
                    {
                        throw new Exception("Hubo un error al internar conectarse con el servicio, comuníquese con su proveedor.");
                    }
                }
                catch { throw new Exception("Hubo un error al internar solicitar el chat, favor de reintentar."); }


                Settings.sUIDDR = response.Result.iNumSala;
            }
            catch (Exception e)
            {
                Settings.bClicButton = false;
                Settings.sError      = e.Message;
            }

            return(response);
        }
        public async Task <List <EntDirectorio> > getMedicSpeciality(int?iIdEspecialidad = null, string sBuscador = null)
        {
            List <EntDirectorio> lstSpeciality = new List <EntDirectorio>();

            try
            {
                wsConnexion ws = new wsConnexion();
                Settings.sError = "";
                var uri      = $"{Settings.sUrl}/Api/Colaborador/Get/Directorio/Especialistas/Publico?piIdEspecialidad={iIdEspecialidad}&psBuscador={sBuscador}";
                var response = await ws.Get <newResponseModel <EspecialistasDTO> >(uri);

                if (response.Code != 0)
                {
                    new Exception(response.Message);
                }

                lstSpeciality = response.Result.lstColaboradores;

                lstSpeciality = await ObtenerImagenes(lstSpeciality);
            }
            catch (Exception ex)
            {
            }

            return(lstSpeciality
                   .OrderBy(x => x.sNombre)
                   .ToList());
        }
        public async Task <bool> m_Cambio_Contasena(string sFolio, string sPassword)
        {
            try
            {
                wsConnexion ws = new wsConnexion();
                Settings.sError = "";
                var uri      = $"{Settings.sUrl}/Api/Folio/Update/FolioPassword?sFolio={sFolio}&sPassword={sPassword}";
                var response = await ws.Get <newResponseModel <bool> >(uri);

                try
                {
                    if (response.Code != 0)
                    {
                        throw new Exception("Hubo un error al internar conectarse con el servicio, comuníquese con su proveedor.");
                    }
                }
                catch { throw new Exception("Hubo un error al internar solicitar el cambio de contraseña, favor de reintentar."); }

                if (!response.Result)
                {
                    Settings.sError = response.Message;
                    return(false);
                }

                return(true);
            }
            catch (Exception ex)
            {
                Settings.sError = ex.Message;
                return(false);
            }
        }
        public async Task <List <specialtyDTO> > getSpeciality()
        {
            List <specialtyDTO> lstSpeciality = new List <specialtyDTO>();

            try
            {
                wsConnexion ws = new wsConnexion();
                Settings.sError = "";
                var uri      = $"{Settings.sUrl}/Api/Especialidad/Get/RegistrosFiltrados";
                var response = await ws.Get <newResponseModel <List <specialtyDTO> > >(uri);

                if (response.Code != 0)
                {
                    new Exception(response.Message);
                }

                lstSpeciality = response.Result;
            }
            catch (Exception ex)
            {
            }

            return(lstSpeciality
                   .Where(c => c.iIdEspecialidad != 1)
                   .ToList());
        }
        /// <summary>
        /// get all memberships
        /// </summary>
        /// <returns></returns>
        public async Task <MembershipResponseModel> GetMembership()
        {
            try
            {
                var         uri = $"{Settings.sUrl}/Api/Producto/Get/ObtenerMembresia";
                wsConnexion ws  = new wsConnexion();
                Settings.sError = "";

                var response = await ws.Get <newResponseModel <List <MembershipItemResponse> > >(uri);


                if (response is null)
                {
                    throw new Exception("Hubo un error al internar conectarse con el servicio, comuníquese con su proveedor.");
                }

                if (response.Code != 0)
                {
                    return(MembershipResponseModel.Fail(response.Message));
                }

                return(MembershipResponseModel.Success(response.Result));
            }
            catch (Exception e)
            {
                return(MembershipResponseModel.Fail(e.Message));
            }
        }
        public async Task <bool> m_Acepta_Temino_y_condiciones(string sFolio)
        {
            try
            {
                wsConnexion ws = new wsConnexion();
                Settings.sError = "";
                var uri      = $"{Settings.sUrl}/Api/Folio/Update/TerminosYCondiciones?sFolio=" + sFolio;
                var response = await ws.Get <newResponseModel <bool> >(uri);

                try
                {
                    if (response == null)
                    {
                        throw new Exception("Hubo un error al internar conectarse con el servicio, comuníquese con su proveedor.");
                    }
                }
                catch { throw new Exception("Hubo un error al internar solicitar el cambio de contraseña, favor de reintentar."); }

                if (response.Result)
                {
                    Settings.bTerminoYcondiciones = true;
                    return(true);
                }
                else
                {
                    Settings.sError = response.Message;
                    return(false);
                }
            }
            catch (Exception ex)
            {
                Settings.sError = ex.Message;
                return(false);
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="Coupon"></param>
        /// <returns></returns>
        public async Task <CouponResponseModel> VerifyCoupon(string Coupon)
        {
            wsConnexion ws = new wsConnexion();

            Settings.sError = "";
            var uri = $"{Settings.CouponUrlEndpoint}?psCodigo={Coupon}";

            return(await ws.Get <CouponResponseModel>(uri));
        }
        public async Task <bool> GetPolicies()
        {
            try
            {
                wsConnexion ws = new wsConnexion();
                Settings.sError = "";
                var uri      = $"{Settings.sUrl}/Api/Politicas/Get/Politicas";
                var response = await ws.Get <newResponseModel <PoliciesResponseModel> >(uri);

                if (response.Code != 0)
                {
                    new Exception(response.Message);
                }

                Settings.LinkTermsAndConditions = response is null ?
                                                  string.Empty : response.Result.TermsAndConditionsLink;

                Settings.LinkPrivacity = response is null ?
                                         string.Empty : response.Result.PrivacityLink;

                Settings.ContactEmail             = response.Result.Contact;
                Settings.SupportEmail             = response.Result.Support;
                Settings.CompanyAddress           = response.Result.CompanyAddess;
                Settings.CompanyPhone             = response.Result.CompanyPhone;
                Settings.IVA                      = response.Result.IVA;
                Settings.ThresholdCouponDiscount  = response.Result.MaxDiscount;
                Settings.MonthlyPayments          = JsonConvert.SerializeObject(response.Result.MonthlyPayments);
                Settings.HasMonthsWithoutInterest = response.Result.HasMonthsWithoutInterest;
                Settings.ConektaPublicKey         = response.Result.ConektaPublicKey;
                Settings.IceLinkKey               = response.Result.keyIceLink;
                Settings.IceLinkDomainKey         = response.Result.keyDomainIceLink;
                Settings.IceLinkServers           = JsonConvert.SerializeObject(response.Result.rutasIceServer);

                return(true);
            }
            catch (Exception e)
            {
                return(false);
            }
        }