140 lines
4.8 KiB
C#
140 lines
4.8 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Data.Common;
|
|
|
|
using AyAEL.IGP;
|
|
using AyADAL;
|
|
|
|
namespace AyABL.IGP
|
|
{
|
|
public class InformacionGeneralBL : AyABL
|
|
{
|
|
#region Constructores
|
|
|
|
public InformacionGeneralBL()
|
|
{
|
|
objInformacionGeneralEL = new InformacionGeneralEL();
|
|
this.NombreTabla = Modulos.t_igp_.ToString() + Tablas.informaciongeneral.ToString();
|
|
this.NombreConeccionBD = BASESDEDATOS.FOPI.ToString();
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Atributos
|
|
|
|
public InformacionGeneralEL objInformacionGeneralEL { get; set; }
|
|
|
|
#endregion
|
|
|
|
#region Metodos
|
|
|
|
/// <summary>
|
|
/// Inluye los datos del InformacionGeneral
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
|
|
public int insertarInformacionGeneral()
|
|
{
|
|
int intEjecutado = 0;
|
|
|
|
this.CamposTabla = t_igp_informaciongeneral.ENCARGADO.ToString() + Tablas.informaciongeneral.ToString().ToUpper() + ", " +
|
|
Constraints.FK.ToString() + Tablas.region.ToString().ToUpper() + ", " +
|
|
Constraints.FK.ToString() + Tablas.proyecto.ToString().ToUpper();
|
|
|
|
this.ValoresCampos = new object[]{objInformacionGeneralEL.Encargado,
|
|
objInformacionGeneralEL.Region,
|
|
objInformacionGeneralEL.Proyecto
|
|
};
|
|
|
|
intEjecutado = baseDAL.Insertar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD);
|
|
|
|
return intEjecutado;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Actualiza el dato del InformacionGeneral
|
|
/// </summary>
|
|
|
|
public bool actualizarInformacionGeneral()
|
|
{
|
|
ArrayList arlCondiciones = new ArrayList();
|
|
bool blnEjecutado = false;
|
|
|
|
if (objInformacionGeneralEL.Proyecto != 0)
|
|
{
|
|
arlCondiciones.Add(this.buscarPorFK(objInformacionGeneralEL.Proyecto, Tablas.proyecto, operadorLogico.AND));
|
|
}
|
|
|
|
this.CamposTabla = t_igp_informaciongeneral.ENCARGADO.ToString() + Tablas.informaciongeneral.ToString().ToUpper() + ", " +
|
|
Constraints.FK.ToString() + Tablas.region.ToString().ToUpper() + ", " +
|
|
Constraints.FK.ToString() + Tablas.proyecto.ToString().ToUpper();
|
|
|
|
this.ValoresCampos = new object[]{objInformacionGeneralEL.Encargado,
|
|
objInformacionGeneralEL.Region,
|
|
objInformacionGeneralEL.Proyecto
|
|
};
|
|
|
|
baseDAL.Actualizar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD, arlCondiciones);
|
|
|
|
blnEjecutado = true;
|
|
|
|
return blnEjecutado;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Actualiza el estado del InformacionGeneral
|
|
/// </summary>
|
|
|
|
public bool actualizaEstadoInformacionGeneral()
|
|
{
|
|
ArrayList arlCondiciones = new ArrayList();
|
|
bool blnEjecutado = false;
|
|
|
|
if (objInformacionGeneralEL.PK != 0)
|
|
{
|
|
arlCondiciones.Add(this.buscarPorPK(objInformacionGeneralEL.PK, Tablas.informaciongeneral, operadorLogico.AND));
|
|
}
|
|
|
|
this.CamposTabla = Concepto.ASTATE.ToString() + Tablas.informaciongeneral.ToString();
|
|
|
|
this.ValoresCampos = new object[] { objInformacionGeneralEL.ASTATE };
|
|
|
|
baseDAL.Actualizar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD, arlCondiciones);
|
|
|
|
blnEjecutado = true;
|
|
|
|
return blnEjecutado;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Lista los InformacionGenerales
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
|
|
public DataSet getInformacionGeneral()
|
|
{
|
|
ArrayList arlCondiciones = new ArrayList();
|
|
|
|
if (this.objInformacionGeneralEL.Proyecto != 0)
|
|
{
|
|
arlCondiciones.Add(buscarPorFK(objInformacionGeneralEL.Proyecto, Tablas.proyecto, operadorLogico.AND));
|
|
}
|
|
|
|
NombreTabla = Vistas.v_informaciongeneral.ToString();
|
|
|
|
DataSet dsInformacionGeneral = baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arlCondiciones, null, " ORDER BY PKInformacionGeneral ASC ");
|
|
|
|
return dsInformacionGeneral;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Condiciones de Busqueda
|
|
|
|
|
|
#endregion
|
|
}
|
|
}
|