Esempio n. 1
0
        private PdmIndex GetIndex(XmlNode xnKey, PdmTable pTable)
        {
            PdmIndex   mIndex = new PdmIndex();
            XmlElement xe     = (XmlElement)xnKey;

            mIndex.PdmID = xe.GetAttribute("Id");
            XmlNodeList xnKProperty = xe.ChildNodes;

            foreach (XmlNode xnP in xnKProperty)
            {
                switch (xnP.Name)
                {
                case "a:Name": mIndex.IndexName = xnP.InnerText;
                    break;

                case "a:Code": mIndex.IndexCode = xnP.InnerText;
                    break;

                case "a:Unique": mIndex.IsUnique = ConvertToBooleanPG(xnP.InnerText);
                    break;

                case "c:IndexColumns": InitIndexColumns(xnP, pTable, mIndex);
                    break;
                }
            }
            return(mIndex);
        }
Esempio n. 2
0
        private void InitIndexes(XmlNode xnKeys, PdmTable pTable)
        {
            int i = 1;

            pTable.Indexs.Clear();

            foreach (XmlNode xnKey in xnKeys)
            {
                PdmIndex item = GetIndex(xnKey, pTable);
                item.IndexID = i;
                pTable.AddIndex(item);
                i++;
            }
        }
Esempio n. 3
0
 private void InitIndexColumn(XmlNode xnKeys, PdmTable pTable, PdmIndex pIndex)
 {
     foreach (XmlNode xnKey in xnKeys)
     {
         XmlElement xe = (XmlElement)xnKey;
         foreach (PdmColumn column in pTable.Columns)
         {
             if (column.PdmID == xe.GetAttribute("Ref"))
             {
                 pIndex.AddColumn(column);
                 break;
             }
         }
     }
 }
Esempio n. 4
0
        private void InitIndexColumns(XmlNode xnKeys, PdmTable pTable, PdmIndex pIndex)
        {
            pIndex.Columns.Clear();

            foreach (XmlNode xnKey in xnKeys)
            {
                XmlElement  xe          = (XmlElement)xnKey;
                XmlNodeList xnKProperty = xe.ChildNodes;

                foreach (XmlNode xnP in xnKProperty)
                {
                    switch (xnP.Name)
                    {
                    case "c:Column": InitIndexColumn(xnP, pTable, pIndex);
                        break;
                    }
                }
            }
        }
Esempio n. 5
0
 public void AddIndex(PdmIndex mKey)
 {
     this.Indexs.Add(mKey);
 }