public List <DTO_GiniMachineConfig> ObtenerConfigGiniMachine(DTO_GiniMachineConfig objConfig)
        {
            var dto = new DynamicDto();

            dto.ParameterList = new List <SpParameter>();

            dto.ParameterList.AddRange(from nodo in objConfig.GetType().GetProperties()
                                       where nodo.GetValue(objConfig) != null
                                       select new SpParameter
            {
                Name  = nodo.Name,
                Value = nodo.GetValue(objConfig).ToString()
            }
                                       );
            dto.Result = null;
            dto.SPName = "usp_ObtenerConfiguracionGiniMachine";
            var dto_result = new List <DTO_GiniMachineConfig>();

            try
            {
                var objRet = DynamicSqlDAO.ExecuterSp(dto, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
                if (objRet.HasResult)
                {
                    dto_result = JsonConvert.DeserializeObject <List <DTO_GiniMachineConfig> >(JsonConvert.SerializeObject(objRet.Result.Tables[0]));
                }
            }
            catch (Exception ex)
            {
                //dto_result.Mensaje = "Ocurrio un Error";
                throw;
            }

            return(dto_result);
        }
示例#2
0
        static void Main(string[] args)
        {
            //var dto = new DynamicDto
            //{    new SpParameter
            //        {
            //            Name = "INT_SUB_ORIGEN",
            //            Value = xInfoClass.INT_SUB_ORIGEN.ToString()
            //        },
            //    SPName = "usp_ConsultarAgentes"
            //};
            var dto = new DynamicDto
            {
                ParameterList = new List <SpParameter>
                {
                },
                Result = null,
                SPName = "usp_ConsultarAgentes"
            };

            dto.Result = null;

            DynamicDto ds = DynamicSqlDAO.ExecuterSp(dto, "Data Source=192.168.110.15 ;Initial Catalog=FinTech_DEV;Persist Security Info=True;User ID=icortes;Password=Ics5355.;");

            var res = ds.Result.Tables[0];

            foreach (DataRow row in res.Rows)
            {
                var data = row[0];
            }
        }
        internal static List <FrecuenciaCredito> TraeFrecuenciaCalcu()
        {
            string xClase   = string.Format("{0}|{1}", MethodBase.GetCurrentMethod().Module.Name, MethodBase.GetCurrentMethod().DeclaringType.Name);
            string xProceso = MethodBase.GetCurrentMethod().Name;
            var    dto      = new DynamicDto();

            dto.ParameterList = new List <SpParameter>();
            FrecuenciaCredito frec = new FrecuenciaCredito();

            dto.Result = null;
            dto.SPName = "usp_TraeFrecuenciaCredito";

            var dto_excepcion = new UTL_TRA_EXCEPCION
            {
                STR_CLASE      = xClase,
                STR_EVENTO     = xProceso,
                STR_PARAMETROS = JsonConvert.SerializeObject(frec),
                STR_APLICATIVO = ConfigurationManager.AppSettings["Aplicativo"],
                STR_SERVIDOR   = System.Net.Dns.GetHostName()
            };
            var dto_obj = new List <FrecuenciaCredito>();

            try
            {
                var obj = DynamicSqlDAO.ExecuterSp <FrecuenciaCredito>(dto, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
                dto_obj = obj.ToList();
            }
            catch (Exception ex)
            {
                dto_excepcion.STR_MENSAJE = ex.Message;
                dto_excepcion.STR_DETALLE = ex.StackTrace;
                TwoFunTwoMe_DataAccess.Utility.guardaExcepcion(dto_excepcion, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
            }
            return(dto_obj);
        }
        public List <TipoMoneda> TraeTipoMoneda()
        {
            string xClase   = string.Format("{0}|{1}", MethodBase.GetCurrentMethod().Module.Name, MethodBase.GetCurrentMethod().DeclaringType.Name);
            string xProceso = MethodBase.GetCurrentMethod().Name;


            var dto_excepcion = new UTL_TRA_EXCEPCION
            {
                STR_CLASE      = xClase,
                STR_EVENTO     = xProceso,
                STR_APLICATIVO = ConfigurationManager.AppSettings["APLICATIVO"].ToString(),
                STR_SERVIDOR   = System.Net.Dns.GetHostName(),
                FEC_CREACION   = DateTime.Now
            };

            var dto = new DynamicDto();

            dto.ParameterList = new List <SpParameter>();

            dto.Result = null;
            dto.SPName = "usp_TraeTipoMoneda";
            try
            {
                DynamicDto ds = DynamicSqlDAO.ExecuterSp(dto, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);

                return(JsonConvert.DeserializeObject <List <TipoMoneda> >(JsonConvert.SerializeObject(ds.Result.Tables[0])));
            }
            catch (Exception ex)
            {
                dto_excepcion.STR_MENSAJE = ex.Message;
                dto_excepcion.STR_DETALLE = ex.StackTrace;
                TwoFunTwoMe_DataAccess.Utility.guardaExcepcion(dto_excepcion, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
                throw;
            }
        }
        internal static void ApiSolicitudEndConsul(InsertPersonasWeb insertPersonasWeb, ref DTO_SOLICITUD_VENTAS persona)
        {
            string xClase   = string.Format("{0}|{1}", MethodBase.GetCurrentMethod().Module.Name, MethodBase.GetCurrentMethod().DeclaringType.Name);
            string xProceso = MethodBase.GetCurrentMethod().Name;
            var    dto      = new DynamicDto();

            dto.ParameterList = new List <SpParameter>();

            dto.ParameterList.AddRange(from nodo in insertPersonasWeb.GetType().GetProperties()
                                       where nodo.GetValue(insertPersonasWeb) != null
                                       select new SpParameter
            {
                Name  = nodo.Name,
                Value = nodo.GetValue(insertPersonasWeb).ToString()
            }
                                       );
            dto.Result = null;
            dto.SPName = "usp_ValidarPIN";

            var dto_excepcion = new UTL_TRA_EXCEPCION
            {
                STR_CLASE      = xClase,
                STR_EVENTO     = xProceso,
                STR_PARAMETROS = JsonConvert.SerializeObject(insertPersonasWeb),
                STR_APLICATIVO = ConfigurationManager.AppSettings["Aplicativo"],
                STR_SERVIDOR   = System.Net.Dns.GetHostName()
            };

            try
            {
                var obj = DynamicSqlDAO.ExecuterSp(dto, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);

                var dto_result = new List <DTO_SOLICITUD_VENTAS>();
                if (obj.HasResult)
                {
                    dto_result = JsonConvert.DeserializeObject <List <DTO_SOLICITUD_VENTAS> >(JsonConvert.SerializeObject(obj.Result.Tables[0]));
                }


                persona = dto_result.ToList().FirstOrDefault();
                if (persona != null)
                {
                    persona.Status = dto_result.Any() ? dto_result.ToList().FirstOrDefault().Status : null;
                }
                else
                {
                    persona = new DTO_SOLICITUD_VENTAS();
                }
            }
            catch (Exception ex)
            {
                dto_excepcion.STR_MENSAJE = ex.Message;
                dto_excepcion.STR_DETALLE = ex.StackTrace;
                TwoFunTwoMe_DataAccess.Utility.guardaExcepcion(dto_excepcion, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
            }
        }
示例#6
0
        private List <Tab_ConfigSys> GetConfigRabbit(Tab_ConfigSys config)
        {
            manage = new Manager();

            string xClase      = string.Format("{0}|{1}", MethodBase.GetCurrentMethod().Module.Name, MethodBase.GetCurrentMethod().DeclaringType.Name);
            string xProceso    = MethodBase.GetCurrentMethod().Name;
            string strHostName = System.Net.Dns.GetHostName();
            //IPHostEntry ipHostInfo = Dns.Resolve(Dns.GetHostName()); <-- Obsolete
            IPHostEntry ipHostInfo = Dns.GetHostEntry(strHostName);
            IPAddress   ipAddress  = ipHostInfo.AddressList[0];

            var dto_excepcion = new UTL_TRA_EXCEPCION
            {
                STR_CLASE      = xClase,
                STR_EVENTO     = xProceso,
                STR_APLICATIVO = ConfigurationManager.AppSettings["APLICATIVO"].ToString(),
                STR_SERVIDOR   = ipAddress.ToString(),
                STR_PARAMETROS = JsonConvert.SerializeObject(config)
            };

            var dto = new DynamicDto();

            dto.ParameterList = new List <SpParameter>();

            dto.ParameterList.AddRange(from nodo in config.GetType().GetProperties()
                                       where nodo.GetValue(config) != null
                                       select new SpParameter
            {
                Name  = nodo.Name,
                Value = nodo.GetValue(config).ToString()
            }
                                       );
            dto.Result = null;
            dto.SPName = "usp_consulta_configuracion_general";
            var dto_result = new List <Tab_ConfigSys>();

            try
            {
                var objRet = DynamicSqlDAO.ExecuterSp(dto, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
                if (objRet.HasResult)
                {
                    dto_result = JsonConvert.DeserializeObject <List <Tab_ConfigSys> >(JsonConvert.SerializeObject(objRet.Result.Tables[0]));
                }
            }
            catch (Exception ex)
            {
                dto_excepcion.STR_MENSAJE = ex.Message;
                DynamicSqlDAO.guardaExcepcion(dto_excepcion, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
            }
            return(dto_result);
        }
        public bool ValidarCuentaSinpe(CuentaBancaria cuentabancaria)
        {
            string xClase   = string.Format("{0}|{1}", MethodBase.GetCurrentMethod().Module.Name, MethodBase.GetCurrentMethod().DeclaringType.Name);
            string xProceso = MethodBase.GetCurrentMethod().Name;


            var dto_excepcion = new UTL_TRA_EXCEPCION
            {
                STR_CLASE      = xClase,
                STR_EVENTO     = xProceso,
                STR_APLICATIVO = ConfigurationManager.AppSettings["APLICATIVO"].ToString(),
                STR_SERVIDOR   = System.Net.Dns.GetHostName(),
                FEC_CREACION   = DateTime.Now
            };

            var dto = new DynamicDto();

            dto.ParameterList = new List <SpParameter>();

            dto.ParameterList.AddRange(from nodo in cuentabancaria.GetType().GetProperties()
                                       where nodo.GetValue(cuentabancaria) != null
                                       select new SpParameter
            {
                Name  = nodo.Name,
                Value = nodo.GetValue(cuentabancaria).ToString()
            }
                                       );
            dto.Result = null;
            dto.SPName = "usp_ValidaSinpe";
            var dto_result = new List <CuentaBancaria>();

            try
            {
                var objRet = DynamicSqlDAO.ExecuterSp(dto, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
                if (objRet.HasResult)
                {
                    dto_result = JsonConvert.DeserializeObject <List <CuentaBancaria> >(JsonConvert.SerializeObject(objRet.Result.Tables[0]));
                    //dto_result.FirstOrDefault().Mensaje = string.Concat("Se creo Buckets N#: ", dto_result.FirstOrDefault().Id);
                }
            }
            catch (Exception ex)
            {
                dto_excepcion.STR_MENSAJE = ex.Message;
                dto_excepcion.STR_DETALLE = ex.StackTrace;
                TwoFunTwoMe_DataAccess.Utility.guardaExcepcion(dto_excepcion, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
                cuentabancaria.Respuesta = "ERR";
                dto_result.Add(cuentabancaria);
                //throw;
            }
            return(dto_result.Any()? dto_result.FirstOrDefault().result:false);
        }
        public List <DTO_GiniMachine> ObtenerJSON(DTO_GiniMachine dto_Entrada)
        {
            string xClase   = string.Format("{0}|{1}", MethodBase.GetCurrentMethod().Module.Name, MethodBase.GetCurrentMethod().DeclaringType.Name);
            string xProceso = MethodBase.GetCurrentMethod().Name;


            var dto_excepcion = new UTL_TRA_EXCEPCION
            {
                STR_CLASE  = xClase,
                STR_EVENTO = xProceso
            };

            var dto = new DynamicDto();

            dto.ParameterList = new List <SpParameter>();

            dto.ParameterList.AddRange(from nodo in dto_Entrada.GetType().GetProperties()
                                       where nodo.GetValue(dto_Entrada) != null
                                       select new SpParameter
            {
                Name  = nodo.Name,
                Value = nodo.GetValue(dto_Entrada).ToString()
            }
                                       );
            dto.Result = null;
            dto.SPName = "usp_GeneraProspectoModeloGini";
            var dto_result = new List <DTO_GiniMachine>();

            try
            {
                var objRet = DynamicSqlDAO.ExecuterSp(dto, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
                if (objRet.HasResult)
                {
                    dto_result = JsonConvert.DeserializeObject <List <DTO_GiniMachine> >(JsonConvert.SerializeObject(objRet.Result.Tables[0]));
                    dto_result.FirstOrDefault().Mensaje = string.Concat("", dto_result.FirstOrDefault().Mensaje);
                }
            }
            catch (Exception ex)
            {
                dto_excepcion.STR_MENSAJE = ex.Message;
                DynamicSqlDAO.guardaExcepcion(dto_excepcion, ConfigurationManager.ConnectionStrings["TwoFunTwoMeConnection"].ConnectionString);
                dto_Entrada.Mensaje = "ERR";
            }
            return(dto_result);
        }
示例#9
0
        public List <ConsultaRules> consultaRules(ConsultaRules rules)
        {
            string xClase        = string.Format("{0}|{1}", MethodBase.GetCurrentMethod().Module.Name, MethodBase.GetCurrentMethod().DeclaringType.Name);
            string xProceso      = MethodBase.GetCurrentMethod().Name;
            var    dto_excepcion = new UTL_TRA_EXCEPCION
            {
                STR_CLASE      = xClase,
                STR_EVENTO     = xProceso,
                STR_APLICATIVO = ConfigurationManager.AppSettings["Aplicativo"],
                STR_PARAMETROS = JsonConvert.SerializeObject(rules),
                STR_SERVIDOR   = System.Net.Dns.GetHostName()
            };
            var dto = new DynamicDto();

            dto.ParameterList = new List <SpParameter>();
            var dto_result = new List <ConsultaRules>();

            try
            {
                dto.ParameterList.AddRange(from nodo in rules.GetType().GetProperties()
                                           where nodo.GetValue(rules) != null
                                           select new SpParameter
                {
                    Name  = nodo.Name,
                    Value = nodo.GetValue(rules).ToString()
                }
                                           );
                dto.Result = null;
                dto.SPName = "usp_consultaAnalisisRules";
                var objRet = DynamicSqlDAO.ExecuterSp(dto, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
                if (objRet.HasResult)
                {
                    dto_result = JsonConvert.DeserializeObject <List <ConsultaRules> >(JsonConvert.SerializeObject(objRet.Result.Tables[0]));
                }
            }
            catch (Exception ex)
            {
                dto_excepcion.STR_MENSAJE = ex.Message;
                dto_excepcion.STR_DETALLE = ex.StackTrace;
            }
            return(dto_result);
        }
        private static bool ConsultaUltimoIngresoSolicitud(InsertPersonasWeb persona)
        {
            string xClase   = string.Format("{0}|{1}", MethodBase.GetCurrentMethod().Module.Name, MethodBase.GetCurrentMethod().DeclaringType.Name);
            string xProceso = MethodBase.GetCurrentMethod().Name;

            var dto_excepcion = new UTL_TRA_EXCEPCION
            {
                STR_CLASE      = xClase,
                STR_EVENTO     = xProceso,
                STR_PARAMETROS = JsonConvert.SerializeObject(persona),
                STR_APLICATIVO = ConfigurationManager.AppSettings["Aplicativo"],
                STR_SERVIDOR   = System.Net.Dns.GetHostName()
            };
            var dto = new DynamicDto();

            dto.ParameterList = new List <SpParameter>();

            dto.ParameterList.AddRange(from nodo in persona.GetType().GetProperties()
                                       where nodo.GetValue(persona) != null
                                       select new SpParameter
            {
                Name  = nodo.Name,
                Value = nodo.GetValue(persona).ToString()
            }
                                       );
            dto.Result = null;
            dto.SPName = "usp_consulta_ultimo_ingreso_solicitud";


            try
            {
                var obj = DynamicSqlDAO.ExecuterSp <InsertPersonasWeb>(dto, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
                return(obj.Any());
            }
            catch (Exception ex)
            {
                dto_excepcion.STR_MENSAJE = ex.Message;
                dto_excepcion.STR_DETALLE = ex.StackTrace;
                TwoFunTwoMe_DataAccess.Utility.guardaExcepcion(dto_excepcion, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
            }
            return(false);
        }
        internal static List <DTO_SOLICITUD_VENTAS> GuardaProducto(DTO_SOLICITUD_VENTAS solicitudes)
        {
            string xClase   = string.Format("{0}|{1}", MethodBase.GetCurrentMethod().Module.Name, MethodBase.GetCurrentMethod().DeclaringType.Name);
            string xProceso = MethodBase.GetCurrentMethod().Name;
            var    dto      = new DynamicDto();

            dto.ParameterList = new List <SpParameter>();

            dto.ParameterList.AddRange(from nodo in solicitudes.GetType().GetProperties()
                                       where nodo.GetValue(solicitudes) != null
                                       select new SpParameter
            {
                Name  = nodo.Name,
                Value = nodo.GetValue(solicitudes).ToString()
            }
                                       );
            dto.Result = null;
            dto.SPName = "usp_GuardarProducto";

            var dto_excepcion = new UTL_TRA_EXCEPCION
            {
                STR_CLASE      = xClase,
                STR_EVENTO     = xProceso,
                STR_PARAMETROS = JsonConvert.SerializeObject(solicitudes),
                STR_APLICATIVO = ConfigurationManager.AppSettings["Aplicativo"],
                STR_SERVIDOR   = System.Net.Dns.GetHostName()
            };
            var dto_obj = new List <DTO_SOLICITUD_VENTAS>();

            try
            {
                var obj = DynamicSqlDAO.ExecuterSp <DTO_SOLICITUD_VENTAS>(dto, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
                dto_obj = obj.ToList();
            }
            catch (Exception ex)
            {
                dto_excepcion.STR_MENSAJE = ex.Message;
                dto_excepcion.STR_DETALLE = ex.StackTrace;
                TwoFunTwoMe_DataAccess.Utility.guardaExcepcion(dto_excepcion, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
            }
            return(dto_obj);
        }
        public List <CuentaBancaria> uspConsultaEditCuentaBancaria(CuentaBancaria cuentaBancaria)
        {
            string xClase        = string.Format("{0}|{1}", MethodBase.GetCurrentMethod().Module.Name, MethodBase.GetCurrentMethod().DeclaringType.Name);
            string xProceso      = MethodBase.GetCurrentMethod().Name;
            var    dto_excepcion = new UTL_TRA_EXCEPCION
            {
                STR_CLASE      = xClase,
                STR_EVENTO     = xProceso,
                STR_APLICATIVO = ConfigurationManager.AppSettings["Aplicativo"],
                STR_PARAMETROS = JsonConvert.SerializeObject(cuentaBancaria),
                STR_SERVIDOR   = System.Net.Dns.GetHostName()
            };

            var dto = new DynamicDto();

            dto.ParameterList = new List <SpParameter>();
            try
            {
                dto.ParameterList.AddRange(from nodo in cuentaBancaria.GetType().GetProperties()
                                           where nodo.GetValue(cuentaBancaria) != null
                                           select new SpParameter
                {
                    Name  = nodo.Name,
                    Value = nodo.GetValue(cuentaBancaria).ToString()
                }
                                           );
                dto.Result = null;
                dto.SPName = "usp_ConsultarPersonasCuenta_Edit_Ventas_Fenix";


                return(DynamicSqlDAO.ExecuterSp <CuentaBancaria>(dto, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value).ToList());
            }
            catch (Exception ex)
            {
                dto_excepcion.STR_MENSAJE = ex.Message;
                dto_excepcion.STR_DETALLE = ex.StackTrace;
                Utility.guardaExcepcion(dto_excepcion, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
            }
            return(new List <CuentaBancaria>());
        }
        public bool guardarAsignacionAgenciaExterna(DtoAsignacionAgenciaExterna row)
        {
            string xClase        = string.Format("{0}|{1}", MethodBase.GetCurrentMethod().Module.Name, MethodBase.GetCurrentMethod().DeclaringType.Name);
            string xProceso      = MethodBase.GetCurrentMethod().Name;
            var    dto_excepcion = new UTL_TRA_EXCEPCION
            {
                STR_CLASE      = xClase,
                STR_EVENTO     = xProceso,
                STR_APLICATIVO = ConfigurationManager.AppSettings["Aplicativo"],
                STR_PARAMETROS = JsonConvert.SerializeObject(row),
                STR_SERVIDOR   = System.Net.Dns.GetHostName()
            };

            var dto = new DynamicDto();

            dto.ParameterList = new List <SpParameter>();

            dto.ParameterList.AddRange(from nodo in row.GetType().GetProperties()
                                       where nodo.GetValue(row) != null
                                       select new SpParameter
            {
                Name  = nodo.Name,
                Value = nodo.GetValue(row).ToString()
            }
                                       );
            dto.Result = null;
            dto.SPName = "usp_asignar_agencia_externa";
            try
            {
                var objRet = DynamicSqlDAO.ExecuterSp(dto, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
                return(true);
            }
            catch (Exception ex)
            {
                dto_excepcion.STR_MENSAJE = ex.Message;
                dto_excepcion.STR_DETALLE = ex.StackTrace;
                Utility.guardaExcepcion(dto_excepcion, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value);
                throw ex;
            }
        }