示例#1
0
        public void Execute(IServiceProvider serviceProvider)
        {
            try
            {
                ServerConnection cnx    = new ServerConnection(serviceProvider);
                Entity           entity = cnx.context.InputParameters["Target"] as Entity;

                if (!ValidacionContexto(cnx, entity))
                {
                    return;
                }

                CrmRepository crmRepository = new CrmRepository(cnx);
                List <Tab>    tabs          = crmRepository.RecuperarTabs(entity.Id);
                tabs.ForEach(t => t.Fichas = crmRepository.RecuperarFichas(t.Id));
                foreach (var tab in tabs)
                {
                    tab.Fichas.ForEach(f => f.Secciones = crmRepository.RecuperarSecciones(f.Id));
                }

                entity["rs_configuraciontabs"]     = ContruirCadenaConfiguracionesTabs(tabs);
                entity["rs_publicarconfiguracion"] = false;
            }
            catch (Exception ex)
            {
                throw new InvalidPluginExecutionException($"IntBank.ConfiguracionTabs.Generar: " + ex.Message);
            }
        }