Пример #1
0
        //初始化"c:Columns"的节点
        private void InitColumns(XmlNode xnColumns, PdmTable pTable)
        {
            int i = 1;

            pTable.Columns.Clear();

            foreach (XmlNode xnColumn in xnColumns)
            {
                PdmColumn item = GetColumn(xnColumn);
                item.ColumnID = i;
                pTable.AddColumn(item);
                i++;
            }
        }
Пример #2
0
        public PdmColumn Copy()
        {
            PdmColumn rtn = new PdmColumn();

            rtn.ColumnID      = this.ColumnID;
            rtn.PdmID         = this.PdmID;
            rtn.ColumnName    = this.ColumnName;
            rtn.ColumnCode    = this.ColumnCode;
            rtn.ColumnComment = this.ColumnComment;
            rtn.DataType      = this.DataType;
            rtn.Length        = this.Length;
            rtn.Precision     = this.Precision;
            rtn.Identity      = this.Identity;
            rtn.Identity      = this.Identity;

            return(rtn);
        }
Пример #3
0
        private PdmColumn GetColumn(XmlNode xnColumn)
        {
            PdmColumn  mColumn = new PdmColumn();
            XmlElement xe      = (XmlElement)xnColumn;

            mColumn.PdmID = xe.GetAttribute("Id");
            XmlNodeList xnCProperty = xe.ChildNodes;

            foreach (XmlNode xnP in xnCProperty)
            {
                switch (xnP.Name)
                {
                case "a:Name": mColumn.ColumnName = xnP.InnerText;
                    break;

                case "a:Code": mColumn.ColumnCode = xnP.InnerText;
                    break;

                case "a:Comment": mColumn.ColumnComment = String.IsNullOrEmpty(xnP.InnerText) ? String.Empty : xnP.InnerText;
                    break;

                case "a:DataType": mColumn.DataType = xnP.InnerText;
                    break;

                case "a:Length": mColumn.Length = String.IsNullOrEmpty(xnP.InnerText) ? 0 : Convert.ToInt32(xnP.InnerText);
                    break;

                case "a:Precision": mColumn.Precision = String.IsNullOrEmpty(xnP.InnerText) ? 0 : Convert.ToInt32(xnP.InnerText);
                    break;

                case "a:Identity": mColumn.Identity = ConvertToBooleanPG(xnP.InnerText);
                    break;

                case "a:Mandatory": mColumn.NotNull = ConvertToBooleanPG(xnP.InnerText);
                    break;
                }
            }

            return(mColumn);
        }
Пример #4
0
 public void AddColumn(PdmColumn mColumn)
 {
     this.Columns.Add(mColumn);
 }
Пример #5
0
 public bool OnEqual(PdmColumn col)
 {
     return((col.TableCode == this.TableCode) && (col.ColumnName == this.ColumnName) && (col.DBID == this.DBID) &&
            (col.ColumnCode == this.ColumnCode) && (col.ColumnID == this.ColumnID) && (col.DataType == this.DataType) && (col.Length == this.Length) &&
            (col.Precision == this.Precision) && (col.Identity == this.Identity) && (col.NotNull == this.NotNull));
 }