Ejemplo n.º 1
0
        private String bindAutoData(IBlock sectionBlock, ContentSection section)
        {
            IList setttingLinks = getAutoBinderSettingLinks(section);

            bindSettingLink(sectionBlock, setttingLinks);

            Dictionary <string, string> presult = getDefaultValue(section);

            IList data = ServiceContext.GetData(section.ServiceId, section.GetServiceParamValues(), presult);

            if (section.TemplateId <= 0)
            {
                return(getJsonResult(section, data));
            }


            ContentSectionTemplate tpl = templatelService.GetById(section.TemplateId);
            Template       currentView = utils.getTemplateByFileName(BinderUtils.GetBinderTemplatePath(tpl));
            ISectionBinder binder      = BinderUtils.GetBinder(tpl, ctx, currentView);

            binder.Bind(section, data);

            ControllerBase cb2 = binder as ControllerBase;

            return(cb2.utils.getActionResult());
        }
        private String getAutoData(ContentSection section)
        {
            Dictionary <string, string> presult = getDefaultValue(section);

            IList data = ServiceContext.GetData(section.ServiceId, section.GetServiceParamValues(), presult);

            if (section.TemplateId <= 0)
            {
                return(getJsonResult(section, data));
            }

            ContentSectionTemplate sectionTemplate = TplService.GetById(section.TemplateId);
            Template       currentView             = utils.getTemplateByFileName(BinderUtils.GetBinderTemplatePath(sectionTemplate));
            ISectionBinder binder = BinderUtils.GetBinder(sectionTemplate, ctx, currentView);

            binder.Bind(section, data);   // custom template : SectionUtil.loadTemplate
            ControllerBase sectionController = binder as ControllerBase;

            return(sectionController.utils.getActionResult());
        }