TFS_ANTIGUO/SIGPC/AyABL/Tran/adjuntoBL.cs
kledezma 7fdadc4709 KLB
git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C519
2021-01-22 15:05:35 +00:00

180 lines
6.9 KiB
C#

// Decompiled with JetBrains decompiler
// Type: AyABL.Tran.adjuntoBL
// 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.TRA;
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Configuration;
using System.Data;
namespace AyABL.Tran
{
public class adjuntoBL : AyABL
{
private static NameValueCollection appSettings = ConfigurationManager.AppSettings;
public adjuntoBL()
{
this.objadjuntoEL = new adjuntoEL();
this.NombreTabla = Modulos.t_dis_.ToString() + Tablas.adjuntosolicitud.ToString();
this.NombreConeccionBD = BASESDEDATOS.SIGDD.ToString();
}
public adjuntoEL objadjuntoEL { get; set; }
public int insertarAdjunto()
{
try
{
this.CamposTabla = t_dis_adjunto.DESCRIPCION.ToString() + Tablas.adjuntosolicitud.ToString() + ", " + t_dis_adjunto.NOMBRE.ToString() + Tablas.adjuntosolicitud.ToString() + ", " + t_dis_adjunto.FECHA.ToString() + Tablas.adjuntosolicitud.ToString() + ", " + t_dis_adjunto.ENVIOCORREO.ToString() + Tablas.adjuntosolicitud.ToString() + ", " + Constraints.FK.ToString() + Tablas.solicitud.ToString() + "," + t_dis_adjunto.ASTATE.ToString() + Tablas.adjuntosolicitud.ToString();
this.ValoresCampos = new object[6]
{
(object) this.objadjuntoEL.DESCRIPCION,
(object) this.objadjuntoEL.NOMBRE,
(object) DateTime.Now,
(object) false,
(object) this.objadjuntoEL.FKSOLICITUD,
(object) 1
};
return this.baseDAL.Insertar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD);
}
catch (Exception ex)
{
throw ex;
}
}
public int modificarAdjunto()
{
try
{
ArrayList p_arlCondiciones = new ArrayList();
p_arlCondiciones.Add((object) this.buscarPorPK(this.objadjuntoEL.PK, Tablas.adjuntosolicitud, operadorLogico.NONE));
this.CamposTabla = t_dis_adjunto.DESCRIPCION.ToString() + Tablas.adjuntosolicitud.ToString() + ", " + t_dis_adjunto.ENVIOCORREO.ToString() + Tablas.adjuntosolicitud.ToString() + ", " + Constraints.FK.ToString() + Tablas.solicitud.ToString();
this.ValoresCampos = new object[3]
{
(object) this.objadjuntoEL.DESCRIPCION,
(object) false,
(object) this.objadjuntoEL.FKSOLICITUD
};
return this.baseDAL.Actualizar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD, p_arlCondiciones);
}
catch (Exception ex)
{
throw ex;
}
}
public int modificarEnvioCorreoAdjunto()
{
try
{
ArrayList p_arlCondiciones = new ArrayList();
p_arlCondiciones.Add((object) this.buscarPorPK(this.objadjuntoEL.PK, Tablas.adjuntosolicitud, operadorLogico.NONE));
this.CamposTabla = t_dis_adjunto.ENVIOCORREO.ToString() + Tablas.adjuntosolicitud.ToString();
this.ValoresCampos = new object[1]{ (object) true };
return this.baseDAL.Actualizar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD, p_arlCondiciones);
}
catch (Exception ex)
{
throw ex;
}
}
public int eliminarAdjunto()
{
try
{
ArrayList p_arlCondiciones = new ArrayList();
p_arlCondiciones.Add((object) this.buscarPorPK(this.objadjuntoEL.PK, Tablas.adjuntosolicitud, operadorLogico.NONE));
this.CamposTabla = t_dis_adjunto.ASTATE.ToString() + Tablas.adjuntosolicitud.ToString();
this.ValoresCampos = new object[1]
{
(object) this.objadjuntoEL.ASTATE
};
return this.baseDAL.Actualizar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD, p_arlCondiciones);
}
catch (Exception ex)
{
throw ex;
}
}
public DataSet listarAdjuntos(
ArrayList arlCondicionesFiltroBusqueda,
bool buscarPorASTATE)
{
try
{
ArrayList arrayList = new ArrayList();
this.cargarCondicionBusqueda(arrayList, arlCondicionesFiltroBusqueda);
this.NombreTabla = Vistas.v_obteneradjuntosolicitud.ToString();
int? pk = this.objadjuntoEL.PK;
if ((pk.GetValueOrDefault() != 0 ? 1 : (!pk.HasValue ? 1 : 0)) != 0 && this.objadjuntoEL.PK.HasValue)
arrayList.Add((object) this.buscarPorPK(this.objadjuntoEL.PK, Tablas.adjuntosolicitud, operadorLogico.AND));
if (this.objadjuntoEL.FKSOLICITUD != 0)
{
int fksolicitud = this.objadjuntoEL.FKSOLICITUD;
arrayList.Add((object) this.buscarPorFK(this.objadjuntoEL.FKSOLICITUD, Tablas.solicitud, operadorLogico.AND));
}
if (buscarPorASTATE)
arrayList.Add((object) this.buscarPorEstado(this.objadjuntoEL.ASTATE, Tablas.adjuntosolicitud, operadorLogico.NONE));
if (this.objadjuntoEL.FKREUTILIZA != 0)
{
arrayList.Add((object) this.buscarPorNUMSOLICITUD(this.objadjuntoEL.FKREUTILIZA, operadorLogico.OR));
if (this.objadjuntoEL.NUMEROSOLICITUD != string.Empty && this.objadjuntoEL.NUMEROSOLICITUD != null)
arrayList.Add((object) this.buscarPorFKReutiiliza(this.objadjuntoEL.NUMEROSOLICITUD, operadorLogico.NONE));
}
return this.baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, arrayList, (string) null, "ORDER BY PKADJUNTOSOLICITUD DESC");
}
catch (Exception ex)
{
throw ex;
}
}
private CondicionDAL buscarPorEstadoAdjunto(
bool p_blnactivo,
operadorLogico operador)
{
return new CondicionDAL()
{
valorIzquierdo = t_dis_adjunto.ASTATE.ToString() + Tablas.adjuntosolicitud.ToString(),
operadorGeneral = operadorGeneral.EQUAL,
operadorLogico = operador,
valorDerecho = (object) p_blnactivo
};
}
private CondicionDAL buscarPorNUMSOLICITUD(
int p_nNUMSOLICITUD,
operadorLogico operador)
{
return new CondicionDAL()
{
valorIzquierdo = t_dis_adjunto.FKSOLICITUD.ToString(),
operadorGeneral = operadorGeneral.EQUAL,
operadorLogico = operador,
valorDerecho = (object) p_nNUMSOLICITUD
};
}
private CondicionDAL buscarPorFKReutiiliza(
string p_strNUMEROSOLICITUD,
operadorLogico operador)
{
return new CondicionDAL()
{
valorIzquierdo = t_dis_requisitosolicitud.NUMEROSOLICITUD.ToString() + Tablas.solicitud.ToString(),
operadorGeneral = operadorGeneral.LIKE,
operadorLogico = operador,
valorDerecho = (object) ("-" + p_strNUMEROSOLICITUD + "-")
};
}
}
}