181 lines
8.1 KiB
C#
181 lines
8.1 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Data.Common;
|
|
|
|
using AyAEL.FNP;
|
|
using AyADAL;
|
|
|
|
namespace AyABL.FNP
|
|
{
|
|
public class EndeudamientoBL : AyABL
|
|
{
|
|
|
|
#region Constructores
|
|
|
|
public EndeudamientoBL()
|
|
{
|
|
objEndeudamientoEL = new EndeudamientoEL();
|
|
this.NombreTabla = Modulos.t_fnp_.ToString() + Tablas.endeudamiento.ToString();
|
|
this.NombreConeccionBD = BASESDEDATOS.FOPI.ToString();
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Atributos
|
|
|
|
public EndeudamientoEL objEndeudamientoEL { get; set; }
|
|
|
|
#endregion
|
|
|
|
#region Metodos
|
|
|
|
/// <summary>
|
|
/// Inluye los datos del Endeudamiento
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
|
|
public bool insertarEndeudamiento()
|
|
{
|
|
bool blnEjecutado = false;
|
|
|
|
this.CamposTabla = t_fnp_endeudamiento.MONTO.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
t_fnp_endeudamiento.PERIODOGRACIA.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
t_fnp_endeudamiento.PLAZO.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
t_fnp_endeudamiento.DESEMBOLSOINICIO.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
t_fnp_endeudamiento.DESEMBOLSOFIN.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
t_fnp_endeudamiento.TIPOCAMBIOCONTRATO.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
t_fnp_endeudamiento.FECHACONTRATO.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
t_fnp_endeudamiento.SITUACIONACTUAL.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
t_fnp_endeudamiento.TASA.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
Constraints.FK.ToString() + Tablas.fuentefinanciamiento.ToString().ToUpper() + ", " +
|
|
Constraints.FK.ToString() + Tablas.proyecto.ToString().ToUpper();
|
|
|
|
this.ValoresCampos = new object[]{objEndeudamientoEL.Monto,
|
|
objEndeudamientoEL.PeriodoGracia,
|
|
objEndeudamientoEL.Plazo,
|
|
objEndeudamientoEL.DesembolsoInicio,
|
|
objEndeudamientoEL.DesembolsoFin,
|
|
objEndeudamientoEL.TipoCambio,
|
|
objEndeudamientoEL.FechaContrato,
|
|
objEndeudamientoEL.SituacinActual,
|
|
objEndeudamientoEL.Tasa,
|
|
objEndeudamientoEL.FuenteFinanciamiento,
|
|
objEndeudamientoEL.Proyecto
|
|
};
|
|
|
|
baseDAL.Insertar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD);
|
|
|
|
blnEjecutado = true;
|
|
|
|
return blnEjecutado;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Actualiza el dato del Endeudamiento
|
|
/// </summary>
|
|
|
|
public bool actualizarEndeudamiento()
|
|
{
|
|
ArrayList arlCondiciones = new ArrayList();
|
|
bool blnEjecutado = false;
|
|
|
|
if (objEndeudamientoEL.PK != 0)
|
|
{
|
|
arlCondiciones.Add(this.buscarPorPK(objEndeudamientoEL.PK, Tablas.endeudamiento, operadorLogico.AND));
|
|
}
|
|
|
|
this.CamposTabla = t_fnp_endeudamiento.MONTO.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
t_fnp_endeudamiento.PERIODOGRACIA.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
t_fnp_endeudamiento.PLAZO.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
t_fnp_endeudamiento.DESEMBOLSOINICIO.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
t_fnp_endeudamiento.DESEMBOLSOFIN.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
t_fnp_endeudamiento.TIPOCAMBIOCONTRATO.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
t_fnp_endeudamiento.FECHACONTRATO.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
t_fnp_endeudamiento.SITUACIONACTUAL.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
t_fnp_endeudamiento.TASA.ToString() + Tablas.endeudamiento.ToString().ToUpper() + ", " +
|
|
Constraints.FK.ToString() + Tablas.fuentefinanciamiento.ToString().ToUpper() + ", " +
|
|
Constraints.FK.ToString() + Tablas.proyecto.ToString().ToUpper();
|
|
|
|
this.ValoresCampos = new object[]{objEndeudamientoEL.Monto,
|
|
objEndeudamientoEL.PeriodoGracia,
|
|
objEndeudamientoEL.Plazo,
|
|
objEndeudamientoEL.DesembolsoInicio,
|
|
objEndeudamientoEL.DesembolsoFin,
|
|
objEndeudamientoEL.TipoCambio,
|
|
objEndeudamientoEL.FechaContrato,
|
|
objEndeudamientoEL.SituacinActual,
|
|
objEndeudamientoEL.Tasa,
|
|
objEndeudamientoEL.FuenteFinanciamiento,
|
|
objEndeudamientoEL.Proyecto
|
|
};
|
|
|
|
baseDAL.Actualizar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD, arlCondiciones);
|
|
|
|
blnEjecutado = true;
|
|
|
|
return blnEjecutado;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Actualiza el estado del Endeudamiento
|
|
/// </summary>
|
|
|
|
public bool actualizaEstadoEndeudamiento()
|
|
{
|
|
ArrayList arlCondiciones = new ArrayList();
|
|
bool blnEjecutado = false;
|
|
|
|
if (objEndeudamientoEL.PK != 0)
|
|
{
|
|
arlCondiciones.Add(this.buscarPorPK(objEndeudamientoEL.PK, Tablas.endeudamiento, operadorLogico.AND));
|
|
}
|
|
|
|
this.CamposTabla = Concepto.ASTATE.ToString() + Tablas.endeudamiento.ToString();
|
|
|
|
this.ValoresCampos = new object[] { objEndeudamientoEL.ASTATE };
|
|
|
|
baseDAL.Actualizar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD, arlCondiciones);
|
|
|
|
blnEjecutado = true;
|
|
|
|
return blnEjecutado;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Lista los Endeudamientoes
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
|
|
public DataSet getEndeudamiento()
|
|
{
|
|
ArrayList arlCondiciones = new ArrayList();
|
|
|
|
if (this.objEndeudamientoEL.PK != 0)
|
|
{
|
|
arlCondiciones.Add(buscarPorPK(objEndeudamientoEL.PK, Tablas.endeudamiento, operadorLogico.AND));
|
|
}
|
|
|
|
if (this.objEndeudamientoEL.Proyecto != 0)
|
|
{
|
|
arlCondiciones.Add(buscarPorFK(objEndeudamientoEL.Proyecto, Tablas.proyecto, operadorLogico.AND));
|
|
}
|
|
|
|
NombreTabla = Vistas.v_endeudamiento.ToString();
|
|
|
|
DataSet dsEndeudamiento = baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arlCondiciones, null, " ORDER BY PKEndeudamiento ASC ");
|
|
|
|
return dsEndeudamiento;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Condiciones de Busqueda
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
}
|