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); }
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++; } }
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; } } } }
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; } } } }
public void AddIndex(PdmIndex mKey) { this.Indexs.Add(mKey); }