139 lines
4.6 KiB
C#
139 lines
4.6 KiB
C#
using AyADAL;
|
|
using AyAEL.SEP;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace AyABL.SEP
|
|
{
|
|
public class PeriodoPublicacionBL : AyABL
|
|
{
|
|
#region Constructores
|
|
|
|
public PeriodoPublicacionBL()
|
|
{
|
|
objPeriodoPublicacionEL = new PeriodoPublicacionEL();
|
|
this.NombreTabla = Modulos.t_sep_.ToString() + Tablas.periodopublicacion.ToString();
|
|
this.NombreConeccionBD = BASESDEDATOS.FOPI.ToString();
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Atributos
|
|
|
|
public PeriodoPublicacionEL objPeriodoPublicacionEL { get; set; }
|
|
|
|
#endregion
|
|
|
|
#region Metodos
|
|
|
|
/// <summary>
|
|
/// Inluye los datos del PeriodoPublicacion
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
|
|
public int insertarPeriodoPublicacion()
|
|
{
|
|
int intEjecutado = 0;
|
|
|
|
this.CamposTabla = t_sep_periodopublicacion.FECHAINICIO.ToString() + Tablas.periodopublicacion.ToString().ToUpper() + ", " +
|
|
t_sep_periodopublicacion.FECHACIERRE.ToString() + Tablas.periodopublicacion.ToString().ToUpper() + ", ";
|
|
|
|
this.ValoresCampos = new object[]{objPeriodoPublicacionEL.FechaInicio,
|
|
objPeriodoPublicacionEL.FechaCierre,
|
|
};
|
|
|
|
intEjecutado = baseDAL.Insertar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD);
|
|
|
|
return intEjecutado;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Actualiza el dato del PeriodoPublicacion
|
|
/// </summary>
|
|
|
|
public bool actualizarPeriodo()
|
|
{
|
|
ArrayList arlCondiciones = new ArrayList();
|
|
bool blnEjecutado = false;
|
|
|
|
if (objPeriodoPublicacionEL.PK != 0)
|
|
{
|
|
arlCondiciones.Add(this.buscarPorPK(objPeriodoPublicacionEL.PK, Tablas.periodopublicacion, operadorLogico.AND));
|
|
}
|
|
|
|
this.CamposTabla = t_sep_periodopublicacion.FECHAINICIO.ToString() + Tablas.periodopublicacion.ToString().ToUpper() + ", " +
|
|
t_sep_periodopublicacion.FECHACIERRE.ToString() + Tablas.periodopublicacion.ToString().ToUpper() + ", ";
|
|
|
|
this.ValoresCampos = new object[]{objPeriodoPublicacionEL.FechaInicio,
|
|
objPeriodoPublicacionEL.FechaCierre
|
|
};
|
|
|
|
baseDAL.Actualizar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD, arlCondiciones);
|
|
|
|
blnEjecutado = true;
|
|
|
|
return blnEjecutado;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Actualiza el estado del PeriodoPublicacion
|
|
/// </summary>
|
|
|
|
public bool actualizaEstadoPeriodoPublicacion()
|
|
{
|
|
ArrayList arlCondiciones = new ArrayList();
|
|
bool blnEjecutado = false;
|
|
|
|
if (objPeriodoPublicacionEL.PK != 0)
|
|
{
|
|
arlCondiciones.Add(this.buscarPorPK(objPeriodoPublicacionEL.PK, Tablas.periodopublicacion, operadorLogico.AND));
|
|
}
|
|
|
|
this.CamposTabla = Concepto.ASTATE.ToString() + Tablas.periodopublicacion.ToString();
|
|
|
|
this.ValoresCampos = new object[] { objPeriodoPublicacionEL.ASTATE = false };
|
|
|
|
baseDAL.Actualizar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD, arlCondiciones);
|
|
|
|
blnEjecutado = true;
|
|
|
|
return blnEjecutado;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Lista los PeriodoPublicaciones
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
|
|
public DataSet getPeriodoPublicacion()
|
|
{
|
|
ArrayList arlCondiciones = new ArrayList();
|
|
|
|
if (this.objPeriodoPublicacionEL.PK != 0)
|
|
{
|
|
arlCondiciones.Add(buscarPorPK(objPeriodoPublicacionEL.PK, Tablas.periodopublicacion, operadorLogico.AND));
|
|
}
|
|
|
|
arlCondiciones.Add(buscarPorAstate(true, Tablas.periodopublicacion, operadorLogico.NONE));
|
|
|
|
|
|
DataSet dsPeriodoPublicacion = baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arlCondiciones, null, " ORDER BY PKPERIODOPUBLICACION DESC ");
|
|
|
|
return dsPeriodoPublicacion;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Condiciones de Busqueda
|
|
|
|
|
|
#endregion
|
|
}
|
|
}
|
|
|