public EditableField(Formfield formfield, Formrecord formrecord) : this(formrecord) { if (formrecord.Formfield.Id != formfield.Id) { throw new NotSupportedException("Cannot encapsulate a record with a different field (Field IDs do not match)"); } }
/// <summary> /// Adds a new field to the form, and returns it's designer. /// </summary> public DesignableField AddField(string name) { Formfield field = new Formfield(); field.Name = name; field.Form = this.Form; /// The field does not get saved until we store the form DesignableField designer = new DesignableField(field, this); designer.FieldDeleted += new EventHandler(HandleFieldDeleted); /// Set the default for the field ordering designer.Metadata.FieldOrder = this.relatedFields.Count; this.relatedFields.Add(designer); return(designer); }
/// <summary> /// Deletes the field (and all codes, and all records) from the form /// </summary> public void Delete() { foreach (Formrecord record in this.FormField.Formrecords()) { Formrecord.Delete(record.Id); } foreach (Formcode code in this.FormField.Formcodes()) { Formcode.Delete(code.Id); } Formfield.Delete(this.FormField.Id); if (this.FieldDeleted != null) { this.FieldDeleted(this, EventArgs.Empty); } }
public void Insert(int Formid,string Name,string Metadata,bool? Deleted,DateTime? Createdon,DateTime? Modifiedon,string Createdby,string Modifiedby) { Formfield item = new Formfield(); item.Formid = Formid; item.Name = Name; item.Metadata = Metadata; item.Deleted = Deleted; item.Createdon = Createdon; item.Modifiedon = Modifiedon; item.Createdby = Createdby; item.Modifiedby = Modifiedby; item.Save(UserName); }
/// <summary> /// Adds a new field to the form, and returns it's designer. /// </summary> public DesignableField AddField(string name) { Formfield field = new Formfield(); field.Name = name; field.Form = this.Form; /// The field does not get saved until we store the form DesignableField designer = new DesignableField(field, this); designer.FieldDeleted +=new EventHandler(HandleFieldDeleted); /// Set the default for the field ordering designer.Metadata.FieldOrder = this.relatedFields.Count; this.relatedFields.Add(designer); return designer; }
/// <summary> /// Encapsulates a field into this form /// </summary> /// <param name="formfield"></param> public SymanticField(Formfield formfield) { this.FormField = formfield; }
public ViewableField(Formfield formfield, ViewableFile viewableFile) : base(formfield) { this.viewableFile = viewableFile; }
public EditableField(Formfield formfield, Formrecord formrecord) :this(formrecord) { if (formrecord.Formfield.Id != formfield.Id) throw new NotSupportedException("Cannot encapsulate a record with a different field (Field IDs do not match)"); }
public EditableField(Formfield formfield) : base(formfield) { this.Status = FieldStatus.New; }
public DesignableField(Formfield formfield, DesignableForm parentForm) : base(formfield) { this.parentForm = parentForm; }
public void Update(int Id,int Formid,string Name,string Metadata,bool? Deleted,DateTime? Createdon,DateTime? Modifiedon,string Createdby,string Modifiedby) { Formfield item = new Formfield(); item.MarkOld(); item.IsLoaded = true; item.Id = Id; item.Formid = Formid; item.Name = Name; item.Metadata = Metadata; item.Deleted = Deleted; item.Createdon = Createdon; item.Modifiedon = Modifiedon; item.Createdby = Createdby; item.Modifiedby = Modifiedby; item.Save(UserName); }