Ejemplo n.º 1
0
        public List <cf_Lcr> ListarControles()
        {
            List <cf_Lcr> lista = new List <cf_Lcr>();

            lista = InstanceOF.Obtener_Objeto(string.Format("select * from Lcr"), typeof(cf_Lcr)) ?? new List <cf_Lcr>();
            return(lista);
        }
Ejemplo n.º 2
0
        public List <cf_Lcr> ObtenerListaControles()
        {
            List <cf_Lcr> ListaControles = new List <cf_Lcr>();

            ListaControles = InstanceOF.Obtener_Objeto(string.Format("select * from Lcr"), typeof(cf_Lcr)) ?? new List <cf_Lcr>();
            return(ListaControles);
        }
Ejemplo n.º 3
0
        public bool UpdateCliente(cf_Cliente cliente)
        {
            // (dynamic obj, Type _tipoClase, List<string> l_no_considerados, SqlConnection sqlCon, SqlTransaction sqlTran, PROCESO_SP _sp)
            //bool resultado = true;
            //using (SqlConnection sqlCon = Corp.Datos.Conexion.ObtieneConexion("CF"))
            //{
            //    using (SqlTransaction sqlTran = sqlCon.BeginTransaction())
            //    {
            //        try
            //        {
            //            int result_tran = InstanceOF.Establecer_Objeto(cliente, typeof(cf_Cliente), new List<string>(), sqlCon, sqlTran, InstanceOF.PROCESO_SP.CF_CLIENTE_UPDATE);
            //            if (result_tran == -1) throw new Exception();

            //            sqlTran.Commit();
            //        }
            //        catch (Exception)
            //        {
            //            sqlTran.Rollback();
            //            resultado = false;
            //        }
            //    }
            //}
            //return resultado;
            int control_resultado = InstanceOF.Establecer_Objeto(cliente, typeof(cf_Cliente), new List <string>(), InstanceOF.PROCESO_SP.CF_CLIENTE_UPDATE);

            return(control_resultado == -1 ? false : true);
        }
Ejemplo n.º 4
0
        public bool AlmacenaHistorial(cf_ClasificaciconRiesgoCliente RiesgoCliente)
        {
            bool resultado = true;

            using (SqlConnection sqlCon = Corp.Datos.Conexion.ObtieneConexion("CF"))
            {
                using (SqlTransaction sqlTran = sqlCon.BeginTransaction())
                {
                    try
                    {
                        int result_tran = InstanceOF.Establecer_Objeto(RiesgoCliente, typeof(cf_ClasificaciconRiesgoCliente), new List <string>(new string[] { "Id" }), sqlCon, sqlTran, InstanceOF.PROCESO_SP.CF_CRC_UPDATE);
                        if (result_tran == -1)
                        {
                            throw new Exception();
                        }

                        sqlTran.Commit();
                    }
                    catch (Exception)
                    {
                        sqlTran.Rollback();
                        resultado = false;
                    }
                }
            }
            return(resultado);
        }
Ejemplo n.º 5
0
        public int ModificarItem(int id, string Descripcion)
        {
            cf_Item item = new cf_Item();

            item.Descripcion = Descripcion;
            return(InstanceOF.Establecer_Objeto(item, typeof(cf_Item), new List <string>(new string[] { "" }), InstanceOF.PROCESO_SP.MN_UPDATE_ITEM));
        }
