113 lines
3.2 KiB
C#
113 lines
3.2 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Data.Common;
|
|
using System.Configuration;
|
|
using AyAEL.MANT;
|
|
using AyADAL;
|
|
using System.Collections.Specialized;
|
|
using AyABL.Usuario;
|
|
using AyABL.AUT.Autenticacion;
|
|
|
|
namespace AyABL.Usuario
|
|
{
|
|
public class cantonBL : AyABL
|
|
{
|
|
#region Constructores
|
|
|
|
public cantonBL()
|
|
{
|
|
objcantonEL = new cantonEL();
|
|
this.NombreTabla = Modulos.t_adm_.ToString() + Tablas.canton.ToString();
|
|
this.NombreConeccionBD = BASESDEDATOS.SIRCHA.ToString();
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Atributos
|
|
|
|
public cantonEL objcantonEL
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
private static NameValueCollection appSettings = ConfigurationManager.AppSettings;
|
|
|
|
#endregion
|
|
|
|
#region Metodos
|
|
|
|
public DataSet dsListaCantones(ArrayList arlCondicionesFiltroBusqueda)
|
|
{
|
|
try
|
|
{
|
|
ArrayList arlCondiciones = new ArrayList();
|
|
this.cargarCondicionBusqueda(arlCondiciones, arlCondicionesFiltroBusqueda);
|
|
|
|
if (objcantonEL.FKPROVINCIA != 0)
|
|
{
|
|
arlCondiciones.Add(this.buscarPorProvincia(objcantonEL.FKPROVINCIA, operadorLogico.AND));
|
|
}
|
|
|
|
|
|
|
|
return baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arlCondiciones,
|
|
null, "ORDER BY PKCANTON ASC");
|
|
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public DataSet dsListaCanton(ArrayList arlCondicionesFiltroBusqueda)
|
|
{
|
|
try
|
|
{
|
|
ArrayList arlCondiciones = new ArrayList();
|
|
this.cargarCondicionBusqueda(arlCondiciones, arlCondicionesFiltroBusqueda);
|
|
|
|
if (objcantonEL.FKPROVINCIA != 0)
|
|
{
|
|
arlCondiciones.Add(this.buscarPorProvincia(objcantonEL.FKPROVINCIA, operadorLogico.AND));
|
|
}
|
|
|
|
|
|
|
|
return baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arlCondiciones,
|
|
null, "ORDER BY PKCANTON ASC");
|
|
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Condiciones de Busqueda
|
|
/// <summary>
|
|
/// Devuelve la condicion de busqueda por Login
|
|
/// </summary>
|
|
/// <param name="p_nProvinicia"></param>
|
|
/// <param name="operador"></param>
|
|
private CondicionDAL buscarPorProvincia(int p_nProvinicia, operadorLogico operador)
|
|
{
|
|
CondicionDAL cdlCondicion = new CondicionDAL();
|
|
cdlCondicion.valorIzquierdo = t_adm_canton.FKPROVINCIA.ToString() ;
|
|
cdlCondicion.operadorGeneral = operadorGeneral.EQUAL;
|
|
cdlCondicion.operadorLogico = operador;
|
|
cdlCondicion.valorDerecho = p_nProvinicia;
|
|
return cdlCondicion;
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
}
|