96 lines
2.9 KiB
C#
96 lines
2.9 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Data.Common;
|
|
|
|
using AyABL.AUT;
|
|
using AyAEL.APL;
|
|
using AyADAL;
|
|
|
|
|
|
namespace AyABL.APL
|
|
{
|
|
public class ComandoBL : AyABL
|
|
{
|
|
#region Constructores
|
|
|
|
public ComandoBL()
|
|
{
|
|
objComandoEL = new ComandoEL();
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Atributos
|
|
|
|
public ComandoEL objComandoEL { get; set; }
|
|
|
|
DbParameter[] dbpParametros;
|
|
DbProviderFactory dpfConector = DbProviderFactories.GetFactory("System.Data.SqlClient");
|
|
|
|
#endregion
|
|
|
|
#region Metodos
|
|
|
|
/// <summary>
|
|
/// Se utiliza para listar los registros de la tabla
|
|
/// </summary>
|
|
/// <param name="p_objComandoEL"></param>
|
|
/// <returns></returns>
|
|
|
|
public DataSet dsComandoxMenu(ComandoEL p_objComandoEL)
|
|
{
|
|
|
|
try
|
|
{
|
|
this.NombreTabla = Vistas.v_comandosxitemmenu.ToString();
|
|
|
|
ArrayList arlCondiciones = new ArrayList();
|
|
|
|
arlCondiciones.Add(buscarPorPK(Convert.ToInt32(p_objComandoEL.ItemMenu), Tablas.ITEMMENU, operadorLogico.AND));
|
|
arlCondiciones.Add(buscarPorAplicacion(Convert.ToInt32(p_objComandoEL.Aplicacion), operadorLogico.NONE));
|
|
|
|
return baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arlCondiciones,
|
|
null, null);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region Condiciones
|
|
|
|
/// <summary>
|
|
/// Devuelve la condicion de busqueda por la Pk de Comandos
|
|
/// </summary>
|
|
/// <param name="p_intPkComando"></param>
|
|
/// <param name="operador"></param>
|
|
|
|
private CondicionDAL buscarPorAplicacion(Nullable<int> p_intPkAplicacion, operadorLogico operador)
|
|
{
|
|
CondicionDAL cdlCondicion = new CondicionDAL();
|
|
cdlCondicion.valorIzquierdo = Constraints.FK.ToString() + Tablas.APLICACION.ToString();
|
|
cdlCondicion.operadorGeneral = operadorGeneral.EQUAL;
|
|
cdlCondicion.operadorLogico = operador;
|
|
cdlCondicion.valorDerecho = p_intPkAplicacion;
|
|
return cdlCondicion;
|
|
}
|
|
|
|
private CondicionDAL buscarPorRol(Nullable<int> p_intPkRol, operadorLogico operador)
|
|
{
|
|
CondicionDAL cdlCondicion = new CondicionDAL();
|
|
cdlCondicion.valorIzquierdo = Constraints.PK.ToString() + Tablas.ROL.ToString();
|
|
cdlCondicion.operadorGeneral = operadorGeneral.EQUAL;
|
|
cdlCondicion.operadorLogico = operador;
|
|
cdlCondicion.valorDerecho = p_intPkRol;
|
|
return cdlCondicion;
|
|
}
|
|
|
|
#endregion
|
|
|
|
}
|
|
}
|