/// <summary>
        /// Trae todos los datos de los clientes
        /// </summary>
        /// <returns>Data Table con los datos de los clientes</returns>
        public ListParametro GetManyParametro(String tipoParametro)
        {
            ListParametro listParametro;

            try
            {
                var       conector  = new ConectorParametro();
                DataTable dtCliente = conector.GetManyParametro(tipoParametro);
                listParametro = new ListParametro {
                    success = true, message = String.Empty
                };
                listParametro.listParametro = new List <Parametro>();
                foreach (DataRow row in dtCliente.Rows)
                {
                    var item = new Parametro();
                    item.parametroId         = Convert.ToInt32(row["PARAMETRO_ID_IN"]);
                    item.parametroCodigo     = Convert.ToInt32(row["PARAMETRO_CODIGO_IN"]);
                    item.tipoParametro       = Convert.ToString(row["TIPO_PARAMETRO_NV"]);
                    item.valorParametroCorto = Convert.ToString(row["VALOR_DE_CORTO_NV"]);
                    item.valorParametro      = Convert.ToString(row["VALOR_DES_LARGA_NV"]);
                    listParametro.listParametro.Add(item);
                }
            }
            catch (Exception ex)
            {
                listParametro = new ListParametro {
                    success = false, message = ex.Message
                };
                TextLogger.LogError(LogManager.GetCurrentClassLogger(), ex, "Error En el metodo: getManyParametro");
            }
            return(listParametro);
        }
Exemple #2
0
        /// <summary>
        /// Inserta nuevo cajero automatico
        /// </summary>
        /// <param name="cajerAutomatico">entidad cajero automatico</param>
        /// <returns>devuelve un booleano true o false</returns>
        public Boolean InsertCajeroAutomatico(CajerAutomatico cajerAutomatico)
        {
            Boolean resultado;

            try
            {
                var spInsertCajero = new StoreProcedure("[dbo].[SP_CAJERO_AUTOMATICO_INSERT]");
                spInsertCajero.AddParameter("@NOMBRE_NV", cajerAutomatico.Nombre, DirectionValues.Input);
                spInsertCajero.AddParameter("@TIPO_PUNTO_ID_IN", cajerAutomatico.TipoPuntoId, DirectionValues.Input);
                spInsertCajero.AddParameter("@DEPARTAMENTO_ID_IN", cajerAutomatico.DepartamentoId, DirectionValues.Input);
                spInsertCajero.AddParameter("@LATITUD_DC", cajerAutomatico.Latitud, DirectionValues.Input);
                spInsertCajero.AddParameter("@LONGITUD_DC", cajerAutomatico.Longitud, DirectionValues.Input);
                spInsertCajero.AddParameter("@DIRECCION_NV", cajerAutomatico.Direccion, DirectionValues.Input);
                spInsertCajero.AddParameter("@FLAG_MINUSVALIDO", cajerAutomatico.FlagMinusvalido, DirectionValues.Input);
                spInsertCajero.AddParameter("@MONEDA_ID_IN", cajerAutomatico.MonedaId, DirectionValues.Input);
                resultado = spInsertCajero.ExecuteStoredProcedure(ConexionString);
                if (spInsertCajero.ErrorMessage != String.Empty)
                {
                    throw new Exception("Procedimiento Almacenado :[dbo].[SP_CAJERO_AUTOMATICO_INSERT] Descripcion:" + spInsertCajero.ErrorMessage.Trim());
                }
            }
            catch (Exception ex)
            {
                TextLogger.LogError(LogManager.GetCurrentClassLogger(), ex, "Error En el metodo: InsertCajeroAutomatico");
                throw new Exception("Procedimiento Almacenado :[dbo].[SP_CAJERO_AUTOMATICO_INSERT]" + ex);
            }
            return(resultado);
        }
Exemple #3
0
        public Boolean InsertPunto(Punto punto)
        {
            Boolean resultado;

            try
            {
                string conexionString = Conexion.ConexionGmaps();
                var    storeProcedure = new StoreProcedure("[dbo].[SP_PUNTO_INSERT]");
                storeProcedure.AddParameter("@NOMBRE_NV", punto.Nombre, DirectionValues.Input);
                storeProcedure.AddParameter("@TIPO_PUNTO_ID_IN", punto.TipoPuntoId, DirectionValues.Input);
                storeProcedure.AddParameter("@DEPARTAMENTO_ID_IN", punto.DepartamentoId, DirectionValues.Input);
                storeProcedure.AddParameter("@LATITUD_DC", punto.Latitud, DirectionValues.Input);
                storeProcedure.AddParameter("@LONGITUD_DC", punto.Longitud, DirectionValues.Input);
                storeProcedure.AddParameter("@DIRECCION_NV", punto.Direccion, DirectionValues.Input);
                resultado = storeProcedure.ExecuteStoredProcedure(conexionString);
                if (storeProcedure.ErrorMessage != String.Empty)
                {
                    throw new Exception("Procedimiento Almacenado :[dbo].[SP_PUNTO_INSERT] Descripcion:" + storeProcedure.ErrorMessage.Trim());
                }
            }
            catch (Exception ex)
            {
                TextLogger.LogError(LogManager.GetCurrentClassLogger(), ex, "Error En el metodo: InsertDireccionCliente");
                throw new Exception("Procedimiento Almacenado :[dbo].[SP_PUNTO_INSERT]" + ex);
            }
            return(resultado);
        }
