115 lines
4.1 KiB
C#
115 lines
4.1 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: AyABL.TRA.documentoBL
|
|
// 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;
|
|
|
|
namespace AyABL.TRA
|
|
{
|
|
public class documentoBL : AyABL
|
|
{
|
|
private static NameValueCollection appSettings = ConfigurationManager.AppSettings;
|
|
|
|
public documentoBL()
|
|
{
|
|
this.objdocumentoEL = new documentoEL();
|
|
this.NombreTabla = Modulos.t_dis_.ToString() + Tablas.documento.ToString();
|
|
this.NombreConeccionBD = BASESDEDATOS.SIGDD.ToString();
|
|
}
|
|
|
|
public documentoEL objdocumentoEL { get; set; }
|
|
|
|
public int insertarDocumento()
|
|
{
|
|
try
|
|
{
|
|
this.CamposTabla = t_dis_documento.DESCRIPCION.ToString() + Tablas.documento.ToString() + "," + t_dis_documento.NOMBRE.ToString() + Tablas.documento.ToString() + "," + Constraints.FK.ToString() + Tablas.solicitud.ToString() + "," + Constraints.FK.ToString() + Tablas.requisito.ToString() + "," + t_dis_documento.ASTATE.ToString() + Tablas.documento.ToString();
|
|
this.ValoresCampos = new object[5]
|
|
{
|
|
(object) this.objdocumentoEL.Descripcion,
|
|
(object) this.objdocumentoEL.NOMBRE,
|
|
(object) this.objdocumentoEL.FKSOLICITUD,
|
|
(object) this.objdocumentoEL.FKREQUISITO,
|
|
(object) 1
|
|
};
|
|
return this.baseDAL.Insertar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public int modificarDocumento()
|
|
{
|
|
try
|
|
{
|
|
ArrayList p_arlCondiciones = new ArrayList();
|
|
p_arlCondiciones.Add((object) this.buscarPorPKDOCUMENTO(this.objdocumentoEL.PK, operadorLogico.NONE));
|
|
this.CamposTabla = t_dis_documento.DESCRIPCION.ToString() + Tablas.documento.ToString() + "," + Constraints.FK.ToString() + Tablas.solicitud.ToString() + "," + t_dis_documento.ASTATE.ToString() + Tablas.documento.ToString();
|
|
this.ValoresCampos = new object[3]
|
|
{
|
|
(object) this.objdocumentoEL.Descripcion,
|
|
(object) this.objdocumentoEL.FKSOLICITUD,
|
|
(object) Convert.ToInt16(this.objdocumentoEL.ASTATE)
|
|
};
|
|
return this.baseDAL.Actualizar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD, p_arlCondiciones);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public void eliminarDocumento()
|
|
{
|
|
ArrayList p_arlCondiciones = new ArrayList();
|
|
try
|
|
{
|
|
int? pk = this.objdocumentoEL.PK;
|
|
if ((pk.GetValueOrDefault() != 0 ? 1 : (!pk.HasValue ? 1 : 0)) != 0)
|
|
p_arlCondiciones.Add((object) this.buscarPorPK(this.objdocumentoEL.PK, Tablas.documento, operadorLogico.AND));
|
|
if (this.objdocumentoEL.FKSOLICITUD != 0)
|
|
p_arlCondiciones.Add((object) this.buscarPorNUMSOLICITUD(this.objdocumentoEL.FKSOLICITUD, operadorLogico.NONE));
|
|
this.baseDAL.eliminarFisico(this.NombreTabla, this.NombreConeccionBD, p_arlCondiciones);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
private CondicionDAL buscarPorPKDOCUMENTO(
|
|
int? p_nPKDOCUMENTO,
|
|
operadorLogico operador)
|
|
{
|
|
return new CondicionDAL()
|
|
{
|
|
valorIzquierdo = Constraints.PK.ToString() + Tablas.documento.ToString(),
|
|
operadorGeneral = operadorGeneral.EQUAL,
|
|
operadorLogico = operador,
|
|
valorDerecho = (object) p_nPKDOCUMENTO
|
|
};
|
|
}
|
|
|
|
private CondicionDAL buscarPorNUMSOLICITUD(
|
|
int p_nNUMSOLICITUD,
|
|
operadorLogico operador)
|
|
{
|
|
return new CondicionDAL()
|
|
{
|
|
valorIzquierdo = t_dis_documento.FKSOLICITUD.ToString(),
|
|
operadorGeneral = operadorGeneral.EQUAL,
|
|
operadorLogico = operador,
|
|
valorDerecho = (object) p_nNUMSOLICITUD
|
|
};
|
|
}
|
|
}
|
|
}
|