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());
        }
Ejemplo n.º 2
0
        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));
            }

            ISectionBinder binder = BinderUtils.GetBinder(section, ctx);

            binder.Bind(section, data);
            ControllerBase sectionController = binder as ControllerBase;

            return(sectionController.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());
        }
Ejemplo n.º 4
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));
            }


            ISectionBinder binder = BinderUtils.GetBinder(section, ctx);

            binder.Bind(section, data);
            ControllerBase cb2 = binder as ControllerBase;

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