Exemple #4
0
        public void RunProcedure(VerbRenderOpts opts)
        {
            string docPath = Path.GetFullPath(opts.entryFile);

            logger.LogInfo($"Start rendering...");
            AssemblyInjectionManager injectionManager = new AssemblyInjectionManager();

            injectionManager.RegisterAssembly("PonyTextRenderer.Pdf", Assembly.GetAssembly(typeof(PdfRenderer)));
            injectionManager.RegisterAssembly("PonyText.Processor", Assembly.GetAssembly(typeof(PonyTextFactory)));

            IProcessorFactory processor         = new ProcessorFactory(injectionManager);
            SimpleTextContext simpleTextContext = new SimpleTextContext(processor);

            processor.LoadProcessorFrom("PonyText.Processor");

            PonyTextStructureBase structureBase = PonyTextFactory.CreateEvaluable(docPath, simpleTextContext);

            try{
                structureBase.Evaluate(simpleTextContext);

                PdfRenderer pdfRenderer = new PdfRenderer(simpleTextContext);
                simpleTextContext.GetCurrentContext().Render(pdfRenderer, simpleTextContext);

                using (FileStream fs = new FileStream(opts.outputFile, FileMode.Create)) {
                    pdfRenderer.RenderContentTo(fs);
                }
                logger.LogInfo($"Exported to {opts.outputFile}");
            }
            catch (Exception e) {
                logger.LogError(e.Message);
                if (e is PreProcessorException)
                {
                    PreProcessorException ppe = e as PreProcessorException;
                    foreach (var item in ppe.GetPonyTextStackTrace())
                    {
                        logger.LogError(item);
                    }
                }
                logger.LogError($"Error in file {docPath}");
                logger.LogDebug(e.StackTrace);
            }
        }
Exemple #5
0
 protected static string ValueToDbStr(Type dataType, object value)
 {
     if (dataType == typeof(string))
     {
         return("'" + (value == null ? "" : value.ToString()) + "'");
     }
     if (dataType == typeof(UInt32) || dataType == typeof(double) || dataType == typeof(int))
     {
         return(value.ToString());
     }
     if (dataType == typeof(DateTime))
     {
         return("'" + (value == null ? "1970-01-01 00:00:00" :
                       ((DateTime)value).ToString("yyyy-MM-dd HH:mm:ss")) + "'");
     }
     TextLogger.LogError("not found datatype:" + dataType);
     return("");
 }
 /// <summary>
 /// Adiciona nuevos cajeros y agencias
 /// </summary>
 /// <param name="agenteAgencia"></param>
 /// <returns></returns>
 public Resultado AddAgenteAgencia(AgenteAgencia agenteAgencia)
 {
     try
     {
         var conector = new ConectorAgenteAgencia();
         return((!conector.InsertAgenteAgencia(agenteAgencia)) ? new Resultado {
             success = false, message = "Existio un error al realizar la insercion"
         } : new Resultado {
             success = true, message = "Se inserto Correctamente"
         });
     }
     catch (Exception ex)
     {
         TextLogger.LogError(LogManager.GetCurrentClassLogger(), ex, "Error En el metodo: AddAgenteAgencia");
         return(new Resultado {
             success = false, message = "Existio un error tecnico al realizar la insercion de la Agencia o Agente"
         });
     }
 }
