Exemplo n.º 1
0
        public static List <ConfigValor> ListAppConfig(int codEmpresa)
        {
            List <ConfigValor> lstConfigValor = new List <ConfigValor>();
            ConfigValor        configuracion  = new ConfigValor();

            try
            {
                string conexion = GlobalSettings.GetBDCadenaConexion("cnxCROMSystema");
                using (DBML_ConfigDataContext SQLDC = new DBML_ConfigDataContext(conexion))
                {
                    var resul = SQLDC.omgc_S_Configuracion(codEmpresa, null, string.Empty, null, true);
                    foreach (var item in resul)
                    {
                        lstConfigValor.Add(new ConfigValor()
                        {
                            codConfiguracion = item.codConfiguracion,
                            codKeyConfig     = item.codKeyConfig,
                            desValor         = item.desValor,
                        });
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }

            return(lstConfigValor);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Retorna una ENTIDAD de registro de la Entidad Maestros.Configuracion
        /// En la BASE de DATO la Tabla : [Maestros.Configuracion]
        /// <summary>
        /// <returns>Entidad</returns>
        public static string AppConfig(int codEmpresa, ConfigTool pcodKeyConfig)
        {
            ConfigValor configuracion = new ConfigValor();

            try
            {
                string conexion = GlobalSettings.GetBDCadenaConexion("cnxCROMSystema");
                using (DBML_ConfigDataContext SQLDC = new DBML_ConfigDataContext(conexion))
                {
                    var resul = SQLDC.omgc_S_Configuracion(codEmpresa, null, pcodKeyConfig.ToString(), null, null);
                    foreach (var item in resul)
                    {
                        configuracion = new ConfigValor()
                        {
                            desValor = item.desValor,
                        };
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                configuracion.desValor = string.IsNullOrEmpty(configuracion.desValor) ? string.Empty : configuracion.desValor;
            }
            return(configuracion.desValor);
        }