public Boolean AnularDetallePrestamo(ba_prestamo_detalle_Info _Info) { try { using (EntitiesBanco Entity = new EntitiesBanco()) { ba_prestamo_detalle detalle = Entity.ba_prestamo_detalle.FirstOrDefault(v => v.IdPrestamo == _Info.IdPrestamo && v.NumCuota == _Info.NumCuota && v.IdEmpresa == _Info.IdEmpresa); if (detalle != null) { detalle.IdUsuarioUltAnu = _Info.IdUsuarioUltAnu; detalle.Fecha_UltAnu = _Info.Fecha_UltAnu; detalle.MotiAnula = _Info.MotiAnula; detalle.Estado = "I"; Entity.SaveChanges(); } } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString() + " " + ex.Message; throw new Exception(ex.ToString()); } }
public Boolean GuardarPrestamoDetalle(List <ba_prestamo_detalle_Info> Lst) { try { int secuencia = 0; using (EntitiesBanco Context = new EntitiesBanco()) { foreach (var Item in Lst) { secuencia++; ba_prestamo_detalle Deta = new ba_prestamo_detalle(); Deta.IdEmpresa = Item.IdEmpresa; Deta.IdPrestamo = Item.IdPrestamo; Deta.NumCuota = Item.NumCuota; Deta.SaldoInicial = Item.SaldoInicial; Deta.Interes = Item.Interes; Deta.AbonoCapital = Item.AbonoCapital; Deta.TotalCuota = Item.TotalCuota; Deta.Saldo = Item.Saldo; Deta.FechaPago = Item.FechaPago; Deta.EstadoPago = Item.EstadoPago; Deta.Estado = Item.Estado; Deta.Observacion_det = Item.Observacion_det; Deta.IdUsuario = Item.IdUsuario; Deta.Fecha_Transac = Item.Fecha_Transac; Deta.nom_pc = Item.nom_pc; Deta.ip = Item.ip; Context.ba_prestamo_detalle.Add(Deta); Context.SaveChanges(); } } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public Boolean ReversaEstadoCanc(ba_prestamo_detalle_Info _Info, ref string msg) { try { Boolean res = false; try { using (EntitiesBanco Entity = new EntitiesBanco()) { ba_prestamo_detalle detalle = Entity.ba_prestamo_detalle.FirstOrDefault(v => v.IdPrestamo == _Info.IdPrestamo && v.NumCuota == _Info.NumCuota && v.IdEmpresa == _Info.IdEmpresa); if (detalle != null) { detalle.EstadoPago = "PEN"; Entity.SaveChanges(); res = true; } } return(res); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString() + " " + ex.Message; throw new Exception(ex.ToString()); } } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }