public void AddFieldCR(string fieldName) { if (!Children.Any(F => F.GetType().Equals(typeof(QAddDUIFieldCR)) && ((QAddDUIFieldCR)F).FieldName == fieldName)) { QAddDUIFieldCR cr = AddNewChild <QAddDUIFieldCR>(); cr.FieldName = fieldName; } }
public override void CopyState(object source) { if (source is QAddDUIFieldCR) { QAddDUIFieldCR cr = (QAddDUIFieldCR)source; XmlDocument doc = new XmlDocument(); doc.LoadXml(cr.Serialize()); Deserialize(doc.DocumentElement); } }
public override object Clone() { QAddDUIFieldCR retval = new QAddDUIFieldCR() { FieldName = this.fieldName, Parent = this.Parent }; foreach (QChangeRequest child in this.Children) { retval.Children.Add((QChangeRequest)child.Clone()); } return(retval); }
public override void Modify() { foreach (QPoolField field in poolFields) { var children = ChangeRequest.Children.Where(C => C.GetType() == typeof(QAddDUIFieldCR) && ((QAddDUIFieldCR)C).FieldName == field.FieldName && ((QAddDUIFieldCR)C).InstallationCode == installationCode).ToList(); if (children == null || children.Count == 0) { // add child QAddDUIFieldCR newchild = ChangeRequest.AddNewChild <QAddDUIFieldCR>(); newchild.FieldName = field.FieldName; } } }