コード例 #1
0
 private string RenderXml(IConfigBean config, IPayLoad context)
 {
     BaseAttributeConfigBean cp = config as BaseAttributeConfigBean;
     ConfigurationPayLoad cg = context as ConfigurationPayLoad;
     cp.AddSearchConfigKey(cg.SearceKeys);
     return new XMLSerializer().Serializer(cp);
 }
コード例 #2
0
 private string RenderHtml(IConfigBean config)
 {
     if (string.IsNullOrEmpty(ViewHtml))
     {
         ViewHtml = ReadLayout();
     }
     string content = BuildContent(config);
     content = ViewHtml.Replace("@Body@", content); 
     return content;
 }
コード例 #3
0
        private string BuildContent(IConfigBean config)
        {
            BaseAttributeConfigBean cp = config as BaseAttributeConfigBean;
            string host = ContextHelper.GetHostUrl();
            StringBuilder content = new StringBuilder();
            content.AppendLine("<div class=\"main-content-inner\">");
            content.AppendLine("<div class=\"breadcrumbs\" id=\"breadcrumbs\">");
            content.AppendLine(" <script type=\"text/javascript\">");
            content.AppendLine(" try { ace.settings.check('breadcrumbs', 'fixed') } catch (e) { }");
            content.AppendLine("</script>");
            content.AppendLine("<ul class=\"breadcrumb\">");
            content.AppendLine("      <li>");
            content.AppendLine("<i class=\"ace-icon fa fa-home home-icon\"></i>");
            content.AppendLine("<a href=\"" + host + "configuration\">Configuration</a>");
            content.AppendLine("</li>");
            content.AppendFormat("<li class=\"active\" >{0}</li>", cp.GetID());

            content.AppendLine("<div style=\"position:absolute;top:10px;right:10px\"><a type=\"update\" id=\"updateallbtn\" href=\"javascript:void(0)\">修改</a></div>");
            content.AppendLine("    </ul>");
            content.AppendLine("    </div>");
            content.AppendLine("<div class=\"page-content\">");
            content.AppendLine("<table class=\"table table-striped table-bordered table-hover\">");
            content.AppendLine("<colgroup>");
            content.AppendLine("<col style=\"width: 120px; \">");
            content.AppendLine("<col style=\"width: 120px; \">");
            content.AppendLine("<col />");
            content.AppendLine("</colgroup>");
            IEnumerable<PropertyName> pNames = cp.GetPropertyNames();
            foreach (PropertyName p in pNames)
            {                    
                object value = cp.Get(p.Name);
                string detail = string.Empty;
                PropertyInfo py = cp.GetAttribute().GetPropertyInfo(p.Name);
                if (py != null)
                {
                    var attrs = py.GetCustomAttributes(typeof(ComponentAttributeBase), false);
                    foreach (var a in attrs)
                    {
                        if (a is FieldDocumentAttribute)
                        {
                            FieldDocumentAttribute att = a as FieldDocumentAttribute;
                            detail = att.Detail;
                        }
                    }
                }
                content.Append(CreateItem(p.Name, value, config.GetID(), p.CanWrite, detail, cp.GetUpdateLog()));
            }
            content.AppendLine("</table>");
            content.AppendLine("</div>");
            content.AppendLine("</div>");
            return content.ToString();
        }
コード例 #4
0
 public string Render(IPayLoad context, IConfigBean component)
 {
     switch (context.Type)
     {
         case RenderType.Html:
             return RenderHtml(component);
         case RenderType.Xml:
             return RenderXml(component, context);
         case RenderType.Json:
             return RenderJson(component, context);
     }
     return RenderJson(component, context);
 }
コード例 #5
0
        private string RenderHtml(IConfigBean component, IPayLoad context)
        {
            if (string.IsNullOrEmpty(ViewHtml))
            {
                UserInfo user = Authorization.Instance.CurrentUser();
                string userid = string.Empty;
                if (user != null)
                {
                    userid = user.UserID;
                }
                ViewHtml = new ViewResult(layOutViewName, new PageModel() { ActiveMenuIndex = 2, DisplayName = userid, IsLogin = true }).Execute();
                ViewHtml = ViewHtml.Replace("@ComponentBody@", BuildContent(context));
            }
            return ViewHtml;

        }
コード例 #6
0
 private string RenderXml(IConfigBean component, IPayLoad context)
 {
     return new XMLSerializer().Serializer(GetConigurationList(context));
 }
コード例 #7
0
 private string RenderHtml(IConfigBean component)
 {
     return new ViewResult(layOutViewName, new PageModel() { ActiveMenuIndex = 2, IsLogin = true }).Execute();
 }
コード例 #8
0
 public void Register(IConfigBean config)
 {
     VenusContainerLoader.Container.Define(typeof(IConfigBean), config.GetType(), config.GetID());
 }
コード例 #9
0
 private string RenderXml(IConfigBean config)
 {
     return new XMLSerializer().Serializer(config);
 }
コード例 #10
0
        private string RenderJson(IConfigBean config)
        {
            return new JSONSerializer().Serializer(config);

        }
コード例 #11
0
 public string Render(IPayLoad context, IConfigBean config)
 {
     BasePropertiesConfigBean pro = config as BasePropertiesConfigBean;
     ConfigurationPayLoad payload = context as ConfigurationPayLoad;
     return pro.GetConfigFile(payload.AppPath, payload.ID).Read();
 }