Exemplo n.º 1
0
        public void Config(EntityViewMeta evm)
        {
            if (PageSize != null && evm is WebEntityViewMeta)
            {
                evm.AsWebView().PageSize = PageSize.Value;
            }
            if (GroupBy != null)
            {
                if (GroupBy == NullString)
                {
                    evm.GroupBy = null;
                }
                else
                {
                    evm.GroupBy = evm.Property(GroupBy);
                }
            }

            foreach (var property in this.EntityProperties)
            {
                if (property.IsChanged())
                {
                    var pvm = evm.Property(property.Name);
                    if (pvm != null)
                    {
                        property.Config(pvm);
                    }
                }
            }

            if (RafyEnvironment.Location.IsWebUI)
            {
                foreach (var cmd in this.Commands)
                {
                    if (cmd.IsChanged())
                    {
                        var jsCmd = evm.AsWebView().Commands.Find(cmd.Name);
                        if (jsCmd != null)
                        {
                            cmd.Config(jsCmd);
                        }
                    }
                }
            }
            else
            {
                foreach (var cmd in this.Commands)
                {
                    if (cmd.IsChanged())
                    {
                        var wpfCmd = evm.AsWPFView().Commands.Find(cmd.Name);
                        if (wpfCmd != null)
                        {
                            cmd.Config(wpfCmd);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        protected override void UseBlockDefaultCommands(EntityViewMeta meta)
        {
            if (!RafyEnvironment.Location.IsWebUI)
            {
                //如果当前模块是一个条件面板,应该添加上查询按钮。
                meta.AsWPFView().UseCommands(WPFCommandNames.FireQuery);
            }

            base.UseBlockDefaultCommands(meta);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 使用本块中默认的一些按钮。
 /// </summary>
 protected virtual void UseBlockDefaultCommands(EntityViewMeta meta)
 {
     if (RafyEnvironment.Location.IsWPFUI)
     {
         if (this.BlockType == BlockType.Report)
         {
             meta.AsWPFView().UseCommands(WPFCommandNames.RefreshDataSourceInRDLC, WPFCommandNames.ShowReportData);
         }
     }
 }
Exemplo n.º 4
0
 private void UseSysCommands(EntityViewMeta evm)
 {
     //初始化实体视图中的命令按钮
     var em = evm.EntityMeta;
     if (!RafyEnvironment.Location.IsWebUI)
     {
         if (em.EntityCategory == EntityCategory.QueryObject)
         {
             evm.AsWPFView().UseCommands(WPFCommandNames.SysQueryCommands);
         }
         else
         {
             evm.AsWPFView().UseCommands(WPFCommandNames.SysCommands);
         }
     }
     else
     {
         if (em.EntityCategory == EntityCategory.QueryObject)
         {
             evm.AsWebView().UseCommands(WebCommandNames.SysQueryCommands);
         }
         else
         {
             evm.AsWebView().UseCommands(WebCommandNames.SysCommands);
         }
     }
 }
Exemplo n.º 5
0
        public void Config(EntityViewMeta evm)
        {
            if (PageSize != null && evm is WebEntityViewMeta) evm.AsWebView().PageSize = PageSize.Value;
            if (GroupBy != null)
            {
                if (GroupBy == NullString)
                {
                    evm.GroupBy = null;
                }
                else
                {
                    evm.GroupBy = evm.Property(GroupBy);
                }
            }

            foreach (var property in this.EntityProperties)
            {
                if (property.IsChanged())
                {
                    var pvm = evm.Property(property.Name);
                    if (pvm != null) { property.Config(pvm); }
                }
            }

            if (RafyEnvironment.Location.IsWebUI)
            {
                foreach (var cmd in this.Commands)
                {
                    if (cmd.IsChanged())
                    {
                        var jsCmd = evm.AsWebView().Commands.Find(cmd.Name);
                        if (jsCmd != null) { cmd.Config(jsCmd); }
                    }
                }
            }
            else
            {
                foreach (var cmd in this.Commands)
                {
                    if (cmd.IsChanged())
                    {
                        var wpfCmd = evm.AsWPFView().Commands.Find(cmd.Name);
                        if (wpfCmd != null) { cmd.Config(wpfCmd); }
                    }
                }
            }
        }