Exemple #7
0
 /// <summary>
 /// Adiciona Nuevos
 /// </summary>
 /// <returns>True si fue exitoso y False si no se pudo insertar</returns>
 public Resultado AddPunto(Punto punto)
 {
     try
     {
         var conector = new ConectorPuntos();
         return((!conector.InsertPunto(punto)) ? new Resultado {
             success = false, message = "Existio un error al realizar la insercion"
         } : new Resultado {
             success = true, message = "Se inserto Correctamente"
         });
     }
     catch (Exception ex)
     {
         TextLogger.LogError(LogManager.GetCurrentClassLogger(), ex, "Error En el metodo: InsertDireccionCliente");
         return(new Resultado {
             success = false, message = "Existio un error tecnico al realizar la insercion del punto"
         });
     }
 }
 /// <summary>
 /// Adiciona Nuevos cajeros automaticos
 /// </summary>
 /// <returns>True si fue exitoso y False si no se pudo insertar</returns>
 public Resultado AddCajero(CajerAutomatico cajerAutomatico)
 {
     try
     {
         var conector = new ConectorCajeroAutomatico();
         return((!conector.InsertCajeroAutomatico(cajerAutomatico)) ? new Resultado {
             success = false, message = "Existio un error al realizar la insercion"
         } : new Resultado {
             success = true, message = "Se inserto Correctamente"
         });
     }
     catch (Exception ex)
     {
         TextLogger.LogError(LogManager.GetCurrentClassLogger(), ex, "Error En el metodo: AddPunto");
         return(new Resultado {
             success = false, message = "Existio un error tecnico al realizar la insercion del cajero automatico"
         });
     }
 }
Exemple #9
0
        /// <summary>
        /// Inserta nueva Agencia o Agente
        /// </summary>
        /// <param name="agenteAgencia">objeto Agencia Agente</param>
        /// <returns>True si es exitoso la incersion y false si es fallida</returns>
        public Boolean InsertAgenteAgencia(AgenteAgencia agenteAgencia)
        {
            var transaction = new Transaction();

            try
            {
                var spInsertAgenAgencia = new StoreProcedure("[dbo].[SP_AGEN_AGENCIA_INSERT]");
                spInsertAgenAgencia.AddParameter("@NOMBRE_NV", agenteAgencia.Nombre, DirectionValues.Input);
                spInsertAgenAgencia.AddParameter("@TIPO_PUNTO_ID_IN", agenteAgencia.TipoPuntoId, DirectionValues.Input);
                spInsertAgenAgencia.AddParameter("@DEPARTAMENTO_ID_IN", agenteAgencia.DepartamentoId, DirectionValues.Input);
                spInsertAgenAgencia.AddParameter("@LATITUD_DC", agenteAgencia.Latitud, DirectionValues.Input);
                spInsertAgenAgencia.AddParameter("@LONGITUD_DC", agenteAgencia.Longitud, DirectionValues.Input);
                spInsertAgenAgencia.AddParameter("@DIRECCION_NV", agenteAgencia.Direccion, DirectionValues.Input);
                spInsertAgenAgencia.AddParameter("@NOMBRE_SERVIDOR", agenteAgencia.NombreServidor, DirectionValues.Input);
                spInsertAgenAgencia.AddParameter("@AGEN_AGENCIA_ID_IN", agenteAgencia.AgenteAgenciaId, DirectionValues.Ouput);
                spInsertAgenAgencia.ExecuteStoredProcedure(ConexionString);
                if (spInsertAgenAgencia.ErrorMessage != String.Empty)
                {
                    throw new Exception("Procedimiento Almacenado :[dbo].[SP_AGEN_AGENCIA_INSERT] Descripcion:" + spInsertAgenAgencia.ErrorMessage.Trim());
                }
                agenteAgencia.AgenteAgenciaId = Convert.ToInt32(spInsertAgenAgencia.GetItem("@AGEN_AGENCIA_ID_IN").Value);
                foreach (Horario item in agenteAgencia.ListHorarios)
                {
                    var spHorario = new StoreProcedure("[dbo].[SP_HORARIO_INSERT]");
                    spHorario.AddParameter("@AGEN_AGENCIA_ID_IN", agenteAgencia.AgenteAgenciaId, DirectionValues.Input);
                    spHorario.AddParameter("@DIA_ID_IN", item.diaId, DirectionValues.Input);
                    spHorario.AddParameter("@HORARIO_DESC", item.HorarioDescripcion, DirectionValues.Input);
                    transaction.Batch.Add(spHorario);
                }
                transaction.EjecutarTransaccion(ConexionString);
                if (transaction.ErrorMessage != String.Empty)
                {
                    throw new Exception("Procedimiento Almacenado :[dbo].[SP_HORARIO_INSERT] Descripcion:" + transaction.ErrorMessage.Trim());
                }
            }
            catch (Exception ex)
            {
                TextLogger.LogError(LogManager.GetCurrentClassLogger(), ex, "Error En el metodo: InsertAgenteAgencia");
                throw new Exception("Procedimiento Almacenado :[dbo].[SP_AGEN_AGENCIA_INSERT]" + ex);
            }
            return(true);
        }
        /// <summary>
        /// Trae los parametros por medio de un criterio
        /// </summary>
        /// <returns>un data table de clientes</returns>
        public DataTable GetManyParametro(String tipoParametro)
        {
            DataTable dtParametro;

            try
            {
                string conexionString = Conexion.ConexionGmaps();
                var    storeProcedure = new StoreProcedure("[dbo].[SP_PARAMETRO_GET_MANY_BY_TIPO]");
                storeProcedure.AddParameter("@TIPO_PARAMETRO_NV", tipoParametro, DirectionValues.Input);
                dtParametro = storeProcedure.MakeQuery(conexionString);
                if (storeProcedure.ErrorMessage != String.Empty)
                {
                    throw new Exception("Procedimiento Almacenado :[dbo].[SP_PARAMETRO_GET_ALL] Descripcion:" + storeProcedure.ErrorMessage.Trim());
                }
            }
            catch (Exception ex)
            {
                TextLogger.LogError(LogManager.GetCurrentClassLogger(), ex, "Error En el metodo: getManyParametro");
                throw new Exception("Procedimiento Almacenado :[dbo].[SP_PARAMETRO_GET_ALL]" + ex);
            }
            return(dtParametro);
        }
