public virtual void AddField(RecordField field, int index, bool clearMeta) { if (this.Reader.Reader != null) { if (index >= 0 && index < this.Reader.Reader.Fields.Count) { this.Reader.Reader.Fields.Insert(index, field); } else { this.Reader.Reader.Fields.Add(field); } } //this.AddScript("{0}.addField({1}{2});", this.ClientID, new ClientConfig().Serialize(field), index >=0 ? ", " + index : ", "); this.Call("addField", new JRawValue(new ClientConfig().Serialize(field)), index, clearMeta); }
public virtual void AddField(RecordField field) { this.AddField(field, true); }
public virtual void AddField(RecordField field, bool clearMeta) { this.AddField(field, -1, clearMeta); }
public virtual void RemoveField(RecordField field) { this.Call("removeField", new JRawValue(new ClientConfig().Serialize(field))); }
/// <summary> /// /// </summary> public RecordField.Builder RecordField(RecordField component) { return(new RecordField.Builder(component)); }
public virtual void AddField(RecordField field, int index) { this.AddField(field, index, true); }
/// <summary> /// /// </summary> public virtual TBuilder AddField(RecordField field, int index, bool clearMeta) { this.ToComponent().AddField(field, index, clearMeta); return(this as TBuilder); }
/// <summary> /// /// </summary> public virtual TBuilder RemoveField(RecordField field) { this.ToComponent().RemoveField(field); return(this as TBuilder); }
private object GetFieldValue(AutoGeneratedFieldProperties property, object obj, RecordField field, System.Data.DataRow dataRow) { if (field != null && field.ServerMapping.IsNotEmpty()) { string[] mapping = field.ServerMapping.Split('.'); if (mapping.Length > 1) { for (int i = 0; i < mapping.Length; i++) { if (dataRow != null && dataRow.IsNull(mapping[i])) { return null; } PropertyInfo p = obj.GetType().GetProperty(mapping[i]); try { obj = p.GetValue(obj, null); } catch (NullReferenceException e) { throw new NullReferenceException(String.Format("Mapped property '{0}' doesn't exist", mapping[i])); } if (obj == null) { return null; } } return obj; } } return (dataRow != null && dataRow.IsNull(property.DataField)) ? null : DataBinder.GetPropertyValue(obj, property.DataField); }
private object GetFieldValue(AutoGeneratedFieldProperties property, object obj, RecordField field, System.Data.DataRow dataRow) { if (field != null && field.ServerMapping.IsNotEmpty()) { string[] mapping = field.ServerMapping.Split('.'); if (mapping.Length > 1) { for (int i = 0; i < mapping.Length; i++) { if (dataRow != null && dataRow.IsNull(mapping[i])) { return(null); } PropertyInfo p = obj.GetType().GetProperty(mapping[i]); try { obj = p.GetValue(obj, null); } catch (NullReferenceException e) { throw new NullReferenceException(String.Format("Mapped property '{0}' doesn't exist", mapping[i])); } if (obj == null) { return(null); } } return(obj); } } return((dataRow != null && dataRow.IsNull(property.DataField)) ? null : DataBinder.GetPropertyValue(obj, property.DataField)); }