internal void Read(EntityViewMeta evm)
 {
     this.Id = GetRuntimeUniqueId(evm);
     if (evm.GroupBy != null) this.GroupBy = evm.GroupBy.Name;
     if (evm is WebEntityViewMeta)
     {
         this.PageSize = evm.AsWebView().PageSize;
     }
     this.EntityType = ClientEntities.GetClientName(evm.EntityType);
     if (!string.IsNullOrEmpty(evm.ExtendView)) this.ViewName = evm.ExtendView;
 }
Example #2
0
        protected override void ConfigView()
        {
            View.DomainName("岗位用户").DisableEditing();

            View.UseDefaultCommands().UseCommand("Rafy.rbac.cmd.LookupSelectAddOrgPositionUser")
            .HasLabel("选择用户")
            .SetExtendedProperty("targetClass", ClientEntities.GetClientName(typeof(User)));
            View.RemoveCommands(WebCommandNames.Add);

            View.Property(OrgPositionUser.View_CodeProperty).HasLabel("编码").ShowIn(ShowInWhere.List);
            View.Property(OrgPositionUser.View_NameProperty).HasLabel("名称").ShowIn(ShowInWhere.List);
        }
Example #3
0
        public override void Execute(LogicalView view)
        {
            var blocks = UIModel.AggtBlocks.GetDefinedBlocks("ViewConfigurationModel模块界面");

            var ui = AutoUI.AggtUIFactory.GenerateControl(blocks);

            ui.MainView.DataLoader.LoadDataAsync(() =>
            {
                var model = RF.Concrete <ViewConfigurationModelRepository>()
                            .GetBy(new ViewConfigurationModelNameCriteria
                {
                    EntityType = ClientEntities.GetClientName(view.EntityType),
                    ViewName   = view.Meta.ExtendView
                });

                return(model);
            });

            App.Windows.ShowWindow(ui.Control, w =>
            {
                w.Title = "定制".Translate() + " " + view.Meta.Label.Translate();
                w.WindowClosedByUser += (o, e) =>
                {
                    if (e.Button == WindowButton.Yes)
                    {
                        //先执行保存。
                        ui.MainView.Commands[WPFCommandNames.SaveBill].TryExecute();

                        if (!App.Windows.HasPopup)
                        {
                            var res = App.MessageBox.Show("重新打开当前模块以使设置生效?".Translate(), MessageBoxButton.YesNo);
                            if (res == MessageBoxResult.Yes)
                            {
                                var ws = App.Current.Workspace;
                                var aw = ws.ActiveWindow;
                                if (aw != null && ws.TryRemove(aw))
                                {
                                    App.Current.OpenModuleOrAlert(aw.Title);
                                }
                            }
                        }
                        else
                        {
                            App.MessageBox.Show("下次打开此弹出窗口时生效。".Translate(), MessageBoxButton.OK);
                        }
                    }
                };
            });
        }
Example #4
0
        internal static ComboListConfig CreateComboList(EntityPropertyViewMeta property)
        {
            var comboList = new ComboListConfig();

            comboList.model = ClientEntities.GetClientName(property.SelectionViewMeta.SelectionEntityType);

            var title = property.SelectionViewMeta.RefTypeDefaultView.TitleProperty;

            if (title != null)
            {
                comboList.displayField = title.Name;
            }

            var dsp = property.SelectionViewMeta.DataSourceProperty;

            if (dsp != null)
            {
                comboList.dataSourceProperty = dsp.Name;
            }

            return(comboList);
        }
Example #5
0
        private void ConvertToClientMeta(WebEntityViewMeta evm, ClientEntityViewMeta clientMeta, bool?isDetail)
        {
            clientMeta.model    = ClientEntities.GetClientName(evm.EntityType);
            clientMeta.viewName = evm.ExtendView;
            clientMeta.label    = evm.Label;

            if (isDetail.GetValueOrDefault(this.Option.isDetail))
            {
                clientMeta.formConfig = CreateFormConfig(evm);
            }
            else
            {
                clientMeta.gridConfig = CreateGridConfig(evm);

                if (evm.EntityMeta.IsTreeEntity)
                {
                    clientMeta.storeConfig = new TreeStoreConfig();
                }
                else
                {
                    var groupBy = evm.GroupBy;
                    if (groupBy != null)
                    {
                        var n = groupBy.Name;
                        if (groupBy.IsReference)
                        {
                            n = EntityModelGenerator.LabeledRefProperty(n);
                        }
                        clientMeta.groupBy = n;
                    }

                    clientMeta.storeConfig = new StoreConfig
                    {
                        pageSize = evm.PageSize
                    };
                }
            }
        }
Example #6
0
 protected override void ToJson(LiteJsonWriter json)
 {
     json.WriteProperty("model", ClientEntities.GetClientName(model));
     json.WriteProperty("total", total);
     json.WriteProperty("entities", entities);
 }