public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { string StringVal = CswTools.XmlRealAttributeName(PropRow[_QuantitySubField.ToXmlNodeName()].ToString()); if (CswTools.IsFloat(StringVal)) { Quantity = Convert.ToDouble(StringVal); } CachedUnitName = CswTools.XmlRealAttributeName(PropRow[_UnitNameSubField.ToXmlNodeName()].ToString()); string NodeId = CswTools.XmlRealAttributeName(PropRow[_UnitIdSubField.ToXmlNodeName()].ToString()); if (NodeMap != null && NodeMap.ContainsKey(NodeId.ToLower())) { UnitId = new CswPrimaryKey("nodes", NodeMap[NodeId.ToLower()]); } else if (CswTools.IsInteger(NodeId)) { UnitId = new CswPrimaryKey("nodes", CswConvert.ToInt32(NodeId)); } else { UnitId = null; } if (null != UnitId) { PendingUpdate = true; } }
public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { if (PropRow.Table.Columns.Contains(_LowerSubField.ToXmlNodeName())) { string Val = CswTools.XmlRealAttributeName(PropRow[_LowerSubField.ToXmlNodeName()].ToString()); if (Val != string.Empty) { Lower = Convert.ToDouble(PropRow[_LowerSubField.ToXmlNodeName()].ToString()); } } if (PropRow.Table.Columns.Contains(_TargetSubField.ToXmlNodeName())) { string Val = CswTools.XmlRealAttributeName(PropRow[_TargetSubField.ToXmlNodeName()].ToString()); if (Val != string.Empty) { Target = Convert.ToDouble(PropRow[_TargetSubField.ToXmlNodeName()].ToString()); } } if (PropRow.Table.Columns.Contains(_UpperSubField.ToXmlNodeName())) { string Val = CswTools.XmlRealAttributeName(PropRow[_UpperSubField.ToXmlNodeName()].ToString()); if (Val != string.Empty) { Upper = Convert.ToDouble(PropRow[_UpperSubField.ToXmlNodeName()].ToString()); } } if (PropRow.Table.Columns.Contains(_LowerInclusiveSubField.ToXmlNodeName())) { LowerInclusive = CswConvert.ToBoolean(CswTools.XmlRealAttributeName(PropRow[_LowerInclusiveSubField.ToXmlNodeName()].ToString())); } if (PropRow.Table.Columns.Contains(_UpperInclusiveSubField.ToXmlNodeName())) { UpperInclusive = CswConvert.ToBoolean(CswTools.XmlRealAttributeName(PropRow[_UpperInclusiveSubField.ToXmlNodeName()].ToString())); } }
public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { Red = CswTools.XmlRealAttributeName(PropRow[_RedSubField.ToXmlNodeName()].ToString()); Yellow = CswTools.XmlRealAttributeName(PropRow[_YellowSubField.ToXmlNodeName()].ToString()); Blue = CswTools.XmlRealAttributeName(PropRow[_BlueSubField.ToXmlNodeName()].ToString()); White = CswTools.XmlRealAttributeName(PropRow[_WhiteSubField.ToXmlNodeName()].ToString()); }
} // ToJSON() public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { CswCommaDelimitedString NewValue = new CswCommaDelimitedString(); NewValue.FromString(CswTools.XmlRealAttributeName(PropRow[_ValueSubField.ToXmlNodeName()].ToString())); Value = NewValue; }
public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { string Val = CswTools.XmlRealAttributeName(PropRow[_DateValueSubField.ToXmlNodeName()].ToString()); if (Val != string.Empty) { DateTimeValue = Convert.ToDateTime(Val); } }
public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { string ProspectiveSequence = CswTools.XmlRealAttributeName(PropRow[_SequenceSubField.ToXmlNodeName()].ToString()); if (ProspectiveSequence != string.Empty) { setSequenceValueOverride(ProspectiveSequence, false); } }
public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { if (PropRow.Table.Columns.Contains(_ValueSubField.ToXmlNodeName())) { string Val = CswTools.XmlRealAttributeName(PropRow[_ValueSubField.ToXmlNodeName()].ToString()); if (Val != string.Empty) { Value = Convert.ToDouble(PropRow[_ValueSubField.ToXmlNodeName()].ToString()); } } }
public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { string StringStartDateTime = CswTools.XmlRealAttributeName(PropRow[_StartDateTimeSubField.ToXmlNodeName()].ToString()); if (StringStartDateTime != string.Empty) { StartDateTime = Convert.ToDateTime(StringStartDateTime); } Units = CswTools.XmlRealAttributeName(PropRow[_UnitsSubField.ToXmlNodeName()].ToString()); PendingUpdate = true; }
} // ToJSON() public override void ReadDataRow( DataRow PropRow, Dictionary<string, Int32> NodeMap, Dictionary<Int32, Int32> NodeTypeMap ) { string NodeId = CswTools.XmlRealAttributeName( PropRow[_NodeIDSubField.ToXmlNodeName()].ToString() ); if( NodeMap != null && NodeMap.ContainsKey( NodeId.ToLower() ) ) RelatedNodeId = new CswPrimaryKey( "nodes", NodeMap[NodeId.ToLower()] ); else if( CswTools.IsInteger( NodeId ) ) RelatedNodeId = new CswPrimaryKey( "nodes", CswConvert.ToInt32( NodeId ) ); else RelatedNodeId = null; if( null != RelatedNodeId ) { PendingUpdate = true; } }
public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { //RateInterval = new CswRateInterval( PropRow[_IntervalSubField.ToXmlNodeName()].ToString() ); if (PropRow.Table.Columns.Contains(_IntervalSubField.ToXmlNodeName())) { string IntervalXmlAsString = CswTools.XmlRealAttributeName(PropRow[_IntervalSubField.ToXmlNodeName()].ToString()); XmlDocument Doc = new XmlDocument(); XmlNode IntervalNode = CswXmlDocument.SetDocumentElement(Doc, _IntervalSubField.ToXmlNodeName()); IntervalNode.InnerXml = IntervalXmlAsString.Trim(); CswRateInterval NewRateInterval = new CswRateInterval(_CswNbtResources); NewRateInterval.ReadXml(IntervalNode); // Setting RateInterval triggers the change to the property value -- don't skip this step RateInterval = NewRateInterval; } }
public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { // Getting the value as a string is on purpose. //SelectedNodeId = new CswPrimaryKey( "nodes", _HandleReference( CswConvert.ToInt32(PropRow[_NodeIdSubField.ToXmlNodeName()]), PropRow[_BarcodeSubField.ToXmlNodeName()].ToString(), NodeMap ) ); string NodeId = CswTools.XmlRealAttributeName(PropRow[_NodeIdSubField.ToXmlNodeName()].ToString()); if (NodeMap != null && NodeMap.ContainsKey(NodeId.ToLower())) { SelectedNodeId = new CswPrimaryKey("nodes", NodeMap[NodeId.ToLower()]); } else { //RelatedNodeId = new CswPrimaryKey( "nodes", CswConvert.ToInt32( NodeId ) ); CswPrimaryKey LocationNodeId = null; if (PropRow.Table.Columns.Contains(_BarcodeSubField.ToXmlNodeName())) { LocationNodeId = _HandleReference(NodeId, CswTools.XmlRealAttributeName(PropRow[_BarcodeSubField.ToXmlNodeName()].ToString())); } else { LocationNodeId = _HandleReference(NodeId, string.Empty); } SelectedNodeId = LocationNodeId; } if (null != SelectedNodeId) { PendingUpdate = true; } //if( PropRow.Table.Columns.Contains( _RowSubField.ToXmlNodeName() ) ) //{ // string StringVal = PropRow[_RowSubField.ToXmlNodeName()].ToString(); // if( CswTools.IsInteger( StringVal ) ) // SelectedRow = CswConvert.ToInt32( StringVal ); //} //if( PropRow.Table.Columns.Contains( _ColumnSubField.ToXmlNodeName() ) ) //{ // string StringVal = PropRow[_ColumnSubField.ToXmlNodeName()].ToString(); // if( CswTools.IsInteger( StringVal ) ) // SelectedColumn = CswConvert.ToInt32( StringVal ); //} PendingUpdate = true; }
public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { if (IsAnswerEditable) { Answer = CswTools.XmlRealAttributeName(PropRow[_AnswerSubField.ToXmlNodeName()].ToString()); } Comments = CswTools.XmlRealAttributeName(PropRow[_CommentsSubField.ToXmlNodeName()].ToString()); CorrectiveAction = CswTools.XmlRealAttributeName(PropRow[_CorrectiveActionSubField.ToXmlNodeName()].ToString()); String DateAnsweredString = CswTools.XmlRealAttributeName(PropRow[_DateAnsweredSubField.ToXmlNodeName()].ToString()); if (!String.IsNullOrEmpty(DateAnsweredString)) { DateAnswered = Convert.ToDateTime(DateAnsweredString); } String DateCorrectedString = CswTools.XmlRealAttributeName(PropRow[_DateCorrectedSubField.ToXmlNodeName()].ToString()); if (!String.IsNullOrEmpty(DateCorrectedString)) { DateCorrected = Convert.ToDateTime(DateCorrectedString); } }
public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { string UserIds = CswTools.XmlRealAttributeName(PropRow[_SelectedUserIdsSubField.ToXmlNodeName()].ToString()); SelectedUserIds.FromString(UserIds); foreach (string UserIdString in SelectedUserIds) { Int32 UserId = Int32.MinValue; if (NodeMap != null && NodeMap.ContainsKey(UserIdString.ToLower())) { UserId = NodeMap[UserIdString.ToLower()]; } else if (CswTools.IsInteger(UserIdString)) { UserId = CswConvert.ToInt32(UserIdString); } if (UserId != Int32.MinValue) { SelectedUserIds.Replace(UserIdString, UserId.ToString()); } } PendingUpdate = true; }
} // ToJSON() public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { SelectedNodeTypeIds.FromString(_HandleReferences(CswTools.XmlRealAttributeName(PropRow[_SelectedNodeTypeIdsSubField.ToXmlNodeName()].ToString()), NodeTypeMap)); }
} // ToJSON() public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { // TODO: Test that this is the correct logic Text = CswTools.XmlRealAttributeName(PropRow[_TextSubField.ToXmlNodeName()].ToString()); //Value = CswTools.XmlRealAttributeName( PropRow[_ValueSubField.ToXmlNodeName()].ToString() ); }
private void setupGridColumns(DataSet DS, CswNbtView View) { _Grid.Columns.Clear(); // Edit column GridBoundColumn EditColumn = new GridBoundColumn(); EditColumn.UniqueName = "EditColumn"; EditColumn.HeaderText = "Edit"; EditColumn.DataField = "Edit"; EditColumn.Display = ShowActionColumns; _Grid.Columns.Add(EditColumn); // Node column GridBoundColumn NodeNameColumn = new GridBoundColumn(); NodeNameColumn.UniqueName = "NodeName"; NodeNameColumn.HeaderText = "Node Name"; NodeNameColumn.DataField = "NodeName"; // BZ 6704 NodeNameColumn.Visible = false; NodeNameColumn.Display = false; _Grid.Columns.Add(NodeNameColumn); // NodeKey column GridBoundColumn NodeKeyColumn = new GridBoundColumn(); NodeKeyColumn.UniqueName = "NodeKey"; NodeKeyColumn.HeaderText = "NodeKey"; NodeKeyColumn.DataField = "NodeKey"; NodeKeyColumn.Display = false; _Grid.Columns.Add(NodeKeyColumn); foreach (DataTable Table in DS.Tables) { foreach (DataColumn Column in Table.Columns) { string ColumnName = Column.ColumnName; if (ColumnName.Length > PropColumnPrefix.Length && ColumnName.Substring(0, PropColumnPrefix.Length) == PropColumnPrefix) { string NoPrefixColumnName = ColumnName.Substring(PropColumnPrefix.Length); //Int32 CurrentNodeTypePropId = CswConvert.ToInt32( NoPrefixColumnName.Substring( 0, NoPrefixColumnName.IndexOf( '_' ) ) ); string RealColumnName = CswTools.XmlRealAttributeName(NoPrefixColumnName); //.Substring( NoPrefixColumnName.IndexOf( '_' ) + 1 ) ); //CswNbtMetaDataNodeTypeProp CurrentNodeTypeProp = _CswNbtResources.MetaData.getNodeTypeProp( CurrentNodeTypePropId ); //CswNbtViewProperty CurrentViewProp = View.FindPropertyById( CswNbtPropType.NodeTypePropId, CurrentNodeTypePropId ); CswNbtViewProperty CurrentViewProp = View.findPropertyByName(RealColumnName); //if( CurrentViewProp == null ) // CurrentViewProp = View.FindPropertyByName( CurrentNodeTypeProp.PropName ); CswEnumNbtFieldType ColFieldType = CswNbtResources.UnknownEnum; if (CurrentViewProp != null) { if (((CswNbtViewRelationship)CurrentViewProp.Parent).SecondType == CswEnumNbtViewRelatedIdType.NodeTypeId) { CswNbtMetaDataNodeType CurrentNT = _CswNbtResources.MetaData.getNodeType(((CswNbtViewRelationship)CurrentViewProp.Parent).SecondId); CswNbtMetaDataNodeTypeProp CurrentNTP = CurrentNT.getNodeTypeProp(RealColumnName); if (CurrentNTP != null) { ColFieldType = CurrentNTP.getFieldTypeValue(); } } else if (((CswNbtViewRelationship)CurrentViewProp.Parent).SecondType == CswEnumNbtViewRelatedIdType.ObjectClassId) { CswNbtMetaDataObjectClass CurrentOC = _CswNbtResources.MetaData.getObjectClass(((CswNbtViewRelationship)CurrentViewProp.Parent).SecondId); foreach (CswNbtMetaDataNodeType CurrentNT in CurrentOC.getNodeTypes()) { CswNbtMetaDataNodeTypeProp CurrentNTP = CurrentNT.getNodeTypeProp(RealColumnName); if (CurrentNTP != null) { ColFieldType = CurrentNTP.getFieldTypeValue(); } } } } GridBoundColumn thisColumn = null; //switch( CurrentNodeTypeProp.FieldType.FieldType ) switch (ColFieldType) { case CswEnumNbtFieldType.DateTime: thisColumn = new GridDateTimeColumn(); thisColumn.DataFormatString = "{0:M/d/yyyy}"; thisColumn.DataType = typeof(DateTime); break; //case CswEnumNbtFieldType.Time: // thisColumn = new GridDateTimeColumn(); // thisColumn.DataFormatString = "{0:H:mm:ss}"; // thisColumn.DataType = typeof( DateTime ); // break; default: thisColumn = new GridBoundColumn(); break; } thisColumn.UniqueName = ColumnName; thisColumn.HeaderText = RealColumnName; thisColumn.DataField = ColumnName; if (CurrentViewProp != null && CurrentViewProp.Width != Int32.MinValue) { thisColumn.HeaderStyle.Width = Unit.Parse((CswConvert.ToInt32(CurrentViewProp.Width * 7)).ToString() + "px"); // average pixel width per character } //thisColumn.OrderIndex = CurrentViewProp.Order; //Telerik.Web.UI.GridTableView GTV = new GridTableView( _Grid ); if (CurrentViewProp != null && CurrentViewProp.Order > 0 && _Grid.Columns.Count >= CurrentViewProp.Order) { _Grid.Columns.AddAt(CurrentViewProp.Order, thisColumn); } else { _Grid.Columns.Add(thisColumn); } } } } // Delete column GridBoundColumn DeleteColumn = new GridBoundColumn(); DeleteColumn.UniqueName = "DeleteColumn"; DeleteColumn.HeaderText = "Delete"; DeleteColumn.DataField = "Delete"; DeleteColumn.Display = ShowActionColumns; _Grid.Columns.Add(DeleteColumn); } // setupGridColumns()
public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { setMol(CswTools.XmlRealAttributeName(PropRow[_MolSubField.ToXmlNodeName()].ToString())); }
public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { ContentType = CswTools.XmlRealAttributeName(PropRow[_ContentTypeSubField.ToXmlNodeName()].ToString()); FileName = CswTools.XmlRealAttributeName(PropRow[_FileNameSubField.ToXmlNodeName()].ToString()); }
public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { EncryptedPassword = CswTools.XmlRealAttributeName(PropRow[_EncryptedPasswordSubField.ToXmlNodeName()].ToString()); }
} // ToJSON() public override void ReadDataRow( DataRow PropRow, Dictionary<string, Int32> NodeMap, Dictionary<Int32, Int32> NodeTypeMap ) { SelectedViewIds.FromString( CswTools.XmlRealAttributeName( PropRow[_SelectedViewIdsSubField.ToXmlNodeName()].ToString() ) ); PendingUpdate = true; }
public override void ReadDataRow(DataRow PropRow, Dictionary <string, Int32> NodeMap, Dictionary <Int32, Int32> NodeTypeMap) { Text = CswTools.XmlRealAttributeName(PropRow[_TextSubField.ToXmlNodeName()].ToString()); Href = CswTools.XmlRealAttributeName(PropRow[_HrefSubField.ToXmlNodeName()].ToString()); }