TFS_ANTIGUO/SIGPC/AyABL/Tran/consecutivoBL.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

107 lines
4.1 KiB
C#

// Decompiled with JetBrains decompiler
// Type: AyABL.Tran.consecutivoBL
// 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;
using System.Data.Common;
namespace AyABL.Tran
{
public class consecutivoBL : AyABL
{
private static NameValueCollection appSettings = ConfigurationManager.AppSettings;
public consecutivoBL()
{
this.objConsecutivoEL = new consecutivoEL();
this.NombreTabla = Modulos.t_dis_.ToString() + Tablas.consecutivo.ToString();
this.NombreConeccionBD = BASESDEDATOS.SIGDD.ToString();
}
public consecutivoEL objConsecutivoEL { get; set; }
public int obtenerConsecutivo()
{
try
{
this.CamposTabla = t_dis_consecutivo.FKUSUARIOXDEPENDENCIA.ToString() + Tablas.consecutivo.ToString();
this.ValoresCampos = new object[1]
{
(object) this.objConsecutivoEL.USUARIO
};
return this.baseDAL.Insertar(this.NombreTabla, this.CamposTabla, this.ValoresCampos, this.NombreConeccionBD);
}
catch (Exception ex)
{
throw ex;
}
}
public int obtenerConsecutivo(consecutivoEL p_objConsecutivoEL)
{
int num = 0;
DbParameter[] p_dbpParametros = new DbParameter[6];
DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.SqlClient");
for (int index = 0; index < p_dbpParametros.Length; ++index)
p_dbpParametros[index] = factory.CreateParameter();
p_dbpParametros[0].ParameterName = "@ANNO";
p_dbpParametros[0].Value = (object) p_objConsecutivoEL.ANNO;
p_dbpParametros[0].DbType = DbType.Int32;
p_dbpParametros[1].ParameterName = "@FKCANTONAL";
p_dbpParametros[1].Value = (object) p_objConsecutivoEL.FKCANTONAL;
p_dbpParametros[1].DbType = DbType.Int32;
p_dbpParametros[2].ParameterName = "@FKREGION";
p_dbpParametros[2].Value = (object) p_objConsecutivoEL.FKREGION;
p_dbpParametros[2].DbType = DbType.Int32;
p_dbpParametros[3].ParameterName = "@USUARIO";
p_dbpParametros[3].Value = (object) p_objConsecutivoEL.USUARIO;
p_dbpParametros[3].DbType = DbType.Int32;
p_dbpParametros[4].ParameterName = "@P_STATUS";
p_dbpParametros[4].DbType = DbType.String;
p_dbpParametros[4].Size = 2;
p_dbpParametros[4].Direction = ParameterDirection.InputOutput;
p_dbpParametros[5].ParameterName = "@P_MENSAJE";
p_dbpParametros[5].DbType = DbType.String;
p_dbpParametros[5].Size = 500;
p_dbpParametros[5].Direction = ParameterDirection.InputOutput;
DataSet dataSet = this.baseDAL.dsProcedimientoAlmacenado("PA_OBTENER CONSECUTIVOSOLICITUD", p_dbpParametros, this.NombreConeccionBD);
if (dataSet.Tables[0].Rows.Count > 0)
num = int.Parse(dataSet.Tables[0].Rows[0]["CONTADORPAIS"].ToString());
return num;
}
public DataSet listarConsecutivos()
{
try
{
ArrayList p_arlCondiciones = new ArrayList();
if (this.objConsecutivoEL.USUARIO != 0)
p_arlCondiciones.Add((object) this.buscarPorUSER(this.objConsecutivoEL.USUARIO, operadorLogico.NONE));
return this.baseDAL.EjecutarConsulta(this.NombreTabla, this.CamposTabla, this.NombreConeccionBD, p_arlCondiciones, (string) null, "ORDER BY PKCONSECUTIVO DESC");
}
catch (Exception ex)
{
throw ex;
}
}
private CondicionDAL buscarPorUSER(int p_nUSERTEMPORAL, operadorLogico operador)
{
return new CondicionDAL()
{
valorIzquierdo = t_dis_consecutivo.FKUSUARIOXDEPENDENCIA.ToString() + Tablas.consecutivo.ToString(),
operadorGeneral = operadorGeneral.EQUAL,
operadorLogico = operador,
valorDerecho = (object) p_nUSERTEMPORAL
};
}
}
}