Exemplo n.º 1
0
        //初始化c:Keys"的节点
        private void InitKeys(XmlNode xnKeys, PdmTable pTable)
        {
            int i = 1;

            pTable.Keys.Clear();

            foreach (XmlNode xnKey in xnKeys)
            {
                PdmKey item = GetKey(xnKey, pTable);
                item.KeyID = i;
                pTable.AddKey(item);
                i++;
            }
        }
Exemplo n.º 2
0
        private void InitPrimaryKey(XmlNode xnKeys, PdmTable pTable)
        {
            foreach (XmlNode xnKey in xnKeys)
            {
                PdmKey item = GetKey(xnKey, pTable);

                foreach (PdmKey key in pTable.Keys)
                {
                    XmlElement xe = (XmlElement)xnKey;
                    if (key.PdmID == xe.GetAttribute("Ref"))
                    {
                        key.IsPrimary = true;
                        break;
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void InitKeyColumns(XmlNode xnKeys, PdmTable pTable, PdmKey pKey)
        {
            int i = 1;

            pKey.Columns.Clear();

            foreach (XmlNode xnKey in xnKeys)
            {
                XmlElement xe = (XmlElement)xnKey;
                foreach (PdmColumn column in pTable.Columns)
                {
                    if (column.PdmID == xe.GetAttribute("Ref"))
                    {
                        pKey.AddColumn(column);
                        i++;
                        break;
                    }
                }
            }
        }
Exemplo n.º 4
0
        private PdmKey GetKey(XmlNode xnKey, PdmTable pTable)
        {
            PdmKey     mKey = new PdmKey();
            XmlElement xe   = (XmlElement)xnKey;

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

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

                case "a:Code": mKey.KeyCode = xnP.InnerText;
                    break;

                case "c:Key.Columns": InitKeyColumns(xnP, pTable, mKey);
                    break;
                }
            }
            return(mKey);
        }
Exemplo n.º 5
0
 public void AddKey(PdmKey mKey)
 {
     this.Keys.Add(mKey);
 }