138 lines
5.4 KiB
C#
138 lines
5.4 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: AyABL.Usuario.caudalBL
|
|
// Assembly: AyABL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
|
// MVID: 0F2FF6EC-B53C-44DB-9E00-2F932BF80762
|
|
// Assembly location: C:\Users\EQUIPO\Downloads\Raiz\Raiz\bin\AyABL.dll
|
|
|
|
using AyADAL;
|
|
using AyAEL.MANT;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Specialized;
|
|
using System.Configuration;
|
|
using System.Data;
|
|
|
|
namespace AyABL.Usuario
|
|
{
|
|
public class caudalBL : AyABL
|
|
{
|
|
private static NameValueCollection appSettings = ConfigurationManager.AppSettings;
|
|
|
|
public caudalBL()
|
|
{
|
|
this.objcaudalEL = new caudalEL();
|
|
this.NombreTabla = Modulos.t_adm_.ToString() + Tablas.caudal.ToString();
|
|
this.NombreConeccionBD = BASESDEDATOS.SIGDD.ToString();
|
|
}
|
|
|
|
public caudalEL objcaudalEL { get; set; }
|
|
|
|
public int insertarCaudal()
|
|
{
|
|
try
|
|
{
|
|
this.CamposTabla = t_adm_caudal.ASTATE.ToString() + Tablas.caudal.ToString() + "," + Constraints.FK.ToString() + Tablas.proyecto.ToString() + "," + Constraints.FK.ToString() + Tablas.tipoinspeccion.ToString() + "," + t_adm_caudal.FECHA.ToString() + Tablas.caudal.ToString() + "," + t_adm_caudal.USUARIO.ToString() + Tablas.caudal.ToString();
|
|
this.ValoresCampos = new object[5]
|
|
{
|
|
(object) Convert.ToInt16((object) this.objcaudalEL.Activo),
|
|
(object) this.objcaudalEL.FKPROYECTO,
|
|
(object) this.objcaudalEL.FKTIPOINSPECCION,
|
|
(object) this.objcaudalEL.Fecha,
|
|
(object) this.objcaudalEL.USUARIO
|
|
};
|
|
return this.baseDAL.Insertar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public int modificarCaudal()
|
|
{
|
|
try
|
|
{
|
|
ArrayList p_arlCondiciones = new ArrayList();
|
|
p_arlCondiciones.Add((object) this.buscarPorPKCAUDAL(this.objcaudalEL.PK, operadorLogico.NONE));
|
|
this.CamposTabla = t_adm_caudal.ASTATE.ToString() + Tablas.caudal.ToString() + "," + Constraints.FK.ToString() + Tablas.proyecto.ToString() + "," + Constraints.FK.ToString() + Tablas.tipoinspeccion.ToString() + "," + t_adm_caudal.FECHA.ToString() + Tablas.caudal.ToString() + "," + t_adm_caudal.USUARIO.ToString() + Tablas.caudal.ToString();
|
|
this.ValoresCampos = new object[5]
|
|
{
|
|
(object) Convert.ToInt16((object) this.objcaudalEL.Activo),
|
|
(object) this.objcaudalEL.FKPROYECTO,
|
|
(object) this.objcaudalEL.FKTIPOINSPECCION,
|
|
(object) this.objcaudalEL.Fecha,
|
|
(object) this.objcaudalEL.USUARIO
|
|
};
|
|
return this.baseDAL.Actualizar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD, p_arlCondiciones);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public DataSet listarCaudal(
|
|
ArrayList arlCondicionesFiltroBusqueda,
|
|
bool buscarPorASTATE,
|
|
string p_strPrefijoDependencia)
|
|
{
|
|
try
|
|
{
|
|
ArrayList arrayList = new ArrayList();
|
|
this.cargarCondicionBusqueda(arrayList, arlCondicionesFiltroBusqueda);
|
|
int? pk = this.objcaudalEL.PK;
|
|
if ((pk.GetValueOrDefault() != 0 ? 1 : (!pk.HasValue ? 1 : 0)) != 0)
|
|
arrayList.Add((object) this.buscarPorPK(this.objcaudalEL.PK, Tablas.caudal, operadorLogico.AND));
|
|
if (buscarPorASTATE)
|
|
arrayList.Add((object) this.buscarPorActivo(new bool?(this.objcaudalEL.ASTATE), Tablas.caudal, operadorLogico.NONE));
|
|
return this.baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arrayList, (string) null, "ORDER BY PKCAUDAL DESC");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public DataSet dsListaCaudal(ArrayList arlCondicionesFiltroBusqueda)
|
|
{
|
|
try
|
|
{
|
|
ArrayList arrayList = new ArrayList();
|
|
this.cargarCondicionBusqueda(arrayList, arlCondicionesFiltroBusqueda);
|
|
int? pk = this.objcaudalEL.PK;
|
|
if ((pk.GetValueOrDefault() != 0 ? 1 : (!pk.HasValue ? 1 : 0)) != 0 && this.objcaudalEL.PK.HasValue)
|
|
arrayList.Add((object) this.buscarPorPK(this.objcaudalEL.PK, Tablas.caudal, operadorLogico.AND));
|
|
if (this.objcaudalEL.Activo.HasValue)
|
|
arrayList.Add((object) this.buscarPorActivo(this.objcaudalEL.Activo, Tablas.caudal, operadorLogico.NONE));
|
|
this.NombreTabla = Vistas.v_tipoproyecto.ToString();
|
|
return this.baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arrayList, (string) null, (string) null);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
private CondicionDAL buscarPorPKCAUDAL(int? p_nPKCAUDAL, operadorLogico operador)
|
|
{
|
|
return new CondicionDAL()
|
|
{
|
|
valorIzquierdo = Constraints.PK.ToString() + Tablas.caudal.ToString(),
|
|
operadorGeneral = operadorGeneral.EQUAL,
|
|
operadorLogico = operador,
|
|
valorDerecho = (object) p_nPKCAUDAL
|
|
};
|
|
}
|
|
|
|
private CondicionDAL buscarPorPKCAUDAL(bool p_blnactivo, operadorLogico operador)
|
|
{
|
|
return new CondicionDAL()
|
|
{
|
|
valorIzquierdo = t_adm_caudal.ASTATE.ToString() + Tablas.caudal.ToString(),
|
|
operadorGeneral = operadorGeneral.EQUAL,
|
|
operadorLogico = operador,
|
|
valorDerecho = (object) p_blnactivo
|
|
};
|
|
}
|
|
}
|
|
}
|