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 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 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 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]); }