146 lines
4.8 KiB
C#
146 lines
4.8 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Data;
|
|||
|
|
using System.Data.Common;
|
|||
|
|
|
|||
|
|
using AyAEL.PLE;
|
|||
|
|
using AyADAL;
|
|||
|
|
|
|||
|
|
namespace AyABL.PLE
|
|||
|
|
{
|
|||
|
|
public class PlanEstrategicoBL : AyABL
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
#region Constructores
|
|||
|
|
|
|||
|
|
public PlanEstrategicoBL()
|
|||
|
|
{
|
|||
|
|
objPlanEstrategicoEL = new PlanEstrategicoEL();
|
|||
|
|
this.NombreTabla = Modulos.t_ple_.ToString() + Tablas.planestrategico.ToString();
|
|||
|
|
this.NombreConeccionBD = BASESDEDATOS.FOPI.ToString();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region Atributos
|
|||
|
|
|
|||
|
|
public PlanEstrategicoEL objPlanEstrategicoEL { get; set; }
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region Metodos
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Inluye los datos del PlanEstrategico
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
|
|||
|
|
public bool insertarPlanEstrategico()
|
|||
|
|
{
|
|||
|
|
bool blnEjecutado = false;
|
|||
|
|
|
|||
|
|
this.CamposTabla = Concepto.DESCRIPCION.ToString() + Tablas.planestrategico.ToString().ToUpper() + ", " +
|
|||
|
|
t_ple_planestrategico.ANIOINICIO.ToString() + Tablas.planestrategico.ToString().ToUpper() + ", " +
|
|||
|
|
t_ple_planestrategico.ANIOFIN.ToString() + Tablas.planestrategico.ToString().ToUpper();
|
|||
|
|
|
|||
|
|
this.ValoresCampos = new object[]{objPlanEstrategicoEL.Descripcion,
|
|||
|
|
objPlanEstrategicoEL.AnioInicio,
|
|||
|
|
objPlanEstrategicoEL.AnioFin
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
baseDAL.Insertar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD, null);
|
|||
|
|
|
|||
|
|
blnEjecutado = true;
|
|||
|
|
|
|||
|
|
return blnEjecutado;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Actualiza el dato del PlanEstrategico
|
|||
|
|
/// </summary>
|
|||
|
|
|
|||
|
|
public bool actualizarPlanEstrategico()
|
|||
|
|
{
|
|||
|
|
ArrayList arlCondiciones = new ArrayList();
|
|||
|
|
bool blnEjecutado = false;
|
|||
|
|
|
|||
|
|
if (objPlanEstrategicoEL.PK != 0)
|
|||
|
|
{
|
|||
|
|
arlCondiciones.Add(this.buscarPorPK(objPlanEstrategicoEL.PK, Tablas.planestrategico, operadorLogico.AND));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
this.CamposTabla = Concepto.DESCRIPCION.ToString() + Tablas.planestrategico.ToString().ToUpper() + ", " +
|
|||
|
|
t_ple_planestrategico.ANIOINICIO.ToString() + Tablas.planestrategico.ToString().ToUpper() + ", " +
|
|||
|
|
t_ple_planestrategico.ANIOFIN.ToString() + Tablas.planestrategico.ToString().ToUpper();
|
|||
|
|
|
|||
|
|
this.ValoresCampos = new object[]{objPlanEstrategicoEL.Descripcion,
|
|||
|
|
objPlanEstrategicoEL.AnioInicio,
|
|||
|
|
objPlanEstrategicoEL.AnioFin
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
baseDAL.Actualizar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD, arlCondiciones);
|
|||
|
|
|
|||
|
|
blnEjecutado = true;
|
|||
|
|
|
|||
|
|
return blnEjecutado;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Actualiza el estado del PlanEstrategico
|
|||
|
|
/// </summary>
|
|||
|
|
|
|||
|
|
public bool actualizaEstadoPlanEstrategico()
|
|||
|
|
{
|
|||
|
|
ArrayList arlCondiciones = new ArrayList();
|
|||
|
|
bool blnEjecutado = false;
|
|||
|
|
|
|||
|
|
if (objPlanEstrategicoEL.PK != 0)
|
|||
|
|
{
|
|||
|
|
arlCondiciones.Add(this.buscarPorPK(objPlanEstrategicoEL.PK, Tablas.planestrategico, operadorLogico.AND));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
this.CamposTabla = Concepto.ASTATE.ToString() + Tablas.planestrategico.ToString();
|
|||
|
|
|
|||
|
|
this.ValoresCampos = new object[] { objPlanEstrategicoEL.ASTATE };
|
|||
|
|
|
|||
|
|
baseDAL.Actualizar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD, arlCondiciones);
|
|||
|
|
|
|||
|
|
blnEjecutado = true;
|
|||
|
|
|
|||
|
|
return blnEjecutado;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Lista los PlanEstrategicoes
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
|
|||
|
|
public DataSet getPlanEstrategico()
|
|||
|
|
{
|
|||
|
|
ArrayList arlCondiciones = new ArrayList();
|
|||
|
|
|
|||
|
|
if (this.objPlanEstrategicoEL.PK != 0)
|
|||
|
|
{
|
|||
|
|
arlCondiciones.Add(buscarPorPK(objPlanEstrategicoEL.PK, Tablas.planestrategico, operadorLogico.AND));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
arlCondiciones.Add(buscarPorAstate(true, Tablas.planestrategico, operadorLogico.NONE));
|
|||
|
|
|
|||
|
|
|
|||
|
|
DataSet dsPlanEstrategico = baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arlCondiciones, null, " ORDER BY PKPlanEstrategico ASC ");
|
|||
|
|
|
|||
|
|
return dsPlanEstrategico;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region Condiciones de Busqueda
|
|||
|
|
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|