Esempio n. 1
0
        void ParseDbms(PDModel m, XmlNode root)
        {
            PDDbms  dbms         = new PDDbms();
            XmlNode shortcutNode = root.FirstChild;

            dbms.Model = m;
            dbms.ID    = shortcutNode.Attributes["Id"].Value;

            foreach (XmlNode node in shortcutNode.ChildNodes)
            {
                switch (node.Name)
                {
                case "a:Name":
                    dbms.Name = node.InnerText;
                    break;

                case "a:Code":
                    dbms.Code = node.InnerText;
                    break;

                case "a:Comment":
                    dbms.Comment = node.InnerText;
                    break;

                default:
                    dbms.AddUnparsedNode(node);
                    break;
                }
            }

            m.DBMS = dbms;
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dbms"></param>
        /// <returns></returns>
        public static DbType PDMDataTypeToDbType(PDColumn column)
        {
            PDDbms dbms     = column.Model.DBMS;
            string dataType = column.DataType;

            ///todo:将PDM模型中不同关系数据库的数据类型转换成System.Data.DbType
            if (dbms.Code.StartsWith("MSSQLSRV"))
            {
                return(TypeUtil.SqlServerDataType2DbType(column.DataType));
            }
            if (dbms.Code.StartsWith("MYSQL"))
            {
                return(TypeUtil.MySqlDataType2DbType(column.DataType));
            }


            return(DbType.String);
        }
Esempio n. 3
0
        void ParseDbms(PDModel m, XmlNode root)
        {
            PDDbms dbms = new PDDbms();
            XmlNode shortcutNode = root.FirstChild;

            dbms.Model = m;
            dbms.ID = shortcutNode.Attributes["Id"].Value;

            foreach (XmlNode node in shortcutNode.ChildNodes)
            {
                switch (node.Name)
                {
                    case "a:Name":
                        dbms.Name = node.InnerText;
                        break;
                    case "a:Code":
                        dbms.Code = node.InnerText;
                        break;
                    case "a:Comment":
                        dbms.Comment = node.InnerText;
                        break;
                    default:
                        dbms.AddUnparsedNode(node);
                        break;
                }
            }

            m.DBMS = dbms;
        }