Ejemplo n.º 6
0
        public DataTable ListarItem(int Entidad)
        {
            DataTable items = new DataTable();

            items = InstanceOF.Obtener_Tabla(string.Format(@"select item.id, item.Descripcion as Item, ConceptoId, concepto.Descripcion as Concepto
                                                             from item inner join concepto on item.ConceptoId = Concepto.Id
                                                             where EntidadId = " + Entidad));
            return(items);
        }
Ejemplo n.º 7
0
        public DataTable Lista_Concepto(int Entidad)
        {
            DataTable conceptos = new DataTable();

            conceptos = InstanceOF.Obtener_Tabla(string.Format(@"select id, EntidadId, Descripcion, FlagNivel, FlagTipoControl 
                                                                 from Concepto 
                                                                 where EntidadId = " + Entidad + @"
                                                                 order by FlagTipoControl ASC, Descripcion"));
            return(conceptos);
        }
Ejemplo n.º 8
0
        public int GuardarItem(string Descripcion, int ConceptoId, int EntidadId)
        {
            cf_Item item = new cf_Item();

            item.Descripcion = Descripcion;
            item.ConceptoId  = ConceptoId;
            item.PlazoMinimo = 0;
            item.PlazoMaximo = 0;
            return(InstanceOF.Establecer_Objeto(item, typeof(cf_Item), new List <string>(new string[] { "Id" }), InstanceOF.PROCESO_SP.MN_INSERT_ITEM));
        }
Ejemplo n.º 9
0
        public int GuardarLcr(string nombre)
        {
            int    result_Control;
            cf_Lcr Control = new cf_Lcr();

            Control.EntidadId = 1;
            Control.NombreLcr = nombre;
            Control.EstadoId  = 1;
            result_Control    = InstanceOF.Establecer_Objeto(Control, typeof(cf_Lcr), new List <string>(new string[] { "Id" }), InstanceOF.PROCESO_SP.CF_CONTROL_CREAR);
            return(result_Control);
        }
Ejemplo n.º 10
0
        public Dictionary <int, string> GrupoInstrumento()
        {
            Dictionary <int, string>   Grupo  = new Dictionary <int, string>();
            List <cf_GrupoInstrumento> result = new List <cf_GrupoInstrumento>();

            result = InstanceOF.Obtener_Objeto(string.Format("select * from GrupoInstrumento"), typeof(cf_GrupoInstrumento)) ?? new List <cf_GrupoInstrumento>();
            foreach (cf_GrupoInstrumento grupo in result)
            {
                Grupo.Add(grupo.Id, grupo.Descripcion);
            }
            return(Grupo);
        }
Ejemplo n.º 11
0
        public List <KeyValuePair <string, int> > ObtenerCliente(int id)
        {
            List <cf_Cliente> cliente = new List <cf_Cliente>();

            cliente = InstanceOF.Obtener_Objeto(string.Format("select * from ClienteLcr where ClienteId = {0}", id), typeof(cf_Cliente)) ?? new List <cf_Cliente>();

            List <KeyValuePair <string, int> > valores = new List <KeyValuePair <string, int> >();

            valores.Add(new KeyValuePair <string, int>("Segmento", Convert.ToInt16(cliente[0].SegmentoId)));
            valores.Add(new KeyValuePair <string, int>("Clasificacion", Convert.ToInt16(cliente[0].ClasificacionCreditoId)));

            return(valores);
        }
Ejemplo n.º 12
0
        public Dictionary <int, string> ObtenerClasificacion()
        {
            List <cf_ClasificacionCredito> ListaClasificacion = new List <cf_ClasificacionCredito>();

            ListaClasificacion = InstanceOF.Obtener_Objeto(string.Format("select Id, Valor from ClasificacionCredito"), typeof(cf_ClasificacionCredito)) ?? new List <cf_ClasificacionCredito>();

            Dictionary <int, string> datos = new Dictionary <int, string>();

            foreach (cf_ClasificacionCredito clas in ListaClasificacion)
            {
                datos.Add(Convert.ToInt32(clas.Id), clas.Valor.ToString());
            }
            return(datos);
        }
Ejemplo n.º 13
0
        // metodo replicado para clientes globales
        public List <KeyValuePair <string, string> > CargarClientes()
        {
            List <cf_Cliente> ListaClientes = new List <cf_Cliente>();

            ListaClientes = InstanceOF.Obtener_Objeto(string.Format("select Id, NombreCliente, Codigo, Subcodigo from Cliente"), typeof(cf_Cliente)) ?? new List <cf_Cliente>();

            List <KeyValuePair <string, string> > nombres = new List <KeyValuePair <string, string> >();

            foreach (cf_Cliente cliente in ListaClientes)
            {
                nombres.Add(new KeyValuePair <string, string>(cliente.NombreCliente.TrimEnd() + ", " + cliente.Codigo + "-" + cliente.SubCodigo, cliente.Id.ToString()));
            }
            return(nombres);
        }
Ejemplo n.º 14
0
        public Dictionary <int, string> ObtenerSegmentos()
        {
            List <cf_Segmento> ListaSegmentos = new List <cf_Segmento>();

            ListaSegmentos = InstanceOF.Obtener_Objeto(string.Format("select Id, NombreSegmento from segmento"), typeof(cf_Segmento)) ?? new List <cf_Segmento>();

            Dictionary <int, string> datos = new Dictionary <int, string>();

            foreach (cf_Segmento seg in ListaSegmentos)
            {
                datos.Add(Convert.ToInt32(seg.Id), seg.NombreSegmento.ToString());
            }
            return(datos);
        }
Ejemplo n.º 15
0
        public List <cf_Lcr> ObtenerListaControles(int ClienteId)
        {
            List <cf_Lcr> ListaControles = new List <cf_Lcr>();

            ListaControles = InstanceOF.Obtener_Objeto(string.Format(@" select
	                                                                        Lcr.*	                                                                        
                                                                        from 
	                                                                        ClienteLcr 
	                                                                        inner join Lcr 
	                                                                        on ClienteLcr.LcrId = Lcr.Id
	                                                                        inner join CodigoLcr
	                                                                        on Lcr.Id = CodigoLcr.LcrId
                                                                        where ClienteId = " + ClienteId), typeof(cf_Lcr)) ?? new List <cf_Lcr>();
            return(ListaControles);
        }
Ejemplo n.º 16
0
        public DataTable ObtenerItemConcepto(int tipo)
        {
            DataTable lista = new DataTable();

            lista = InstanceOF.Obtener_Tabla(string.Format(@"   SELECT
		                                                            ITEM.Id					AS [ItemId],
		                                                            ITEM.Descripcion		AS [Item],
		                                                            Concepto.Id				AS [ConceptoId],
		                                                            Concepto.Descripcion	AS [Concepto],
		                                                            Concepto.TipoConcepto	AS [Tipo]
	                                                            FROM
		                                                            Concepto		AS CONCEPTO
		                                                            inner join Item AS ITEM			ON CONCEPTO.Id = ITEM.ConceptoId
                                                                WHERE
                                                                    TipoConcepto = " + tipo));
            return(lista);
        }
Ejemplo n.º 17
0
        public DataTable ObtenerListaThreshold()
        {
            DataTable Threshold = InstanceOF.Obtener_Tabla(string.Format(@" select 
	                                                                            transaccion.id,
	                                                                            Valor as Clasificacion,
	                                                                            MontoREC as REC,
	                                                                            transaccion.SegmentoId,	
	                                                                            NombreSegmento as Segmento,
	                                                                            Transaccion.MontoThreshold as Monto
                                                                            from 
	                                                                            Transaccion
	                                                                            inner join Cliente on transaccion.ClienteId = Cliente.Id
	                                                                            inner join ClasificacionCredito on Cliente.ClasificacionCreditoId = ClasificacionCredito.id
	                                                                            left join Segmento on Cliente.SegmentoId = Segmento.Id	"        ));

            return(Threshold);
        }
Ejemplo n.º 18
0
        public void ModificarRiesgoCliente(int id, int Clasificacion, int Segmento)
        {
            List <cf_Cliente> cliente = new List <cf_Cliente>();
            cf_ClasificaciconRiesgoCliente RiesgoCliente = new cf_ClasificaciconRiesgoCliente();

            cliente = InstanceOF.Obtener_Objeto(string.Format("select * from Cliente where Id = {0}", id), typeof(cf_Cliente)) ?? new List <cf_Cliente>();

            RiesgoCliente.ClasificacionCreditoId = cliente[0].ClasificacionCreditoId;
            RiesgoCliente.ClienteId = cliente[0].Id;
            RiesgoCliente.Fecha     = DateTime.Today;

            cliente[0].ClasificacionCreditoId = Clasificacion;
            cliente[0].SegmentoId             = Segmento;

            bool estadoHistorial = AlmacenaHistorial(RiesgoCliente);
            bool estadoUpdate    = UpdateCliente(cliente[0]);
        }
Ejemplo n.º 19
0
        public DataTable ObtenerThreshold()
        {
            DataTable Threshold = InstanceOF.Obtener_Tabla(string.Format(@" select 
                                                                                TRANSACCION.Id		as Id, 
                                                                                GRUPO.Descripcion	as Modulo, 
	                                                                            Producto = '',
                                                                                --TIPO.NombreTipoTransaccion as Nombre, 
                                                                                CLIENTE.NombreCliente as Nombre, 
                                                                                NumeroTransaccion as Operacion, 
                                                                                MontoREC as REC, 
                                                                                TRANSACCION.MontoThreshold as Threshold	
                                                                            from 
	                                                                            Transaccion as TRANSACCION
	                                                                            inner join Cliente as CLIENTE on TRANSACCION.ClienteId = CLIENTE.Id
	                                                                            inner join GrupoInstrumento as GRUPO on TRANSACCION.GrupoInstrumentoId = GRUPO.Id
	                                                                            inner join TransaccionTipo as TIPO on TRANSACCION.TransaccionTipoId = TIPO.Id"    ));

            return(Threshold);
        }
Ejemplo n.º 20
0
        public bool GuardarCodigoLcr(int id, List <int> items)
        {
            bool resp = false;

            foreach (int item in items)
            {
                int          result_control;
                cf_CodigoLcr Codigo = new cf_CodigoLcr();
                Codigo.LcrId    = id;
                Codigo.Posicion = 2;
                Codigo.ItemId   = item;
                result_control  = InstanceOF.Establecer_Objeto(Codigo, typeof(cf_CodigoLcr), new List <string>(new string[] { "Id" }), InstanceOF.PROCESO_SP.CF_RELACIONAR_CONTROL);
                resp            = result_control == -1 ? false : true;
                if (!resp)
                {
                    return(resp);
                }
            }
            return(resp);
        }
Ejemplo n.º 21
0
 public int EliminarItem(int id)
 {
     return(InstanceOF.Eliminar_Registro("delete from Item where id =" + id));
 }
Ejemplo n.º 22
0
        public DataTable Instrumento()
        {
            DataTable result = InstanceOF.Obtener_Tabla(string.Format("select id, GrupoInstrumentoId, Descripcion from instrumento"));

            return(result);
        }