public BaseField CreateField_In_Filter(CreateField_In_Filter_Params param) { // Default Value Int64 default_value = 0; if (param.DefaultFilterValues != null && param.DefaultFilterValues.Keys.Contains(param.ConfigProperty.PropertyInfo.PropertyType.Name)) { default_value = (Int64)param.DefaultFilterValues[param.ConfigProperty.PropertyInfo.PropertyType.Name]; } ManyToOneField manyToOneField = new ManyToOneField(param.EntityBLO, param.ConfigProperty.PropertyInfo, param.FilterContainer, Orientation.Horizontal, param.SizeLabel, param.SizeControl, default_value, param.ConfigProperty.ConfigEntity, param.Entity ); manyToOneField.Name = param.ConfigProperty.PropertyInfo.Name; manyToOneField.TabIndex = param.TabIndex; manyToOneField.Text_Label = param.ConfigProperty.DisplayProperty.Title; param.FilterContainer.Controls.Add(manyToOneField); return(manyToOneField); }
public BaseField CreateField_In_Filter(CreateField_In_Filter_Params param) { ComboBoxField stringFiled = new ComboBoxField(); stringFiled.StopAutoSizeConfig(); stringFiled.Name = param.ConfigProperty.PropertyInfo.Name; stringFiled.SizeLabel = param.SizeLabel; stringFiled.SizeControl = param.SizeControl; stringFiled.OrientationField = Orientation.Horizontal; stringFiled.TabIndex = param.TabIndex; stringFiled.Text_Label = param.ConfigProperty.DisplayProperty.Title; stringFiled.ConfigSizeField(); // DataSource IList ls_data = param.ConfigProperty.DataSource.GetData(); List <string> ls_data_string = ls_data.Cast <Object>().Select(o => o.ToString()).ToList <string>(); // Add Blank Data if (param.ConfigProperty.Filter.isDefaultIsEmpty) { ls_data_string.Insert(0, ""); } stringFiled.DataSource = ls_data_string.ToList <object>(); param.FilterContainer.Controls.Add(stringFiled); return(stringFiled); }
/// <summary> /// Initialisation de filtre /// </summary> protected void CreatFiltre() { // Default Size and Positions int width_label = 100; int height_label = 25; int width_control = 100; int height_control = 25; // List of Properties must be shown in filter var propertyListFilter = from i in BLO.TypeEntity.GetProperties() where i.GetCustomAttribute(typeof(FilterAttribute)) != null orderby((FilterAttribute)i.GetCustomAttribute(typeof(FilterAttribute))).Ordre select i; // Create Field in filter foreach (PropertyInfo propertyInfo in propertyListFilter) { // Config Property Instance ConfigProperty configProperty = new ConfigProperty(propertyInfo, this.ConfigEntity); // WidthControl int item_width_control = width_control; if (configProperty.Filter?.WidthControl != 0) { item_width_control = configProperty.Filter.WidthControl; } // Params to Create Fields CreateField_In_Filter_Params param = new CreateField_In_Filter_Params(); param.ConfigProperty = configProperty; param.SizeLabel = new Size(width_label, height_label); param.SizeControl = new Size(item_width_control, height_control); param.TabIndex = ++TabIndex; param.FilterContainer = FilterContainer; param.DefaultFilterValues = DefaultFilterValues; param.EntityBLO = BLO; // Create FieldTraitement Instance IFieldTraitements fieldTraitement = BaseFieldTraitement.CreateInstance(configProperty); BaseField baseField = null; // Invok Create Field in filter Method baseField = fieldTraitement.CreateField_In_Filter(param); baseField.ValueChanged += Filtre_SelectedValueChanged; } // End For }
public BaseField CreateField_In_Filter(CreateField_In_Filter_Params param) { Int32Filed int32Filed = new Int32Filed(); int32Filed.StopAutoSizeConfig(); int32Filed.Name = param.ConfigProperty.PropertyInfo.Name; int32Filed.SizeLabel = param.SizeLabel; int32Filed.SizeControl = param.SizeControl; int32Filed.OrientationField = Orientation.Horizontal; int32Filed.TabIndex = param.TabIndex; int32Filed.Text_Label = param.ConfigProperty.DisplayProperty.Titre; int32Filed.ConfigSizeField(); param.FilterContainer.Controls.Add(int32Filed); return(int32Filed); }
/// <summary> /// Create Field in Filter /// </summary> /// <param name="param">Parameters</param> /// <returns>The created field</returns> public BaseField CreateField_In_Filter(CreateField_In_Filter_Params param) { DefaultField defaultField = new DefaultField(); defaultField.StopAutoSizeConfig(); defaultField.Name = param.ConfigProperty.PropertyInfo.Name; defaultField.SizeLabel = param.SizeLabel; defaultField.SizeControl = param.SizeControl; defaultField.OrientationField = Orientation.Horizontal; defaultField.TabIndex = param.TabIndex; defaultField.Text_Label = param.ConfigProperty.DisplayProperty.Title; defaultField.ConfigSizeField(); param.FilterContainer.Controls.Add(defaultField); return(defaultField); }
/// <summary> /// Create Field in Filter /// </summary> /// <param name="param"></param> /// <returns>Created field instance</returns> public BaseField CreateField_In_Filter(CreateField_In_Filter_Params param) { // Create Field ComboBoxField comboBoxField = new ComboBoxField(); comboBoxField.StopAutoSizeConfig(); comboBoxField.Name = param.ConfigProperty.PropertyInfo.Name; comboBoxField.SizeLabel = param.SizeLabel; comboBoxField.SizeControl = param.SizeControl; comboBoxField.OrientationField = Orientation.Horizontal; comboBoxField.TabIndex = param.TabIndex; comboBoxField.Text_Label = param.ConfigProperty.DisplayProperty.Title; comboBoxField.ConfigSizeField(); // DataSource comboBoxField.DataSource = Enum.GetValues(param.ConfigProperty.PropertyInfo.PropertyType).Cast <object>().ToList <object>(); // Insert Field in Filter param.FilterContainer.Controls.Add(comboBoxField); return(comboBoxField); }
public BaseField CreateField_In_Filter(CreateField_In_Filter_Params param) { throw new GwinException("Field Many to Many Creation in Filter not yet implemented in Gwin Application"); }
public BaseField CreateField_In_Filter(CreateField_In_Filter_Params param) { throw new GwinException("Create Field ManyToMany not yet implemented in Filter"); }