/// <summary> /// Adds a lookup code to this field. /// </summary> /// <param name="label">A unique label for this code.</param> public void AddLookupCode(string label) { ///If this label is already used, then don't add it if (this.LookupCodes.Where <Formcode>(code => code.Label.Equals(label, StringComparison.InvariantCultureIgnoreCase)).Count() > 0) { return; } Formcode newCode = new Formcode(); newCode.Formfield = this.FormField; newCode.Label = label; newCode.Save(Utility.GetActiveUsername()); this.LookupCodes.Add(newCode); }
public void Insert(int Fieldid,string Label,bool? Deleted,DateTime? Createdon,DateTime? Modifiedon,string Createdby,string Modifiedby) { Formcode item = new Formcode(); item.Fieldid = Fieldid; item.Label = Label; item.Deleted = Deleted; item.Createdon = Createdon; item.Modifiedon = Modifiedon; item.Createdby = Createdby; item.Modifiedby = Modifiedby; item.Save(UserName); }
public void Update(int Id,int Fieldid,string Label,bool? Deleted,DateTime? Createdon,DateTime? Modifiedon,string Createdby,string Modifiedby) { Formcode item = new Formcode(); item.MarkOld(); item.IsLoaded = true; item.Id = Id; item.Fieldid = Fieldid; item.Label = Label; item.Deleted = Deleted; item.Createdon = Createdon; item.Modifiedon = Modifiedon; item.Createdby = Createdby; item.Modifiedby = Modifiedby; item.Save(UserName); }
/// <summary> /// Deletes a lookup code for this field. It is marked deleted, records that reference it will continue to hold their reference to the old code. /// </summary> /// <param name="code">The code to remove.</param> public void RemoveLookCode(Formcode code) { code.Deleted = true; code.Save(Utility.GetActiveUsername()); this.ReloadLookupCodes(); }
/// <summary> /// Adds a lookup code to this field. /// </summary> /// <param name="label">A unique label for this code.</param> public void AddLookupCode(string label) { ///If this label is already used, then don't add it if (this.LookupCodes.Where<Formcode>(code => code.Label.Equals(label, StringComparison.InvariantCultureIgnoreCase)).Count() > 0) return; Formcode newCode = new Formcode(); newCode.Formfield = this.FormField; newCode.Label = label; newCode.Save(Utility.GetActiveUsername()); this.LookupCodes.Add(newCode); }