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()); } }
//MIGRADO ba_prestamo_detalle_cancelacion public Boolean ActualizarDetallePrestamosCancelados(ba_prestamo_detalle_Info Info, ref string msg) { try { using (EntitiesBanco Entity = new EntitiesBanco()) { ba_prestamo_detalle_cancelacion cancelacion = Entity.ba_prestamo_detalle_cancelacion.FirstOrDefault(v => v.IdPrestamo == Info.IdPrestamo && v.IdEmpresa == Info.IdEmpresa && v.NumCuota == Info.NumCuota && v.Secuencia == Info.Secuencia); if (cancelacion != null) { cancelacion.FechaPago = Info.FechaPago; cancelacion.Observacion_canc = Info.Observacion_canc; 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; msg = ex.Message + ex.ToString(); throw new Exception(ex.ToString()); } }
public Boolean CancelarEstadoDetallePrestamo(ba_prestamo_detalle_Info info, ref string msg) { try { using (EntitiesBanco context = new EntitiesBanco()) { var contact = context.ba_prestamo_detalle.FirstOrDefault(VProdu => VProdu.IdEmpresa == info.IdEmpresa && VProdu.IdPrestamo == info.IdPrestamo && VProdu.NumCuota == info.NumCuota); if (contact != null) { contact.EstadoPago = "CAN"; 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.ToString() + " " + ex.Message; msg = "Error al Grabar" + ex.InnerException; throw new Exception(ex.ToString()); } }
public Boolean GuardarDetallePrestamosCancelados(ba_prestamo_detalle_Info info, ref string msg) { try { Boolean res = true; //grabar diario de la nota de debito ct_Cbtecble_Bus CbteCble_B = new ct_Cbtecble_Bus(); decimal idCbteCble = 0; string cod_CbteCble = ""; ct_Cbtecble_Info CbteCble = info.Info_CbteCble; if (CbteCble_B.GrabarDB(CbteCble, ref idCbteCble, ref msg)) { // grabar en tabla ba_Cbte_Ban ba_Cbte_Ban_Info CbteBan = info.Info_CbteBan; CbteBan.IdCbteCble = idCbteCble; ba_Cbte_Ban_Bus CbteBan_B = new ba_Cbte_Ban_Bus(); if (CbteBan_B.GrabarDB(CbteBan, ref msg)) { if (oData.GuardarDetallePrestamosCancelados(info, ref msg)) { ba_prestamo_detalle_Data odata = new ba_prestamo_detalle_Data(); if (!odata.CancelarEstadoDetallePrestamo(info, ref msg)) { res = false; } } else { res = false; } } else { res = false; } } else { res = false; } return(res); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "GuardarDetallePrestamosCancelados", ex.Message), ex) { EntityType = typeof(ba_prestamo_detalle_cancelacion_Bus) }; } }
private Boolean fx_Verificar_Reg_Repetidos(ba_prestamo_detalle_Info Info_det, Boolean eliminar, int tipo) { try {/* * int cont = 0; * * * * if (banderaCargaBatch) * { * cont = (from C in BindList_Ing_egr_inve_det * where C.cod_producto == Info_det.cod_producto * && C.dm_cantidad == Info_det.dm_cantidad * && C.mv_costo == Info_det.mv_costo * select C).Count(); * } * else * { * cont = (from C in lista_IngEgrInv * where C.cod_producto == Info_det.cod_producto * && C.dm_cantidad == Info_det.dm_cantidad * && C.mv_costo == Info_det.mv_costo * select C).Count(); * } * * * if (cont == tipo) * { * return true; * } * else * { * if (eliminar == true) * { * gridViewProductos.DeleteRow(gridViewProductos.FocusedRowHandle); * MessageBox.Show("El producto con la misma cantidad y costo ya se encuentra ingresado, se procederá con su eliminación.", "ATENCION", MessageBoxButtons.OK, MessageBoxIcon.Warning); * } * else * { * MessageBox.Show("El producto ya se encuentra ingresado.", "ATENCION", MessageBoxButtons.OK, MessageBoxIcon.Stop); * } * return false; * * } * */ return(true); } catch (Exception ex) { MessageBox.Show(ex.ToString()); Log_Error_bus.Log_Error(ex.ToString()); return(false); } }
public Boolean AnularDetallePrestamo(ba_prestamo_detalle_Info _Info) { try { return(oData.AnularDetallePrestamo(_Info)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "AnularDetallePrestamo", ex.Message), ex) { EntityType = typeof(ba_prestamo_detalle_Bus) }; } }
public Boolean CancelarEstadoDetallePrestamo(ba_prestamo_detalle_Info info, ref string msg) { try { return(oData.CancelarEstadoDetallePrestamo(info, ref msg)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "CancelarEstadoDetallePrestamo", ex.Message), ex) { EntityType = typeof(ba_prestamo_detalle_Bus) }; } }
public Boolean ActualizarDetallePrestamosCancelados(ba_prestamo_detalle_Info Info, ref string msg) { try { return(oData.ActualizarDetallePrestamosCancelados(Info, ref msg)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "ActualizarDetallePrestamosCancelados", ex.Message), ex) { EntityType = typeof(ba_prestamo_detalle_cancelacion_Bus) }; } }
// MIGRADO ba_prestamo_detalle_cancelacion public Boolean AnularDetallePrestamosCancelados(ba_prestamo_detalle_Info Info, ref string msg) { try { Boolean resu = false; try { using (EntitiesBanco Entity = new EntitiesBanco()) { ba_prestamo_detalle_cancelacion cancelacion = Entity.ba_prestamo_detalle_cancelacion.First(v => v.IdPrestamo == Info.IdPrestamo && v.IdEmpresa == Info.IdEmpresa && v.NumCuota == Info.NumCuota && v.Secuencia == Info.Secuencia); if (cancelacion != null) { cancelacion.Monto_Canc = 0; cancelacion.Observacion_canc = "**ANULADO**" + Info.Observacion_canc; cancelacion.MotiAnula = Info.MotiAnula; cancelacion.IdUsuarioUltAnu = Info.IdUsuarioUltAnu; cancelacion.Fecha_UltAnu = Info.Fecha_UltAnu; Entity.SaveChanges(); resu = true; } } return(resu); } 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; msg = ex.Message + ex.ToString(); 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()); } }
private void gridViewCancelacion_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e) { try { ba_prestamo_detalle_Info Info_DetPrest = (ba_prestamo_detalle_Info)gridViewCancelacion.GetFocusedRow(); if (Info_DetPrest != null) { e.HitInfo.Column.FieldName = gridViewCancelacion.FocusedColumn.FieldName; } if (e.HitInfo.Column.FieldName == "Check") { if ((bool)gridViewCancelacion.GetFocusedRowCellValue(colCheck)) { gridViewCancelacion.SetFocusedRowCellValue(colCheck, false); } else { foreach (var item in BindLstPrestamo) { if (item.chek_aux == 1) { item.Check = false; item.chek_aux = 0; } } gridControlCancelacion.RefreshDataSource(); gridViewCancelacion.SetFocusedRowCellValue(colCheck, true); gridViewCancelacion.SetFocusedRowCellValue(colchek_aux, 1); } } } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.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()); } }
private void btn_guardar_Click(object sender, EventArgs e) { try { FrmBA_Cancelacion_Cuotas frm = new FrmBA_Cancelacion_Cuotas(); Info_DetPrest = BindLstPrestamo.FirstOrDefault(q => q.Check == true); if (Info_DetPrest == null) { MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Seleccione_un_registro), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } frm.Info_DetPrestamo = Info_DetPrest; frm.ShowDialog(); } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); } }
public void GET_Editar_o_Anular(ba_prestamo_detalle_Info info) { try { BindLstPrestamo = new BindingList <ba_prestamo_detalle_Info>(); BindLstPrestamo.Add(info); gridControlCancelacion.DataSource = BindLstPrestamo; colMonto_Canc.OptionsColumn.AllowEdit = false; colMonto_Canc.Caption = "Monto Cancelado"; if (tipollamada == "Editar") { lblEtiq.Text = "- Solo es editable la fecha y observación."; } if (tipollamada == "Anular") { if (info.Monto_x_Canc == 0) { lblAnulado.Visible = true; MessageBox.Show("El pago ya se encuentra anulado."); btnAnular.Enabled = false; } } if (tipollamada == "Editar") { if (info.Monto_x_Canc == 0) { lblAnulado.Visible = true; MessageBox.Show("No se puede editar un pago anulado."); btn_guardar.Enabled = false; btnGuardarSalir.Enabled = false; } } } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); } }
public Boolean ModificarDetallePrestamo(ba_prestamo_detalle_Info prI, ref string msg) { try { using (EntitiesBanco context = new EntitiesBanco()) { var contact = context.ba_prestamo_detalle.FirstOrDefault(VProdu => VProdu.IdEmpresa == prI.IdEmpresa && VProdu.IdPrestamo == prI.IdPrestamo && VProdu.NumCuota == prI.NumCuota); if (contact != null) { contact.NumCuota = prI.NumCuota; contact.SaldoInicial = prI.SaldoInicial; contact.Interes = prI.Interes; contact.AbonoCapital = prI.AbonoCapital; contact.TotalCuota = prI.TotalCuota; contact.Saldo = prI.Saldo; contact.FechaPago = prI.FechaPago; contact.EstadoPago = prI.EstadoPago; contact.Observacion_det = prI.Observacion_det; context.SaveChanges(); msg = "Se ha procedido a Actualizar la Información Exitosamente..."; } } 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; msg = "Error al Grabar" + ex.ToString(); throw new Exception(ex.ToString()); } }
public Boolean GuardarDetallePrestamosCancelados(ba_prestamo_detalle_Info Info, ref string msg) { try { Boolean resu = false; try { using (EntitiesBanco context = new EntitiesBanco()) { //foreach (var item in Listado) //{ ba_prestamo_detalle_cancelacion reg = new ba_prestamo_detalle_cancelacion(); reg.IdEmpresa = Info.IdEmpresa; reg.IdPrestamo = Info.IdPrestamo; reg.FechaPago = Info.FechaPago; reg.Monto_Canc = Convert.ToDouble(Info.Monto_Canc); reg.NumCuota = Info.NumCuota; reg.Saldo = Info.Saldo; reg.Observacion_canc = Info.Observacion_canc; reg.Secuencia = Get_Secuencia(Info.IdEmpresa, Info.IdPrestamo, Info.NumCuota); if (reg.Secuencia == 0) { mensaje = "Error al Obtener la Secuencia de Pago"; return(false); } reg.Fecha_Transac = Info.Fecha_Transac; reg.IdUsuario = Info.IdUsuario; reg.ip = Info.ip; reg.nom_pc = Info.nom_pc; context.ba_prestamo_detalle_cancelacion.Add(reg); // } context.SaveChanges(); } return(resu = 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; msg = ex.Message + ex.InnerException; throw new Exception(ex.InnerException.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()); } }