public string RefrescarToken()
        {
            try
            {
                Settings values  = new Settings();
                var      request = new RestRequest("/token", Method.POST);
                var      client  = new RestClient();
                //  client = new RestClient(idp_uriTest);
                client.BaseUrl = new Uri(values.IdP_Uri);
                // agregar parametros del form
                request.AddParameter("grant_type", "refresh_token");
                request.AddParameter("client_id", values.IdP_Client_Id);
                request.AddParameter("refresh_token", SessionToken.refresh_token);

                // HTTP Headers
                request.AddHeader("Accept", "application/json");
                // execute the request
                IRestResponse response = client.Execute(request);
                SessionToken = JsonConvert.DeserializeObject <Token>(response.Content);
                return(null);
            }
            catch (Exception _ex)
            {
                Errores = new ManejoErrores();
                Errores.RegistrarErrorLog((int)ModuloSistema.MantenimientoFacturaElectronica, _ex.Message, _ex.Source + " : " + _ex.InnerException.Message);
                return(null);
            }
        }
 public MantenimientoPersona()
 {
     Inicializador.Init();
     sujeto            = DependencyInjector.Retrieve <GenericRepository <Persona> >();
     log               = new ManejoErrores();
     globalVar_Persona = new Persona();
 }
 public string DesconectarTokenIdP()
 {
     try
     {
         Settings values  = new Settings();
         var      request = new RestRequest("/logout", Method.POST);
         var      client  = new RestClient();
         client.BaseUrl = new Uri(values.IdP_Uri);
         // agregar parametros del form
         request.AddParameter("client_id", values.IdP_Client_Id);
         request.AddParameter("refresh_token", SessionToken.refresh_token);
         // HTTP Headers
         request.AddHeader("Accept", "application/json");
         request.AddHeader("Authorization", "Bearer " + SessionToken.access_token);
         // execute the request
         IRestResponse response      = client.Execute(request);
         var           eventResponse = response.Content;
         // var content = response.Content; // raw content as string
         return(eventResponse);
     }
     catch (Exception _ex)
     {
         Errores = new ManejoErrores();
         Errores.RegistrarErrorLog((int)ModuloSistema.MantenimientoFacturaElectronica, _ex.Message, _ex.Source + " : " + _ex.InnerException.Message);
         return(null);
     }
 }
 public AdministrarFacturacion()
 {
     Inicializador.Init();
     encabezadoFactura  = DependencyInjector.Retrieve <GenericRepository <EncabezadoFactura> >();
     detalleFactura     = DependencyInjector.Retrieve <GenericRepository <DetalleFactura> >();
     sujeto             = DependencyInjector.Retrieve <GenericRepository <Persona> >();
     tipoPago           = DependencyInjector.Retrieve <GenericRepository <TipoPago> >();
     tipoCondicionVenta = DependencyInjector.Retrieve <GenericRepository <TipoCondicionVenta> >();
     producto           = DependencyInjector.Retrieve <GenericRepository <Producto> >();
     impuestos          = DependencyInjector.Retrieve <GenericRepository <TipoImpuestos> >();
     exoneracion        = DependencyInjector.Retrieve <GenericRepository <TipoExoneraciones> >();
     facturaElectronica = DependencyInjector.Retrieve <GenericRepository <ServicioFacturaElectronica> >();
     log = new ManejoErrores();
     globalVar_EncabezadoFactura = new EncabezadoFactura();
     globalVar_DetalleFactura    = new DetalleFactura();
 }
 public MantenimientoFacturaElectronica()
 {
     Inicializador.Init();
     facturaElectronica = DependencyInjector.Retrieve <GenericRepository <ServicioFacturaElectronica> >();
     log = new ManejoErrores();
 }