287 lines
15 KiB
C#
287 lines
15 KiB
C#
using Exferia_Aplicacion.General;
|
|
using Exferia_Aplicacion.Modelos_Listado_Filtros;
|
|
using Exferia_Aplicacion.Visualizacion;
|
|
using Exferia_Controles;
|
|
using Exferia_EntityFramework;
|
|
using Exferia_Formularios;
|
|
using Exferia_General._0_Modelos;
|
|
using Exferia_General._3_Vistas.Controladoras;
|
|
using Exferia_General._3_Vistas.ListadosSeleccion;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using static Exferia_Aplicacion.General.Enumerados;
|
|
|
|
namespace Exferia_General._3_Vistas
|
|
{
|
|
public partial class P_ConfiguracionGeneral : Exferia_Formularios.P_Base_Mantenimientos
|
|
{
|
|
#region Constructor
|
|
public P_ConfiguracionGeneral(INTERNO_ValoresGenerales_Modelo _mdl_INTERNO_ValoresGenerales_Modelo, DateTime _dtt_FechaTrabajo, PRV_OpcionesDetalle _mdl_PRV_OpcionesDetalle)
|
|
{
|
|
InitializeComponent();
|
|
|
|
try
|
|
{
|
|
Repintar.Empezar(this);
|
|
|
|
CheckForIllegalCrossThreadCalls = false;
|
|
|
|
//Empresa seleccionada y fecha de trabajo ....................................................
|
|
P_Base_ValoresGenerales = _mdl_INTERNO_ValoresGenerales_Modelo;
|
|
P_Base_FechaTrabajo = _dtt_FechaTrabajo;
|
|
|
|
//Titulo de la Pantalla .............................................................................
|
|
P_Base_TituloPantalla = _mdl_PRV_OpcionesDetalle.descripcion_TituloMantenimiento;
|
|
|
|
// Label con Empresa Seleccionada
|
|
if (P_Base_ValoresGenerales != null)
|
|
{
|
|
try
|
|
{
|
|
P_Base_Mantenimientos_InformacionEmpresaSeleccionada = P_Base_ValoresGenerales.str_Empresa_Descripcion + " - " +
|
|
"(" + P_Base_FechaTrabajo.ToString("dd/MM/yyyy") + ")";
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
//No se muestra mensaje pero se guarda en el log
|
|
Control_Errores.Errores_Log(ex.Message, ex, nameof(P_ConfiguracionGeneral) + "/" + nameof(P_ConfiguracionGeneral));
|
|
}
|
|
}
|
|
//....................................................................................................
|
|
|
|
//Bloquear pantalla hasta que termine la carga por defecto .....
|
|
Enabled = false;
|
|
//.............................................................
|
|
}
|
|
catch (Control_Errores)
|
|
{}
|
|
catch (Exception ex)
|
|
{
|
|
//No se muestra mensaje pero se guarda en el log
|
|
Control_Errores.Errores_Log(ex.Message, ex, nameof(P_ConfiguracionGeneral) + "/" + nameof(P_ConfiguracionGeneral));
|
|
}
|
|
finally
|
|
{
|
|
//Bloquear pantalla hasta que termine la carga por defecto .....
|
|
Enabled = true;
|
|
//.............................................................
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region Botones
|
|
private void ex_btn_P_Empresa_ConfiguracionCampoCodigo_Click(object sender, EventArgs e)
|
|
{
|
|
ConfiguracionCampoCodigo();
|
|
}
|
|
private void ConfiguracionCampoCodigo()
|
|
{
|
|
try
|
|
{
|
|
INTERNO_OpcionesDetalle_Modelo mdl_INTERNO_OpcionesDetalle_Modelo = Datos_Generales.PRV_Opciones_Buscar_Detalles(Variables.G_STR_OPCION_GEN_CONFIGURACION_CAMPOCODIGO);
|
|
if (mdl_INTERNO_OpcionesDetalle_Modelo != null)
|
|
{
|
|
|
|
//Cargamos el ensamblado
|
|
Assembly m_assembly = Assembly.LoadFrom(Variables.G_STR_LIBRERIA_RUTAINICIAL + @"\" + Variables.G_STR_LIBRERIA_GENERAL + ".dll");
|
|
//Obtenemos el tipo de la clase
|
|
Type m_type = m_assembly.GetType(Variables.G_STR_LIBRERIA_GENERAL + "." + Variables.G_STR_LIBRERIA_OPCIONES);
|
|
//creamos la instancia
|
|
var obj_Clase = Activator.CreateInstance(m_type);
|
|
//Cargamos el metodo solicitado
|
|
MethodInfo obj_MethodInfo = obj_Clase.GetType().GetMethod(Variables.G_STR_LIBRERIA_OPCIONES_PROCEDIMIENTO_MOSTRAR_EN_MANTENIMIENTO, BindingFlags.Instance | BindingFlags.NonPublic);
|
|
|
|
//Obtener valores
|
|
object[] arr_Parametros = { mdl_INTERNO_OpcionesDetalle_Modelo.opcion, null, null, Variables.G_MDL_INTERNO_VALORESGENERALES_MODELO, Variables.G_DTT_FECHA_INICIAL_PORDEFECTO, mdl_INTERNO_OpcionesDetalle_Modelo, -1, "", "", null,null };
|
|
//Pasamos los parametros al metodo y lo ejecutamos
|
|
obj_MethodInfo.Invoke(obj_Clase, arr_Parametros);
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Control_Errores.Errores_Log("", ex, nameof(P_ConfiguracionGeneral) + "/" + nameof(ConfiguracionCampoCodigo));
|
|
}
|
|
}
|
|
|
|
private void ex_btn_P_ConfiguracioGeneral_ConfiguracionServidoresCorreo_Click(object sender, EventArgs e)
|
|
{
|
|
ConfiguracionServidoresCorreo();
|
|
}
|
|
private void ConfiguracionServidoresCorreo()
|
|
{
|
|
try
|
|
{
|
|
INTERNO_OpcionesDetalle_Modelo mdl_INTERNO_OpcionesDetalle_Modelo = Datos_Generales.PRV_Opciones_Buscar_Detalles(Variables.G_STR_OPCION_GEN_CONFIGURACIONEMAIL);
|
|
if (mdl_INTERNO_OpcionesDetalle_Modelo != null)
|
|
{
|
|
//Cargamos el ensamblado
|
|
Assembly m_assembly = Assembly.LoadFrom(Variables.G_STR_LIBRERIA_RUTAINICIAL + @"\" + Variables.G_STR_LIBRERIA_GENERAL + ".dll");
|
|
//Obtenemos el tipo de la clase
|
|
Type m_type = m_assembly.GetType(Variables.G_STR_LIBRERIA_GENERAL + "." + Variables.G_STR_LIBRERIA_OPCIONES);
|
|
//creamos la instancia
|
|
var obj_Clase = Activator.CreateInstance(m_type);
|
|
//Cargamos el metodo solicitado
|
|
MethodInfo obj_MethodInfo = obj_Clase.GetType().GetMethod(Variables.G_STR_LIBRERIA_OPCIONES_PROCEDIMIENTO_CARGAR_LISTADO, BindingFlags.Instance | BindingFlags.NonPublic);
|
|
|
|
//Obtener valores
|
|
object[] arr_Parametros = { mdl_INTERNO_OpcionesDetalle_Modelo.opcion, false, 0, null, Variables.G_MDL_INTERNO_VALORESGENERALES_MODELO, Variables.G_DTT_FECHA_INICIAL_PORDEFECTO, "", "", false, false, null, null, null, null,null ,null};
|
|
//Pasamos los parametros al metodo y lo ejecutamos
|
|
obj_MethodInfo.Invoke(obj_Clase, arr_Parametros);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Control_Errores.Errores_Log("", ex, nameof(P_ConfiguracionGeneral) + "/" + nameof(ConfiguracionServidoresCorreo));
|
|
}
|
|
}
|
|
|
|
private void ex_btn_P_ConfiguracioGeneral_ConfiguracionCompartirDatos_Click(object sender, EventArgs e)
|
|
{
|
|
ConfiguracionCompartirDatos();
|
|
}
|
|
private void ConfiguracionCompartirDatos()
|
|
{
|
|
try
|
|
{
|
|
INTERNO_OpcionesDetalle_Modelo mdl_INTERNO_OpcionesDetalle_Modelo = Datos_Generales.PRV_Opciones_Buscar_Detalles(Variables.G_STR_OPCION_GEN_EMPRESA_COMPARTIRDATO);
|
|
if (mdl_INTERNO_OpcionesDetalle_Modelo != null)
|
|
{
|
|
|
|
//Cargamos el ensamblado
|
|
Assembly m_assembly = Assembly.LoadFrom(Variables.G_STR_LIBRERIA_RUTAINICIAL + @"\" + Variables.G_STR_LIBRERIA_GENERAL + ".dll");
|
|
//Obtenemos el tipo de la clase
|
|
Type m_type = m_assembly.GetType(Variables.G_STR_LIBRERIA_GENERAL + "." + Variables.G_STR_LIBRERIA_OPCIONES);
|
|
//creamos la instancia
|
|
var obj_Clase = Activator.CreateInstance(m_type);
|
|
//Cargamos el metodo solicitado
|
|
MethodInfo obj_MethodInfo = obj_Clase.GetType().GetMethod(Variables.G_STR_LIBRERIA_OPCIONES_PROCEDIMIENTO_MOSTRAR_EN_MANTENIMIENTO, BindingFlags.Instance | BindingFlags.NonPublic);
|
|
|
|
//Obtener valores
|
|
object[] arr_Parametros = { mdl_INTERNO_OpcionesDetalle_Modelo.opcion, null, null, Variables.G_MDL_INTERNO_VALORESGENERALES_MODELO, Variables.G_DTT_FECHA_INICIAL_PORDEFECTO, mdl_INTERNO_OpcionesDetalle_Modelo, -1, "", "", null,null };
|
|
//Pasamos los parametros al metodo y lo ejecutamos
|
|
obj_MethodInfo.Invoke(obj_Clase, arr_Parametros);
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Control_Errores.Errores_Log("", ex, nameof(P_ConfiguracionGeneral) + "/" + nameof(ConfiguracionCompartirDatos));
|
|
}
|
|
}
|
|
|
|
private void ex_btn_P_ConfiguracioGeneral_ConfiguracionInformes_Click(object sender, EventArgs e)
|
|
{
|
|
ConfiguracionInformes();
|
|
}
|
|
private void ConfiguracionInformes()
|
|
{
|
|
try
|
|
{
|
|
INTERNO_OpcionesDetalle_Modelo mdl_INTERNO_OpcionesDetalle_Modelo = Datos_Generales.PRV_Opciones_Buscar_Detalles(Variables.G_STR_OPCION_GEN_CONFIGURACION_INFORMES);
|
|
if (mdl_INTERNO_OpcionesDetalle_Modelo != null)
|
|
{
|
|
|
|
//Cargamos el ensamblado
|
|
Assembly m_assembly = Assembly.LoadFrom(Variables.G_STR_LIBRERIA_RUTAINICIAL + @"\" + Variables.G_STR_LIBRERIA_GENERAL + ".dll");
|
|
//Obtenemos el tipo de la clase
|
|
Type m_type = m_assembly.GetType(Variables.G_STR_LIBRERIA_GENERAL + "." + Variables.G_STR_LIBRERIA_OPCIONES);
|
|
//creamos la instancia
|
|
var obj_Clase = Activator.CreateInstance(m_type);
|
|
//Cargamos el metodo solicitado
|
|
MethodInfo obj_MethodInfo = obj_Clase.GetType().GetMethod(Variables.G_STR_LIBRERIA_OPCIONES_PROCEDIMIENTO_CARGAR_LISTADO, BindingFlags.Instance | BindingFlags.NonPublic);
|
|
|
|
//Obtener valores
|
|
object[] arr_Parametros = { mdl_INTERNO_OpcionesDetalle_Modelo.opcion, false, 0, null, Variables.G_MDL_INTERNO_VALORESGENERALES_MODELO, Variables.G_DTT_FECHA_INICIAL_PORDEFECTO, "", "", false, false, null, null, null, null, null, null };
|
|
//Pasamos los parametros al metodo y lo ejecutamos
|
|
obj_MethodInfo.Invoke(obj_Clase, arr_Parametros);
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Control_Errores.Errores_Log("", ex, nameof(P_ConfiguracionGeneral) + "/" + nameof(ConfiguracionInformes));
|
|
}
|
|
}
|
|
|
|
private void ex_btn_P_ConfiguracioGeneral_ConfiguracionSWSigma_Click(object sender, EventArgs e)
|
|
{
|
|
ConfiguracionDireccionesSWSigma();
|
|
}
|
|
private void ConfiguracionDireccionesSWSigma()
|
|
{
|
|
try
|
|
{
|
|
INTERNO_OpcionesDetalle_Modelo mdl_INTERNO_OpcionesDetalle_Modelo = Datos_Generales.PRV_Opciones_Buscar_Detalles(Variables.G_STR_OPCION_GEN_CONFIGURACION_SW_SIGMA);
|
|
if (mdl_INTERNO_OpcionesDetalle_Modelo != null)
|
|
{
|
|
|
|
//Cargamos el ensamblado
|
|
Assembly m_assembly = Assembly.LoadFrom(Variables.G_STR_LIBRERIA_RUTAINICIAL + @"\" + Variables.G_STR_LIBRERIA_GENERAL + ".dll");
|
|
//Obtenemos el tipo de la clase
|
|
Type m_type = m_assembly.GetType(Variables.G_STR_LIBRERIA_GENERAL + "." + Variables.G_STR_LIBRERIA_OPCIONES);
|
|
//creamos la instancia
|
|
var obj_Clase = Activator.CreateInstance(m_type);
|
|
//Cargamos el metodo solicitado
|
|
MethodInfo obj_MethodInfo = obj_Clase.GetType().GetMethod(Variables.G_STR_LIBRERIA_OPCIONES_PROCEDIMIENTO_MOSTRAR_EN_MANTENIMIENTO, BindingFlags.Instance | BindingFlags.NonPublic);
|
|
|
|
//Obtener valores
|
|
object[] arr_Parametros = { mdl_INTERNO_OpcionesDetalle_Modelo.opcion, null, null, Variables.G_MDL_INTERNO_VALORESGENERALES_MODELO, Variables.G_DTT_FECHA_INICIAL_PORDEFECTO, mdl_INTERNO_OpcionesDetalle_Modelo, -1, "", "", null, null };
|
|
//Pasamos los parametros al metodo y lo ejecutamos
|
|
obj_MethodInfo.Invoke(obj_Clase, arr_Parametros);
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Control_Errores.Errores_Log("", ex, nameof(P_ConfiguracionGeneral) + "/" + nameof(ConfiguracionDireccionesSWSigma));
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
private void firmasDigitales_Click(object sender, EventArgs e)
|
|
{
|
|
ConfiguracionFirmasDigitales();
|
|
}
|
|
private void ConfiguracionFirmasDigitales()
|
|
{
|
|
try
|
|
{
|
|
INTERNO_OpcionesDetalle_Modelo mdl_INTERNO_OpcionesDetalle_Modelo = Datos_Generales.PRV_Opciones_Buscar_Detalles(Variables.G_STR_OPCION_GEN_FIRMAS_ELECTRONICAS);
|
|
if (mdl_INTERNO_OpcionesDetalle_Modelo != null)
|
|
{
|
|
|
|
//Cargamos el ensamblado
|
|
Assembly m_assembly = Assembly.LoadFrom(Variables.G_STR_LIBRERIA_RUTAINICIAL + @"\" + Variables.G_STR_LIBRERIA_GENERAL + ".dll");
|
|
//Obtenemos el tipo de la clase
|
|
Type m_type = m_assembly.GetType(Variables.G_STR_LIBRERIA_GENERAL + "." + Variables.G_STR_LIBRERIA_OPCIONES);
|
|
//creamos la instancia
|
|
var obj_Clase = Activator.CreateInstance(m_type);
|
|
//Cargamos el metodo solicitado
|
|
MethodInfo obj_MethodInfo = obj_Clase.GetType().GetMethod(Variables.G_STR_LIBRERIA_OPCIONES_PROCEDIMIENTO_CARGAR_LISTADO, BindingFlags.Instance | BindingFlags.NonPublic);
|
|
|
|
//Obtener valores
|
|
object[] arr_Parametros = { mdl_INTERNO_OpcionesDetalle_Modelo.opcion, false, 0, null, Variables.G_MDL_INTERNO_VALORESGENERALES_MODELO, Variables.G_DTT_FECHA_INICIAL_PORDEFECTO, "", "", false, false, null, null, null, null, null, null };
|
|
//Pasamos los parametros al metodo y lo ejecutamos
|
|
obj_MethodInfo.Invoke(obj_Clase, arr_Parametros);
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Control_Errores.Errores_Log("", ex, nameof(P_ConfiguracionGeneral) + "/" + nameof(ConfiguracionFirmasDigitales));
|
|
}
|
|
}
|
|
}
|
|
}
|