public static void CreateFilterModel(Zetbox.App.GUI.SinglePropertyFilterConfiguration obj, MethodReturnEventArgs <IFilterModel> e) { var mdl = new SingleValueFilterModel(); mdl.Label = obj.GetLabel(); mdl.Required = obj.Required; mdl.ValueSource = FilterValueSource.FromProperty(obj.Property); mdl.ViewModelType = obj.ViewModelDescriptor; mdl.RequestedKind = obj.RequestedKind; mdl.FilterArguments.Add(new FilterArgumentConfig(obj.Property.GetDetachedValueModel(true), /*cfg.ArgumentViewModel ?? */ obj.Property.ValueModelDescriptor)); if (obj.Property is StringProperty) { mdl.Operator = FilterOperators.Contains; } else if (obj.Property is EnumerationProperty) { mdl.RefreshOnFilterChanged = true; } else if (obj.Property is ObjectReferenceProperty) { mdl.RefreshOnFilterChanged = true; } e.Result = mdl; }
public static void CreateFilterModel(Zetbox.App.GUI.DateRangeFilterConfiguration obj, MethodReturnEventArgs <IFilterModel> e) { e.Result = DateRangeFilterModel.Create( FrozenContext, obj.GetLabel(), FilterValueSource.FromProperty(obj.Property), obj.RequestedKind, obj.IsCurrentYearDefault ?? false, obj.IsCurrentQuaterDefault ?? false, obj.IsCurrentMonthDefault ?? false); }
public static void CreateFilterModel(Zetbox.App.GUI.RangeFilterConfiguration obj, MethodReturnEventArgs <Zetbox.API.IFilterModel> e) { var mdl = new RangeFilterModel(); mdl.Label = obj.GetLabel(); mdl.Required = obj.Required; mdl.ValueSource = FilterValueSource.FromProperty(obj.Property); mdl.ViewModelType = obj.ViewModelDescriptor; mdl.RequestedKind = obj.RequestedKind; mdl.FilterArguments.Add(new FilterArgumentConfig(obj.Property.GetDetachedValueModel(true), /*cfg.ArgumentViewModel ?? */ obj.Property.ValueModelDescriptor)); mdl.FilterArguments.Add(new FilterArgumentConfig(obj.Property.GetDetachedValueModel(true), /*cfg.ArgumentViewModel ?? */ obj.Property.ValueModelDescriptor)); e.Result = mdl; }