public QChangeRequest GetCR(string Id) { QChangeRequest retval = null; GetCRInternal(Id, this, ref retval); return(retval); }
public static void Delete(QChangeRequest item) { DeleteInternal(item); if (item.GetType() != typeof(QDocumentCR)) { item.Parent.Children.Remove(item); } item = null; }
public QChangeRequest GetRoot() { QChangeRequest root = this; while (root.Parent != null) { root = root.Parent; } return(root); }
public bool CanBeChildOf(QChangeRequest changeRequest) { bool retval = false; if (changeRequest != null) { retval = changeRequest.CompatibleChildren.Contains(GetType()); } return(retval); }
private static void DeleteInternal(QChangeRequest item) { if (item.Children != null && item.Children.Count > 0) { for (int i = item.Children.Count - 1; i > 0; i--) { DeleteInternal(item.Children[0]); } } else { item.Children.Clear(); } }
public override void Deserialize(XmlNode Node) { base.Deserialize(Node); Name = Node.ReadString("name"); XmlNodeList children = Node.ChildNodes; Children.Clear(); foreach (XmlNode child in children) { QChangeRequest childCR = QCRFactory.GetObject(GetType().Namespace, child.Name); childCR.Parent = this; childCR.Deserialize(child); Children.Add(childCR); } }
public override void Deserialize(XmlNode Node) { base.Deserialize(Node); code = Node.ReadInt("code", 0); Name = Node.ReadString("name"); definition = Node.ReadString("definition"); RelatedDBObject = Node.ReadString("relateddbobject"); DatabaseName.FromString(Node.ReadString("databasename")); InstallationCode = Node.ReadInt("installationcode", 0); XmlNodeList children = Node.ChildNodes; Children.Clear(); foreach (XmlNode child in children) { QChangeRequest childCR = QCRFactory.GetObject(GetType().Namespace, child.Name); childCR.Parent = this; childCR.Deserialize(child); Children.Add(childCR); } }
private void GetCRInternal(string Id, QChangeRequest CR, ref QChangeRequest CRFound) { if (CRFound != null) { return; } if (CR != null) { if (CR.Id == Id) { CRFound = CR; return; } else { foreach (QChangeRequest child in CR.Children) { GetCRInternal(Id, child, ref CRFound); } } } }