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); }
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); }
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); }
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); }
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)); }
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); }
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); }
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)); }
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); }
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); }
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); }
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); }
// 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); }
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); }
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); }
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); }
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); }
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]); }
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); }
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); }
public int EliminarItem(int id) { return(InstanceOF.Eliminar_Registro("delete from Item where id =" + id)); }
public DataTable Instrumento() { DataTable result = InstanceOF.Obtener_Tabla(string.Format("select id, GrupoInstrumentoId, Descripcion from instrumento")); return(result); }