151 lines
5.2 KiB
C#
151 lines
5.2 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Data.Common;
|
|
|
|
using AyAEL.CIP;
|
|
using AyADAL;
|
|
|
|
namespace AyABL.CIP
|
|
{
|
|
public class LeccionBL : AyABL
|
|
{
|
|
#region Constructores
|
|
|
|
public LeccionBL()
|
|
{
|
|
objLeccionEL = new LeccionEL();
|
|
this.NombreTabla = Modulos.t_cip_.ToString() + Tablas.leccion.ToString();
|
|
this.NombreConeccionBD = BASESDEDATOS.FOPI.ToString();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Atributos
|
|
|
|
public LeccionEL objLeccionEL { get; set; }
|
|
|
|
#endregion
|
|
|
|
#region Metodos
|
|
|
|
/// <summary>
|
|
/// Inluye los datos del Leccion
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
|
|
public int insertarLeccion()
|
|
{
|
|
this.CamposTabla = t_cip_leccion.EVENTO.ToString() + Tablas.leccion.ToString().ToUpper() + ", " +
|
|
t_cip_leccion.DESCRIPCION.ToString() + Tablas.leccion.ToString().ToUpper() + ", " +
|
|
Constraints.FK.ToString() + Tablas.cierre.ToString().ToUpper();
|
|
|
|
this.ValoresCampos = new object[]{objLeccionEL.Evento,
|
|
objLeccionEL.Descripcion,
|
|
objLeccionEL.Cierre
|
|
};
|
|
|
|
return baseDAL.Insertar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Actualiza el dato del Leccion
|
|
/// </summary>
|
|
|
|
public bool actualizarLeccion()
|
|
{
|
|
ArrayList arlCondiciones = new ArrayList();
|
|
bool blnEjecutado = false;
|
|
|
|
if (objLeccionEL.PK != 0)
|
|
{
|
|
arlCondiciones.Add(this.buscarPorPK(objLeccionEL.PK, Tablas.leccion, operadorLogico.AND));
|
|
arlCondiciones.Add(buscarPorAstate(true, Tablas.leccion, operadorLogico.AND));
|
|
}
|
|
|
|
this.CamposTabla = t_cip_leccion.EVENTO.ToString() + Tablas.leccion.ToString().ToUpper() + ", " +
|
|
t_cip_leccion.DESCRIPCION.ToString() + Tablas.leccion.ToString().ToUpper() + ", " +
|
|
Constraints.FK.ToString() + Tablas.cierre.ToString().ToUpper();
|
|
|
|
this.ValoresCampos = new object[]{objLeccionEL.Evento,
|
|
objLeccionEL.Descripcion,
|
|
objLeccionEL.Cierre
|
|
};
|
|
|
|
baseDAL.Actualizar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD, arlCondiciones);
|
|
|
|
blnEjecutado = true;
|
|
|
|
return blnEjecutado;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Actualiza el estado del Leccion
|
|
/// </summary>
|
|
|
|
public bool actualizaEstadoLeccion()
|
|
{
|
|
ArrayList arlCondiciones = new ArrayList();
|
|
bool blnEjecutado = false;
|
|
|
|
if (objLeccionEL.PK > 0)
|
|
{
|
|
arlCondiciones.Add(this.buscarPorPK(objLeccionEL.PK, Tablas.leccion, operadorLogico.AND));
|
|
arlCondiciones.Add(buscarPorAstate(true, Tablas.leccion, operadorLogico.AND));
|
|
}
|
|
|
|
this.CamposTabla = Concepto.ASTATE.ToString() + Tablas.leccion.ToString();
|
|
|
|
this.ValoresCampos = new object[] { objLeccionEL.ASTATE };
|
|
|
|
baseDAL.Actualizar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD, arlCondiciones);
|
|
|
|
blnEjecutado = true;
|
|
|
|
return blnEjecutado;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Lista los Lecciones
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
|
|
public DataSet getLeccion()
|
|
{
|
|
ArrayList arlCondiciones = new ArrayList();
|
|
|
|
arlCondiciones.Add(buscarPorFK(objLeccionEL.Cierre, Tablas.cierre, operadorLogico.AND));
|
|
arlCondiciones.Add(buscarPorAstate(true, Tablas.leccion, operadorLogico.AND));
|
|
|
|
DataSet dsLeccion = baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arlCondiciones, null, " ORDER BY PKLeccion ASC ");
|
|
|
|
return dsLeccion;
|
|
}
|
|
|
|
public DataSet getLeccion2()
|
|
{
|
|
ArrayList arlCondiciones = new ArrayList();
|
|
|
|
if (objLeccionEL.PK != 0)
|
|
arlCondiciones.Add(buscarPorPK(objLeccionEL.PK, Tablas.leccion, operadorLogico.AND));
|
|
|
|
if (this.objLeccionEL.Cierre != 0)
|
|
{
|
|
arlCondiciones.Add(buscarPorFK(objLeccionEL.Cierre, Tablas.cierre, operadorLogico.AND));
|
|
arlCondiciones.Add(buscarPorAstate(true, Tablas.leccion, operadorLogico.AND));
|
|
}
|
|
|
|
DataSet dsLeccion = baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arlCondiciones, null, " ORDER BY PKLeccion ASC ");
|
|
|
|
return dsLeccion;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Condiciones de Busqueda
|
|
|
|
|
|
#endregion
|
|
}
|
|
}
|