internal void Config(EntityPropertyViewMeta property) { if (this.Label != null) { property.Label = this.Label; } if (this.ShowInWhere != null) { property.ShowInWhere = this.ShowInWhere.Value; } if (this.OrderNo != null) { property.OrderNo = this.OrderNo.Value; } }
internal static FieldConfig GetTypeEditor(EntityPropertyViewMeta property) { var type = GetServerType(property.PropertyMeta.PropertyType); switch (type.JSType) { case JavascriptType.Int: case JavascriptType.Float: return(new FieldConfig { xtype = "numberfield" }); case JavascriptType.Date: return(new FieldConfig { xtype = "datefield" }); case JavascriptType.Boolean: return(new FieldConfig { xtype = "checkbox" }); case JavascriptType.Reference: throw new InvalidOperationException("请调用 CreateComboList 方法。"); case JavascriptType.String: if (type.Name == SupportedServerType.Enum) { return(new EnumBoxConfig(type.RuntimeType)); } else { return(new TextFieldConfig { allowBlank = type.IsNullable }); } default: return(null); } }
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); }
/// <summary> /// 获取按照显示排序后的属性列表。 /// </summary> /// <returns></returns> private static IEnumerable <WPFEntityPropertyViewMeta> OrderedDetailProperties(IEnumerable <EntityPropertyViewMeta> properties) { return(EntityPropertyViewMeta.Order(properties) .Where(pv => pv.CanShowIn(ShowInWhere.Detail)) .Cast <WPFEntityPropertyViewMeta>()); }