示例#1
0
        public QChangeRequest GetCR(string Id)
        {
            QChangeRequest retval = null;

            GetCRInternal(Id, this, ref retval);
            return(retval);
        }
示例#2
0
 public static void Delete(QChangeRequest item)
 {
     DeleteInternal(item);
     if (item.GetType() != typeof(QDocumentCR))
     {
         item.Parent.Children.Remove(item);
     }
     item = null;
 }
示例#3
0
        public QChangeRequest GetRoot()
        {
            QChangeRequest root = this;

            while (root.Parent != null)
            {
                root = root.Parent;
            }
            return(root);
        }
示例#4
0
        public bool CanBeChildOf(QChangeRequest changeRequest)
        {
            bool retval = false;

            if (changeRequest != null)
            {
                retval = changeRequest.CompatibleChildren.Contains(GetType());
            }
            return(retval);
        }
示例#5
0
 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();
     }
 }
示例#6
0
        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);
            }
        }
示例#8
0
 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);
             }
         }
     }
 }