Exemple #11
0
        /// <summary>
        /// Trae los puntos por medio de un criterio
        /// </summary>
        /// <returns>un data table de clientes</returns>
        public DataTable GetManyPuntoByTipoId(int tipoPuntoId, int departamentoId)
        {
            DataTable dtPuntos;

            try
            {
                string conexionString = Conexion.ConexionGmaps();
                var    storeProcedure = new StoreProcedure("[dbo].[SP_PUNTO_GET_MANY_BY_TIPO]");
                storeProcedure.AddParameter("@TIPO_PUNTO_ID_IN", tipoPuntoId, DirectionValues.Input);
                storeProcedure.AddParameter("@DEPARTAMENTO_ID_IN", departamentoId, DirectionValues.Input);
                dtPuntos = storeProcedure.MakeQuery(conexionString);
                if (storeProcedure.ErrorMessage != String.Empty)
                {
                    throw new Exception("Procedimiento Almacenado :[dbo].[SP_PUNTO_GET_MANY_BY_TIPO] Descripcion:" + storeProcedure.ErrorMessage.Trim());
                }
            }
            catch (Exception ex)
            {
                TextLogger.LogError(LogManager.GetCurrentClassLogger(), ex, "Error En el metodo: getManyPuntoByTipoId");
                throw new Exception("Procedimiento Almacenado :[dbo].[SP_PUNTO_GET_MANY_BY_TIPO]" + ex);
            }
            return(dtPuntos);
        }
Exemple #12
0
        /// <summary>
        /// Trae el punto de origen del usuario de acuerdo a su registro de ubicacion de trabajo
        /// </summary>
        /// <returns>Data Table con los datos de la ubicacion</returns>
        public ListPunto GetManyPuntoByTipoId(int tipoPuntoId, int departamentoId)
        {
            ListPunto listPunto;

            try
            {
                var       conector = new ConectorPuntos();
                DataTable dtPuntos = conector.GetManyPuntoByTipoId(tipoPuntoId, departamentoId);
                listPunto = new ListPunto {
                    success = true, message = String.Empty
                };
                listPunto.listPunto = new List <Punto>();
                foreach (var item in from DataRow row in dtPuntos.Rows select new Punto
                {
                    PuntoId = Convert.ToInt32(row["PUNTO_ID_IN"]),
                    Nombre = Convert.ToString(row["NOMBRE_NV"]),
                    TipoPuntoDesc = Convert.ToString(row["TIPO_PUNTO"]),
                    IconUrl = Convert.ToString(row["URL_IMAGE"]),
                    DepartamentoDesc = Convert.ToString(row["DEPARTAMENTO"]),
                    Latitud = Convert.ToDecimal(row["LATITUD_DC"]),
                    Longitud = Convert.ToDecimal(row["LONGITUD_DC"]),
                    Direccion = Convert.ToString(row["DIRECCION_NV"]),
                    htmlDescripcion = Convert.ToString(row["HTML_DESCRIPCION"])
                })
                {
                    listPunto.listPunto.Add(item);
                }
            }
            catch (Exception ex)
            {
                TextLogger.LogError(LogManager.GetCurrentClassLogger(), ex, "Error En el metodo: getManyPuntoByTipoId");
                listPunto = new ListPunto {
                    success = false, message = "Error al realizar la consulta"
                };
            }
            return(listPunto);
        }