//初始化"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++; } }
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); }
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); }
public void AddColumn(PdmColumn mColumn) { this.Columns.Add(mColumn); }
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)); }