340 lines
15 KiB
C#
340 lines
15 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: AyABL.Usuario.ActividadesBL
|
|
// 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 ActividadesBL : AyABL
|
|
{
|
|
private static NameValueCollection appSettings = ConfigurationManager.AppSettings;
|
|
|
|
public ActividadesBL()
|
|
{
|
|
this.objactividadesEL = new actividadesEL();
|
|
this.NombreTabla = Modulos.t_adm_.ToString() + Tablas.actividad.ToString();
|
|
this.NombreConeccionBD = BASESDEDATOS.SIGDD.ToString();
|
|
}
|
|
|
|
public actividadesEL objactividadesEL { get; set; }
|
|
|
|
public int insertarActividad()
|
|
{
|
|
try
|
|
{
|
|
this.CamposTabla = t_adm_actividad.NOMBRE.ToString() + Tablas.actividad.ToString() + "," + t_adm_actividad.DESCRIPCION.ToString() + Tablas.actividad.ToString() + "," + t_adm_actividad.PARALELO.ToString() + Tablas.actividad.ToString() + "," + t_adm_actividad.TIEMPOCV.ToString() + Tablas.actividad.ToString() + "," + t_adm_actividad.TIEMPODU.ToString() + Tablas.actividad.ToString() + "," + t_adm_actividad.ASTATE.ToString() + Tablas.actividad.ToString();
|
|
this.ValoresCampos = new object[6]
|
|
{
|
|
(object) this.objactividadesEL.NOMBRE,
|
|
(object) this.objactividadesEL.DESCRIPCION,
|
|
(object) this.objactividadesEL.PARALELO,
|
|
(object) this.objactividadesEL.TIEMPOCV,
|
|
(object) this.objactividadesEL.TIEMPODU,
|
|
(object) Convert.ToInt16(this.objactividadesEL.ASTATE)
|
|
};
|
|
return this.baseDAL.Insertar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public int modificarActividad()
|
|
{
|
|
try
|
|
{
|
|
ArrayList p_arlCondiciones = new ArrayList();
|
|
p_arlCondiciones.Add((object) this.buscarPorPKACTIVIDAD(this.objactividadesEL.PK, operadorLogico.NONE));
|
|
this.CamposTabla = t_adm_actividad.NOMBRE.ToString() + Tablas.actividad.ToString() + "," + t_adm_actividad.DESCRIPCION.ToString() + Tablas.actividad.ToString() + "," + t_adm_actividad.PARALELO.ToString() + Tablas.actividad.ToString() + "," + t_adm_actividad.TIEMPOCV.ToString() + Tablas.actividad.ToString() + "," + t_adm_actividad.TIEMPODU.ToString() + Tablas.actividad.ToString() + "," + t_adm_actividad.ASTATE.ToString() + Tablas.actividad.ToString();
|
|
this.ValoresCampos = new object[6]
|
|
{
|
|
(object) this.objactividadesEL.NOMBRE,
|
|
(object) this.objactividadesEL.DESCRIPCION,
|
|
(object) this.objactividadesEL.PARALELO,
|
|
(object) this.objactividadesEL.TIEMPOCV,
|
|
(object) this.objactividadesEL.TIEMPODU,
|
|
(object) Convert.ToInt16(this.objactividadesEL.ASTATE)
|
|
};
|
|
return this.baseDAL.Actualizar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD, p_arlCondiciones);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public DataSet listarActividades(
|
|
ArrayList arlCondicionesFiltroBusqueda,
|
|
bool buscarPorASTATE,
|
|
string p_strPrefijoDependencia)
|
|
{
|
|
try
|
|
{
|
|
ArrayList arrayList = new ArrayList();
|
|
this.cargarCondicionBusqueda(arrayList, arlCondicionesFiltroBusqueda);
|
|
this.NombreTabla = Vistas.v_obtenerActividadesSolicitud.ToString();
|
|
int? pk = this.objactividadesEL.PK;
|
|
if ((pk.GetValueOrDefault() != 0 ? 1 : (!pk.HasValue ? 1 : 0)) != 0 && this.objactividadesEL.PK.HasValue)
|
|
arrayList.Add((object) this.buscarPorPK(this.objactividadesEL.PK, Tablas.actividad, operadorLogico.AND));
|
|
if (this.objactividadesEL.PKSOLICITUD != 0)
|
|
{
|
|
int pksolicitud = this.objactividadesEL.PKSOLICITUD;
|
|
arrayList.Add((object) this.buscarPorPK(new int?(this.objactividadesEL.PKSOLICITUD), Tablas.solicitud, operadorLogico.AND));
|
|
}
|
|
if (buscarPorASTATE)
|
|
arrayList.Add((object) this.buscarPorActivo(new bool?(this.objactividadesEL.ASTATE), Tablas.actividad, operadorLogico.NONE));
|
|
return this.baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arrayList, (string) null, "ORDER BY PKACTIVIDAD ASC");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public DataSet listarActividadesMantenimiento(
|
|
ArrayList arlCondicionesFiltroBusqueda,
|
|
bool buscarPorASTATE,
|
|
string p_strPrefijoDependencia)
|
|
{
|
|
try
|
|
{
|
|
ArrayList arrayList = new ArrayList();
|
|
this.cargarCondicionBusqueda(arrayList, arlCondicionesFiltroBusqueda);
|
|
int? pk = this.objactividadesEL.PK;
|
|
if ((pk.GetValueOrDefault() != 0 ? 1 : (!pk.HasValue ? 1 : 0)) != 0 && this.objactividadesEL.PK.HasValue)
|
|
arrayList.Add((object) this.buscarPorPK(this.objactividadesEL.PK, Tablas.actividad, operadorLogico.AND));
|
|
if (this.objactividadesEL.PKSOLICITUD != 0)
|
|
{
|
|
int pksolicitud = this.objactividadesEL.PKSOLICITUD;
|
|
arrayList.Add((object) this.buscarPorPK(new int?(this.objactividadesEL.PKSOLICITUD), Tablas.solicitud, operadorLogico.AND));
|
|
}
|
|
if (buscarPorASTATE)
|
|
arrayList.Add((object) this.buscarPorActivo(new bool?(this.objactividadesEL.ASTATE), Tablas.actividad, operadorLogico.NONE));
|
|
return this.baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arrayList, (string) null, "ORDER BY PKACTIVIDAD ASC");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public DataSet dsListaActividad(ArrayList arlCondicionesFiltroBusqueda)
|
|
{
|
|
try
|
|
{
|
|
ArrayList arrayList = new ArrayList();
|
|
this.cargarCondicionBusqueda(arrayList, arlCondicionesFiltroBusqueda);
|
|
int? pk = this.objactividadesEL.PK;
|
|
if ((pk.GetValueOrDefault() != 0 ? 1 : (!pk.HasValue ? 1 : 0)) != 0 && this.objactividadesEL.PK.HasValue)
|
|
arrayList.Add((object) this.buscarPorPK(this.objactividadesEL.PK, Tablas.actividad, operadorLogico.AND));
|
|
if (this.objactividadesEL.Activo.HasValue)
|
|
arrayList.Add((object) this.buscarPorActivo(this.objactividadesEL.Activo, Tablas.actividad, operadorLogico.AND));
|
|
int fktipodesarrollo = this.objactividadesEL.FKTIPODESARROLLO;
|
|
if (this.objactividadesEL.FKTIPODESARROLLO != 0)
|
|
arrayList.Add((object) this.buscarPorFKActividad(this.objactividadesEL.FKTIPODESARROLLO, operadorLogico.AND));
|
|
if (this.objactividadesEL.FK.HasValue)
|
|
{
|
|
int? fk = this.objactividadesEL.FK;
|
|
if ((fk.GetValueOrDefault() != 0 ? 1 : (!fk.HasValue ? 1 : 0)) != 0)
|
|
arrayList.Add((object) this.buscarPorPK(this.objactividadesEL.FK, Tablas.usuarioxdependencia, operadorLogico.AND));
|
|
}
|
|
if (this.objactividadesEL.ORDEN != 0)
|
|
{
|
|
int orden = this.objactividadesEL.ORDEN;
|
|
arrayList.Add((object) this.buscarPorOrdenActividadProgramacionSolicitud(new int?(this.objactividadesEL.ORDEN), operadorLogico.AND));
|
|
}
|
|
if (this.objactividadesEL.FKDEPENDENCIA != 0)
|
|
{
|
|
int fkdependencia = this.objactividadesEL.FKDEPENDENCIA;
|
|
arrayList.Add((object) this.buscarPorDependenciaAsignada(this.objactividadesEL.FKDEPENDENCIA.ToString(), operadorLogico.NONE));
|
|
}
|
|
this.NombreTabla = Vistas.v_tipodesarrollo.ToString();
|
|
return this.baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arrayList, (string) null, (string) null);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public DataSet dsListaTiempoActividadxProyecto(ArrayList arlCondicionesFiltroBusqueda)
|
|
{
|
|
try
|
|
{
|
|
ArrayList arrayList = new ArrayList();
|
|
this.cargarCondicionBusqueda(arrayList, arlCondicionesFiltroBusqueda);
|
|
int? pk = this.objactividadesEL.PK;
|
|
if ((pk.GetValueOrDefault() != 0 ? 1 : (!pk.HasValue ? 1 : 0)) != 0 && this.objactividadesEL.PK.HasValue)
|
|
arrayList.Add((object) this.buscarPorPK(this.objactividadesEL.PK, Tablas.actividad, operadorLogico.AND));
|
|
if (this.objactividadesEL.NUMEROSOLICITUD != string.Empty && this.objactividadesEL.NUMEROSOLICITUD != null)
|
|
arrayList.Add((object) this.buscarPorNumeroSolicitud(this.objactividadesEL.NUMEROSOLICITUD, operadorLogico.AND));
|
|
if (this.objactividadesEL.Activo.HasValue)
|
|
arrayList.Add((object) this.buscarPorActivo(this.objactividadesEL.Activo, Tablas.actividad, operadorLogico.NONE));
|
|
this.NombreTabla = Vistas.v_obtenerTiempoActividadXSsolicitud.ToString();
|
|
return this.baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arrayList, (string) null, (string) null);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public DataSet dsListaTipoDesarrollo(ArrayList arlCondicionesFiltroBusqueda)
|
|
{
|
|
try
|
|
{
|
|
ArrayList arrayList = new ArrayList();
|
|
this.cargarCondicionBusqueda(arrayList, arlCondicionesFiltroBusqueda);
|
|
this.NombreTabla = Modulos.t_adm_.ToString() + Tablas.tipodesarrollo.ToString();
|
|
this.NombreConeccionBD = BASESDEDATOS.SIGDD.ToString();
|
|
return this.baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arrayList, (string) null, (string) null);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public DataSet dsListarActividad(ArrayList arlCondicionesFiltroBusqueda)
|
|
{
|
|
try
|
|
{
|
|
ArrayList arrayList = new ArrayList();
|
|
this.cargarCondicionBusqueda(arrayList, arlCondicionesFiltroBusqueda);
|
|
int? pk = this.objactividadesEL.PK;
|
|
if ((pk.GetValueOrDefault() != 0 ? 1 : (!pk.HasValue ? 1 : 0)) != 0 && this.objactividadesEL.PK.HasValue)
|
|
arrayList.Add((object) this.buscarPorPK(this.objactividadesEL.PK, Tablas.actividad, operadorLogico.AND));
|
|
if (this.objactividadesEL.Activo.HasValue)
|
|
arrayList.Add((object) this.buscarPorActivo(this.objactividadesEL.Activo, Tablas.actividad, operadorLogico.AND));
|
|
int fktipodesarrollo = this.objactividadesEL.FKTIPODESARROLLO;
|
|
if (this.objactividadesEL.FKTIPODESARROLLO != 0)
|
|
arrayList.Add((object) this.buscarPorFKActividad(this.objactividadesEL.FKTIPODESARROLLO, operadorLogico.AND));
|
|
if (this.objactividadesEL.FK.HasValue)
|
|
{
|
|
int? fk = this.objactividadesEL.FK;
|
|
if ((fk.GetValueOrDefault() != 0 ? 1 : (!fk.HasValue ? 1 : 0)) != 0)
|
|
arrayList.Add((object) this.buscarPorPK(this.objactividadesEL.FK, Tablas.usuarioxdependencia, operadorLogico.NONE));
|
|
}
|
|
int fktipoinspeccion = this.objactividadesEL.FKTIPOINSPECCION;
|
|
if (this.objactividadesEL.FKTIPOINSPECCION != 0)
|
|
{
|
|
int p_nFKTipoInspeccion = 0;
|
|
if (this.objactividadesEL.FKTIPOINSPECCION == 1)
|
|
p_nFKTipoInspeccion = 4;
|
|
if (this.objactividadesEL.FKTIPOINSPECCION == 2)
|
|
p_nFKTipoInspeccion = 3;
|
|
arrayList.Add((object) this.buscarPorFKTipoInspeccion(this.objactividadesEL.FKTIPODESARROLLO, operadorLogico.AND, p_nFKTipoInspeccion));
|
|
}
|
|
this.NombreTabla = Vistas.v_actividad.ToString();
|
|
return this.baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arrayList, (string) null, (string) null);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
private CondicionDAL buscarPorPKACTIVIDAD(
|
|
int? p_nPKACTIVIDAD,
|
|
operadorLogico operador)
|
|
{
|
|
return new CondicionDAL()
|
|
{
|
|
valorIzquierdo = Constraints.PK.ToString() + Tablas.actividad.ToString(),
|
|
operadorGeneral = operadorGeneral.EQUAL,
|
|
operadorLogico = operador,
|
|
valorDerecho = (object) p_nPKACTIVIDAD
|
|
};
|
|
}
|
|
|
|
private CondicionDAL buscarPorPKACTIVIDAD(bool p_blnactivo, operadorLogico operador)
|
|
{
|
|
return new CondicionDAL()
|
|
{
|
|
valorIzquierdo = t_adm_actividad.PK.ToString() + Tablas.actividad.ToString(),
|
|
operadorGeneral = operadorGeneral.EQUAL,
|
|
operadorLogico = operador,
|
|
valorDerecho = (object) p_blnactivo
|
|
};
|
|
}
|
|
|
|
private CondicionDAL buscarPorFKActividad(int p_nFK, operadorLogico operador)
|
|
{
|
|
return new CondicionDAL()
|
|
{
|
|
valorIzquierdo = t_adm_actividad.FKTIPODESARROLLO.ToString(),
|
|
operadorGeneral = operadorGeneral.EQUAL,
|
|
operadorLogico = operador,
|
|
valorDerecho = (object) p_nFK
|
|
};
|
|
}
|
|
|
|
private CondicionDAL buscarPorFKTipoInspeccion(
|
|
int p_nFK,
|
|
operadorLogico operador,
|
|
int p_nFKTipoInspeccion)
|
|
{
|
|
return new CondicionDAL()
|
|
{
|
|
valorIzquierdo = t_adm_actividad.ORDEN.ToString() + Tablas.actividad.ToString(),
|
|
operadorGeneral = operadorGeneral.UNEQUAL,
|
|
operadorLogico = operador,
|
|
valorDerecho = (object) p_nFKTipoInspeccion
|
|
};
|
|
}
|
|
|
|
private CondicionDAL buscarPorNumeroSolicitud(
|
|
string p_strNumeroSolicitud,
|
|
operadorLogico operador)
|
|
{
|
|
return new CondicionDAL()
|
|
{
|
|
valorIzquierdo = t_adm_actividad.NUMEROSOLICITUD.ToString() + Tablas.solicitud.ToString(),
|
|
operadorGeneral = operadorGeneral.EQUAL,
|
|
operadorLogico = operador,
|
|
valorDerecho = (object) p_strNumeroSolicitud
|
|
};
|
|
}
|
|
|
|
public DataSet listarActividades(ArrayList arlCondicionesFiltroBusqueda)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
private CondicionDAL buscarPorOrdenActividadProgramacionSolicitud(
|
|
int? p_nOrdenActividad,
|
|
operadorLogico operador)
|
|
{
|
|
return new CondicionDAL()
|
|
{
|
|
valorIzquierdo = t_adm_actividad.ORDEN.ToString() + Tablas.actividad.ToString(),
|
|
operadorGeneral = operadorGeneral.EQUAL,
|
|
operadorLogico = operador,
|
|
valorDerecho = (object) p_nOrdenActividad
|
|
};
|
|
}
|
|
|
|
protected CondicionDAL buscarPorDependenciaAsignada(
|
|
string p_strValor,
|
|
operadorLogico operador)
|
|
{
|
|
return new CondicionDAL()
|
|
{
|
|
valorIzquierdo = p_strValor,
|
|
operadorGeneral = operadorGeneral.IN,
|
|
operadorLogico = operador,
|
|
valorDerecho = (object) "SELECT Item FROM [dbo].[SplitString] ( LISTADEPENDENCIAS ,',')"
|
|
};
|
|
}
|
|
}
|
|
}
|