本文整理汇总了C#中IRow.get_Value方法的典型用法代码示例。如果您正苦于以下问题:C# IRow.get_Value方法的具体用法?C# IRow.get_Value怎么用?C# IRow.get_Value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRow
的用法示例。
在下文中一共展示了IRow.get_Value方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QAException
public QAException(IRow exception)
{
if (exception == null)
throw new ArgumentNullException("exception", "Cannot pass null row to QAException");
this._objectID = exception.OID;
int idx;
idx = exception.Fields.FindField("ATTACHMENT");
this._attachment = exception.get_Value(idx).ToString();
idx = exception.Fields.FindField("DATA_EXCEPTION_POINT_ID");
this._exceptionID = Convert.ToInt32(exception.get_Value(idx));
idx = exception.Fields.FindField("DATA_EXCEPTION_STATUS");
this._status = exception.get_Value(idx).ToString();
idx = exception.Fields.FindField("EXCEPTION_DESCRIPTION");
this._description = exception.get_Value(idx).ToString();
idx = exception.Fields.FindField("LATITUDE");
this._latitude = Convert.ToDouble(exception.get_Value(idx));
idx = exception.Fields.FindField("LONGITUDE");
this._longitude = Convert.ToDouble(exception.get_Value(idx));
idx = exception.Fields.FindField("OPERATIONAL_DATASET_NAME");
this._operationDSName = exception.get_Value(idx).ToString();
idx = exception.Fields.FindField("QA_TEST_NAME");
this._testName = exception.get_Value(idx).ToString();
}
示例2: QATest
public QATest(IRow testRow, ITable paramTable, bool canWrite)
{
if (testRow == null)
throw new ArgumentNullException("testRow", "No row from the QA test table passed to constructor for QATest");
if (paramTable == null)
throw new ArgumentNullException("paramTable", "No QA parameter table passed to constructor for QATest");
int index;
index = testRow.Fields.FindField(TEST_NAME_FIELD);
if (index < 0)
throw new System.MissingFieldException(QATestCollection.TABLE_NAME, TEST_NAME_FIELD);
this._name = testRow.get_Value(index).ToString();
index = testRow.Fields.FindField(COM_CLSID_FIELD);
if (index < 0)
throw new System.MissingFieldException(QATestCollection.TABLE_NAME, COM_CLSID_FIELD);
this._comClsid = testRow.get_Value(index).ToString();
// Constrained to be YES or NO
index = testRow.Fields.FindField(MANDITORY_FIELD);
if (index < 0)
throw new System.MissingFieldException(QATestCollection.TABLE_NAME, MANDITORY_FIELD);
string isManditoryStr = testRow.get_Value(index).ToString();
this._isManditory = isManditoryStr.ToUpper().Equals("YES");
this._isActive = this._isManditory; // if manditory, make active
// Try to instantiate a copy of the COM object
try
{
System.Guid theGuid = new Guid(this._comClsid);
this._test = this.CreateTestFromGuid(theGuid, true);
// Load the parameter collection
this._parameters = new QAParameterCollection(paramTable, this.Test);
}
catch (Exception ex)
{
util.Logger.Write("Could not instantiate a IDataQualityTest with CLSID '" + this._comClsid + "'" + Environment.NewLine
+ ex.Message + Environment.NewLine
+ ex.StackTrace.ToString(), util.Logger.LogLevel.Warn);
}
this._canWrite = canWrite;
}
示例3: QAParameter
public QAParameter(IRow paramRow)
{
if (paramRow == null)
throw new ArgumentNullException("paramRow", "No row from the QA parameter table passed to constructor for QAParameter");
int index;
index = paramRow.Fields.FindField(TEST_NAME_FIELD);
if (index < 0)
throw new System.MissingFieldException(QAParameterCollection.TABLE_NAME, TEST_NAME_FIELD);
this._testName = paramRow.get_Value(index).ToString();
index = paramRow.Fields.FindField(PARAMETER_NAME_FIELD);
if (index < 0)
throw new System.MissingFieldException(QAParameterCollection.TABLE_NAME, PARAMETER_NAME_FIELD);
this._name = paramRow.get_Value(index).ToString();
index = paramRow.Fields.FindField(PARAMETER_VALUE_FIELD);
if (index < 0)
throw new System.MissingFieldException(QAParameterCollection.TABLE_NAME, PARAMETER_VALUE_FIELD);
this._value = paramRow.get_Value(index).ToString();
}
示例4: GetAttributes
public Dictionary<string, object> GetAttributes(IRow row)
{
var atts = new Dictionary<string, object>();
for (int i = 0; i < row.Fields.FieldCount; i++)
{
esriFieldType esriType = row.Fields.get_Field(i).Type;
switch (esriType)
{
case esriFieldType.esriFieldTypeBlob:
break;
case esriFieldType.esriFieldTypeDate:
DateTime date = (DateTime)row.get_Value(i);
atts.Add(row.Fields.get_Field(i).AliasName, date.Date.ToShortDateString());
break;
case esriFieldType.esriFieldTypeDouble:
atts.Add(row.Fields.get_Field(i).AliasName, row.get_Value(i));
break;
case esriFieldType.esriFieldTypeGUID:
break;
case esriFieldType.esriFieldTypeGeometry:
break;
case esriFieldType.esriFieldTypeGlobalID:
break;
case esriFieldType.esriFieldTypeInteger:
atts.Add(row.Fields.get_Field(i).AliasName, row.get_Value(i));
break;
case esriFieldType.esriFieldTypeOID:
break;
case esriFieldType.esriFieldTypeRaster:
break;
case esriFieldType.esriFieldTypeSingle:
atts.Add(row.Fields.get_Field(i).AliasName, row.get_Value(i));
break;
case esriFieldType.esriFieldTypeSmallInteger:
atts.Add(row.Fields.get_Field(i).AliasName, row.get_Value(i));
break;
case esriFieldType.esriFieldTypeString:
atts.Add(row.Fields.get_Field(i).AliasName, row.get_Value(i));
break;
case esriFieldType.esriFieldTypeXML:
break;
default:
break;
}
}
return atts;
}
示例5: CopyRow
public static void CopyRow(IRow pSrcFea, IRow pDestFea)
{
try
{
ITable table = pSrcFea.Table;
ITable table2 = pDestFea.Table;
IField field = null;
IField field2 = null;
IField field3 = null;
IField field4 = null;
if (table is IFeatureClass)
{
field = (table as IFeatureClass).LengthField;
field2 = (table as IFeatureClass).AreaField;
}
if (table2 is IFeatureClass)
{
field3 = (table2 as IFeatureClass).LengthField;
field4 = (table2 as IFeatureClass).AreaField;
}
int num = pSrcFea.Fields.FieldCount;
for (int i = 0; i < num; i++)
{
IField field5 = table.Fields.get_Field(i);
if ((((field5.Type != esriFieldType.esriFieldTypeOID)
&& (field5.Type != esriFieldType.esriFieldTypeGeometry)) && (field5 != field)) && (field5 != field2))
{
string str = field5.Name.ToUpper();
object obj2 = pSrcFea.get_Value(i);
if ((obj2 != null) || (obj2 is DBNull))
{
int num3 = table2.Fields.FindField(str);
if (num3 >= 0)
{
IField field6 = table2.Fields.get_Field(num3);
if (((((field6.Type != esriFieldType.esriFieldTypeOID) &&
(field6.Type != esriFieldType.esriFieldTypeGeometry)) && (field6 != field3)) && (field6 != field4)) && (((obj2 != null) && !(obj2 is DBNull)) && field6.CheckValue(obj2)))
{
try
{
pDestFea.set_Value(num3, obj2);
}
catch
{
}
}
}
}
}
}
pDestFea.Store();
}
catch (Exception)
{
}
}
示例6: RetrieveOSMTypeAddendum
private string RetrieveOSMTypeAddendum(IRow errorRow, int sourceFeatureClassNameIndex)
{
string osmTypeString = resourceManager.GetString("OSMEditor_ConflictEditor_osmtypedescription_unk");
string fcsourcename = errorRow.get_Value(sourceFeatureClassNameIndex).ToString();
if (fcsourcename.Contains("_osm_pt") == true)
{
osmTypeString = resourceManager.GetString("OSMEditor_ConflictEditor_osmtypedescription_pt"); ;
}
else if (fcsourcename.Contains("_osm_ln") == true)
{
osmTypeString = resourceManager.GetString("OSMEditor_ConflictEditor_osmtypedescription_ln"); ;
}
else if (fcsourcename.Contains("_osm_ply") == true)
{
osmTypeString = resourceManager.GetString("OSMEditor_ConflictEditor_osmtypedescription_ply"); ;
}
else if (fcsourcename.Contains("_osm_relation") == true)
{
osmTypeString = resourceManager.GetString("OSMEditor_ConflictEditor_osmtypedescription_relation"); ;
}
return osmTypeString;
}
示例7: ProcessFeature
public void ProcessFeature(IWorkspaceEdit iwe, IFeatureLayer ifl_active, IRow rw)
{
double value = double.NaN;
if (CoordinateSystem == "")
{
CoordinateSystem = ((IFeature)rw).Shape.SpatialReference.Name;
}
if (this.LinearUnit == null || this.LinearUnit == "")
{
if (fieldTier == 2)
{
LinearUnit = rw.get_Value(GetFieldUnitIndex()).ToString();
}
if (this.LinearUnit == null || this.LinearUnit.Trim() == "")
{
LinearUnit = GetSpatialReferenceLinearUnit(((IFeature)rw).Shape.SpatialReference);
}
}
if (LinearUnit.IndexOf("meter", 0, StringComparison.CurrentCultureIgnoreCase) > -1)
{
if (useArealUnit)
{
currentAreaUnit = esriAreaUnits.esriSquareMeters;
LinearUnit = "Square Meters";
}
else
{
currentLinearUnit = esriUnits.esriMeters;
}
}
else if (LinearUnit.IndexOf("foot", 0, StringComparison.CurrentCultureIgnoreCase) > -1)
{
if (useArealUnit)
{
currentAreaUnit = esriAreaUnits.esriSquareFeet;
LinearUnit = "Square Feet";
}
else
{
currentLinearUnit = esriUnits.esriFeet;
}
}
else if (LinearUnit.IndexOf("acre", 0, StringComparison.CurrentCultureIgnoreCase) > -1)
{
currentAreaUnit = esriAreaUnits.esriAcres;
currentLinearUnit = esriUnits.esriUnknownUnits;
LinearUnit = "Acres";
}
if (doReCalcValues || !double.TryParse(rw.get_Value(GetFieldIndex()).ToString(), out value) || value == double.NaN || value == 0.0)
{
value = DoMeasure(rw);
//try writing the (single) measured value to the table
try
{
IFeature feat = (IFeature)rw;
//if we are re-calculating all values, there is no need to start editing on each row
if (!doReCalcValues)
{
if (!iwe.IsBeingEdited())
iwe.StartEditing(true);
iwe.StartEditOperation();
}
feat.set_Value(GetFieldIndex(), value);
feat.set_Value(GetFieldUnitIndex(), LinearUnit);
feat.Store();
}
catch (Exception err)
{
}
finally
{
if (!doReCalcValues)
{
iwe.StopEditOperation();
if (iwe.IsBeingEdited())
iwe.StopEditing(true);
//there may be more than one row that requires editing
doReCalcValues = true;
}
}
}
values.Add(value);
}
示例8: FillNewRecord
private void FillNewRecord(IRow row, IFeature pFeatureTarg, string legalDesc, Hashtable attributeHash)
{
try
{
if (row != null)
{
IFields pFields = row.Fields;
for (int i = 0; i < pFields.FieldCount; i++)
{
if (pFields.get_Field(i).Type != esriFieldType.esriFieldTypeOID &&
pFields.get_Field(i).Type != esriFieldType.esriFieldTypeGeometry &&
pFields.get_Field(i).Type != esriFieldType.esriFieldTypeRaster &&
pFields.get_Field(i).Type != esriFieldType.esriFieldTypeBlob &&
pFields.get_Field(i).Type != esriFieldType.esriFieldTypeGUID)
{
if (row.Fields.get_Field(i).Name.ToUpper() == "LEGAL_DSC")
{
if (legalDesc.Equals("Legal Description:")) legalDesc = "";
if (legalDesc.Length > 2147483647) legalDesc.Substring(0, 2147483646);
pFeatureTarg.set_Value(i, legalDesc);
}
if (attributeHash.ContainsKey(row.Fields.get_Field(i).Name.ToUpper()))
{
pFeatureTarg.set_Value(i, attributeHash[row.Fields.get_Field(i).Name.ToUpper()]);
}
else
{
pFeatureTarg.set_Value(i, row.get_Value(i));
}
//pFeatureTarg.set_Value(pFeatureTarg.Fields.FindFieldByAliasName(pFields.get_Field(i).AliasName), pRow.get_Value(i));
}
}
}
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message + "\n" + ex.StackTrace);
util.Logger.Write(" Descrip : Fills the SID list view with results from a successful SID validation query." +
"\n Message : " + ex.Message +
"\n StackTrc : " + ex.StackTrace, util.Logger.LogLevel.Debug);
}
}
示例9: GenerateDataString
private string GenerateDataString(ref IRow row)
{
string textOut = "";
// On a zero-based index, iterate through the fields in the collection.
for (int fieldIndex = 0; fieldIndex < row.Fields.FieldCount; fieldIndex++)
{
if (fieldIndex > 0) textOut += DELIMITER;
IField field = row.Fields.get_Field(fieldIndex);
// for shape fields in a point layer, export the associated X and Y coordinates
if (field.Type == esriFieldType.esriFieldTypeGeometry)
{
if (field.GeometryDef.GeometryType == esriGeometryType.esriGeometryPoint)
{
// x y location information must be retrieved from the Feature
IPoint point = row.get_Value(fieldIndex) as ESRI.ArcGIS.Geometry.Point;
textOut += point.X.ToString();
textOut += DELIMITER;
textOut += point.Y.ToString();
}
else if (field.GeometryDef.GeometryType == esriGeometryType.esriGeometryPolyline ||
field.GeometryDef.GeometryType == esriGeometryType.esriGeometryPolygon)
{
StringBuilder stringBuffer = new StringBuilder();
var pointCollection = row.get_Value(fieldIndex) as IPointCollection;
for (int pointIndex = 0; pointIndex < pointCollection.PointCount; pointIndex++)
{
IPoint point = pointCollection.get_Point(pointIndex);
if (pointIndex > 0)
stringBuffer.Append(",");
stringBuffer.Append("{");
stringBuffer.Append(point.X);
stringBuffer.Append(",");
stringBuffer.Append(point.Y);
stringBuffer.Append(",");
stringBuffer.Append(point.Z);
stringBuffer.Append(",");
stringBuffer.Append(point.M);
stringBuffer.Append("}");
}
textOut += stringBuffer.ToString();
}
else
{
textOut += "Shape";
}
}
// Handle the Locations field for polyline and polygon barrier classes
else if (field.Name == "Locations" && field.Type == esriFieldType.esriFieldTypeBlob)
{
StringBuilder stringBuffer = new StringBuilder();
// get the location ranges out of the barrier feature
var naLocRangesObject = row as INALocationRangesObject;
if (naLocRangesObject == null) // Not a location ranges object
textOut += row.get_Value(fieldIndex).ToString();
var naLocRanges = naLocRangesObject.NALocationRanges;
if (naLocRanges == null) // does not have any location ranges
textOut += row.get_Value(fieldIndex).ToString();
// add all of the junctions included in the barrier to the Junctions dataGrid
stringBuffer.Append("{Junctions:{");
long junctionCount = naLocRanges.JunctionCount;
int junctionEID = -1;
for (int i = 0; i < junctionCount; i++)
{
naLocRanges.QueryJunction(i, ref junctionEID);
if (i > 0)
stringBuffer.Append(",");
stringBuffer.Append("{");
stringBuffer.Append(junctionEID);
stringBuffer.Append("}");
}
stringBuffer.Append("}");
// add all of the edges included in the barrier to the Edges dataGrid
stringBuffer.Append(",EdgeRanges:{");
long edgeRangeCount = naLocRanges.EdgeRangeCount;
int edgeEID = -1;
double fromPosition, toPosition;
fromPosition = toPosition = -1;
esriNetworkEdgeDirection edgeDirection = esriNetworkEdgeDirection.esriNEDNone;
for (int i = 0; i < edgeRangeCount; i++)
{
naLocRanges.QueryEdgeRange(i, ref edgeEID, ref edgeDirection, ref fromPosition, ref toPosition);
string directionValue = "";
if (edgeDirection == esriNetworkEdgeDirection.esriNEDAlongDigitized) directionValue = "Along Digitized";
else if (edgeDirection == esriNetworkEdgeDirection.esriNEDAgainstDigitized) directionValue = "Against Digitized";
if (i > 0)
stringBuffer.Append(",");
stringBuffer.Append("{");
stringBuffer.Append(edgeEID);
stringBuffer.Append(",");
//.........这里部分代码省略.........
示例10: PropertySet
/// <summary>
/// Gets a property set of name values converted to string
/// for a given feature or row.
/// </summary>
/// <param name="row">One row feature to descrive</param>
/// <returns>List</returns>
public static List<NameValuePair> PropertySet(IRow row)
{
String subtypeFieldName = string.Empty;
ISubtypes subtypes = row.Table as ISubtypes;
List<NameValuePair> result = new List<NameValuePair>();
IFields fields = row.Fields;
int count = fields.FieldCount;
// -------------------------------------
// For each field check the types and
// do the appropriate thing to convert
// to a string representation for
// display purposes.
//
// Also need to deal with domain values.
// --------------------------------------
for (int idx = 0; idx < count; idx++)
{
// get name and alias
IField field = fields.get_Field(idx);
IDomain domain = field.Domain;
string alias = field.AliasName;
string name = field.Name;
string value = string.Empty;
// Are we dealing with a subtype field?
if (subtypes.HasSubtype &&
(0 == string.Compare(subtypes.SubtypeFieldName,field.Name,true)))
{
IRowSubtypes rowSubTypes = row as IRowSubtypes;
value = subtypes.SubtypeName[rowSubTypes.SubtypeCode];
}
else if (domain != null) // field has domain
{
if (domain is ICodedValueDomain)
{
// If field type is text
if (field.Type == esriFieldType.esriFieldTypeString
|| field.Type == esriFieldType.esriFieldTypeInteger)
{
value = GdbUtils.CheckForCodedName(field, row.get_Value(idx));
}
}
else // Its a range domain (numeric only)
{
// Can just use value as is
value = row.get_Value(idx).ToString();
}
}
else // non domain or subtype field, just get string representation
{
value = row.get_Value(idx).ToString();
}
NameValuePair item = new NameValuePair(alias, name, value);
result.Add(item);
}
return result;
}
示例11: SetDynamicValues
public bool SetDynamicValues(IObject inObject, string mode, out List<IObject> ChangeFeatureList, out List<IObject> NewFeatureList, out List<IObject> ChangeFeatureGeoList)
{
NumberFormatInfo nfi = new CultureInfo(A4LGSharedFunctions.Localizer.GetString("AA_CultureInfo"), false).NumberFormat;
nfi.NumberGroupSeparator = "";
ChangeFeatureList = null;
NewFeatureList = null;
ChangeFeatureGeoList = null;
IMSegmentation mseg = null;
INetworkFeature netFeat = null;
IJunctionFeature iJuncFeat = null;
IEdgeFeature iEdgeFeat = null;
//ProgressBar
//ESRI.ArcGIS.Framework.IProgressDialogFactory progressDialogFactory = null;
//ESRI.ArcGIS.esriSystem.IStepProgressor stepProgressor = null;
//ESRI.ArcGIS.Framework.IProgressDialog2 progressDialog = null;
//// Create a CancelTracker
//ESRI.ArcGIS.esriSystem.ITrackCancel trackCancel = new ESRI.ArcGIS.Display.CancelTrackerClass();
//trackCancel.CancelOnKeyPress = true;
// trackCancel.CancelOnClick = true;
try
{
AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_14d"));
if (AAState.PerformUpdates == false)
{
AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_14a"));
}
if (AAState.PerformUpdates && AAState._dv == null)
{
AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_14b") + AAState._defaultsTableName);
AAState.PerformUpdates = false;
return false;
}
if (AAState.PerformUpdates && AAState._dv != null)
{
if (AAState._dv.Table == null)
{
AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_14c"));
return false;
}
if (inObject == null)
{
AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_14e"));
return false;
}
if (inObject.Table == AAState._tab)
{
if (inObject.get_Value(inObject.Fields.FindField("VALUEMETHOD")).ToString().ToUpper() == "LAST_VALUE")
{
if (inObject.get_Value(inObject.Fields.FindField("FIELDNAME")) != null)
{
if (inObject.get_Value(inObject.Fields.FindField("FIELDNAME")) != DBNull.Value)
{
try
{
LastValueEntry lstVal = AAState.lastValueProperties.GetProperty(inObject.get_Value(inObject.Fields.FindField("FIELDNAME")).ToString()) as LastValueEntry;
if (lstVal != null)
{
lstVal.On_Manual = Globals.toBoolean(inObject.get_Value(inObject.Fields.FindField("ON_MANUAL")).ToString());
lstVal.On_Create = Globals.toBoolean(inObject.get_Value(inObject.Fields.FindField("ON_CREATE")).ToString());
lstVal.On_ChangeAtt = Globals.toBoolean(inObject.get_Value(inObject.Fields.FindField("ON_CHANGE")).ToString());
if (inObject.Fields.FindField("ON_CHANGEGEO") >= 0)
{
lstVal.On_ChangeGeo = Globals.toBoolean(inObject.get_Value(inObject.Fields.FindField("ON_CHANGEGEO")).ToString());
}
}
AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_14f"));
}
catch
{
//property does not exist
}
}
}
}
else
{
AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_14g"));
}
return false;
}
string modeVal;
//.........这里部分代码省略.........
开发者ID:rlwarford,项目名称:local-government-desktop-addins,代码行数:101,代码来源:AttributeAssistantEditorExtension.cs
示例12: SetDynamicValues
//.........这里部分代码省略.........
_currentDatasetNameItems = _currentDataset.Name.Split('.');
tableName = _currentDatasetNameItems[_currentDatasetNameItems.GetLength(0) - 1];
stepProgressor.Message = "Checking rules for edited feature: " + inObject.Class.AliasName;
progressDialog.Description = "Checking rules for edited feature: " + inObject.Class.AliasName;
AAState.WriteLine("***********************************************************");
AAState.WriteLine("############ " + DateTime.Now + " ################");
AAState.WriteLine("");
AAState.WriteLine(" Setting sort order: Field - RUNORDER");
if (AAState._dv.Table.Columns.Contains("RUN_WEIGHT"))
AAState._dv.Sort = "RUN_WEIGHT DESC";
AAState.WriteLine(" Querying table for Last Value for layer: " + inObject.Class.AliasName);
AAState.WriteLine(" Query Used: (TABLENAME = '*' OR TABLENAME = '" + tableName + "' OR TABLENAME like '" + tableName + "|*' OR TABLENAME like '" + tableName + "|%') AND VALUEMETHOD = 'Last_Value'");
AAState._dv.RowFilter = "(TABLENAME = '*' OR TABLENAME = '" + tableName + "' OR TABLENAME like '" + tableName + "|*' OR TABLENAME like '" + tableName + "|%') AND VALUEMETHOD = 'Last_Value'";
AAState.WriteLine(" Number of results: " + AAState._dv.Count.ToString());
if (AAState._dv.Count > 0)
{
IRowChanges pRowChLast = inObject as IRowChanges;
for (int retRows = 0; retRows < AAState._dv.Count; retRows++)
{
DataRowView drv = AAState._dv[retRows];
AAState.WriteLine(" Looking for " + drv["FIELDNAME"].ToString());
int fldLoc = inObject.Fields.FindField(drv["FIELDNAME"].ToString());
if (fldLoc > 0)
{
AAState.WriteLine(" " + drv["FIELDNAME"].ToString() + " field found at position: " + fldLoc);
if (pRowChLast.get_ValueChanged(fldLoc))
{
AAState.WriteLine(" " + drv["FIELDNAME"].ToString() + " Has Changed");
try
{
if (inObject.get_Value(fldLoc) != null)
{
if (inObject.get_Value(fldLoc) != DBNull.Value)
{
if (AAState.lastValueProperties.GetProperty(drv["FIELDNAME"].ToString()) != null)
{
AAState.WriteLine(" Setting Last Value");
AAState.WriteLine(" " + drv["FIELDNAME"].ToString() + ": " + inObject.get_Value(fldLoc).ToString());
AAState.lastValueProperties.SetProperty(drv["FIELDNAME"].ToString(), inObject.get_Value(fldLoc));
}
else
{
AAState.WriteLine(" Setting Last Value");
AAState.WriteLine(" " + drv["FIELDNAME"].ToString() + ": " + inObject.get_Value(fldLoc));
AAState.lastValueProperties.SetProperty(drv["FIELDNAME"].ToString(), inObject.get_Value(fldLoc));
}
}
else
{
if (mode == "ON_CREATE")
{
AAState.WriteLine(" Skipping null on create");
}
else
示例13: UpdateHistoryOnPoints
private void UpdateHistoryOnPoints(IRow pLine, int PointOID, Dictionary<int, string> PointToHistory_DICT,
int m_iLineSysEndDate, int m_iLineLegalEndDate, int m_iLineHistorical)
{
string sThisPointHistory = "";
if (!PointToHistory_DICT.TryGetValue(PointOID, out sThisPointHistory))
return;
string[] sPointHistoryItems = sThisPointHistory.Split(',');
//Compare SystemEndDates
object obj2 = pLine.get_Value(m_iLineSysEndDate);
if (obj2 == DBNull.Value && sPointHistoryItems[1].Trim() != "")
{// the null on the line trumps the existing date value
PointToHistory_DICT[PointOID] =
sPointHistoryItems[0] + ",," + sPointHistoryItems[2] + "," +
sPointHistoryItems[3] + "," + sPointHistoryItems[4];
}
//Compare LegalEndDates
obj2 = pLine.get_Value(m_iLineLegalEndDate);
if (obj2 == DBNull.Value && sPointHistoryItems[3].Trim() != "")
{// the null on the line trumps the existing date value
PointToHistory_DICT[PointOID] =
sPointHistoryItems[0] + "," + sPointHistoryItems[1] + "," +
sPointHistoryItems[2] + ",," + sPointHistoryItems[4];
}
//Compare Historical
obj2 = pLine.get_Value(m_iLineHistorical);
string sTrueFalse = "";
if (obj2 != DBNull.Value)
{
sTrueFalse = obj2.ToString();
////if (sTrueFalse.Trim() == "0")
//// sTrueFalse = "false";
}
else
sTrueFalse = "false";
if ((sTrueFalse.ToLower() == "false") && (sPointHistoryItems[4].Trim() != "" ||
sPointHistoryItems[4].Trim().ToLower() != "false"))
{// the null on the line trumps the existing date value
PointToHistory_DICT[PointOID] =
sPointHistoryItems[0] + "," + sPointHistoryItems[1] + "," +
sPointHistoryItems[2] + "," + sPointHistoryItems[3] + "," + "false";
}
}
示例14: SetDynamicValues
//.........这里部分代码省略.........
proc = false;
}
else
{
proc = true;
}
}
if (proc)
{
AAState.WriteLine(" Value Entry Rows found: " + AAState._dv.Count);
AAState.WriteLine(" ----------------------------------------------");
// Get requested method and any data parameters
AAState.WriteLine(" Looping through Value Methods");
AAState.WriteLine(" ------------------------");
foreach (DataRowView drv in AAState._dv)
{
AAState.WriteLine(" Checking for Subtype Restriction");
valFC = drv["TABLENAME"].ToString().Trim();
if (valFC.Contains("|"))
{
AAState.WriteLine(" Subtype restriction Found");
string[] spliVal = valFC.Split('|');
if (Globals.IsInteger(spliVal[1]))
{
int SubVal = Convert.ToInt32(spliVal[1]);
ISubtypes pSub = inObject.Class as ISubtypes;
if (pSub != null)
{
if (pSub.HasSubtype)
{
int obSubVal = (int)inObject.get_Value(pSub.SubtypeFieldIndex);
if (obSubVal == SubVal)
{
AAState.WriteLine(" Subtypes match");
}
else
{
AAState.WriteLine(" Skipping, not the subtype defined");
continue;
}
}
else
{
AAState.WriteLine(" ERROR: Layer does not have subtypes");
}
}
else
{
AAState.WriteLine(" ERROR: Layer does not have subtypes");
}
}
else
{
AAState.WriteLine(" ERROR: Subtype not an integar");
}
}
valMethod = drv["VALUEMETHOD"].ToString().ToUpper().Trim();
valData = drv["VALUEINFO"].ToString().Trim();
AAState.WriteLine(" VALUEMETHOD: " + valMethod);
AAState.WriteLine(" VALUEINFO: " + valData);
AAState.WriteLine(" ------------------------");
//set field value based on specified method
示例15: SetDefaultValues
/// <summary>
/// Sets the defaults field values for all the fields in the given row.
/// </summary>
/// <param name="row">The row for which to set default field values.</param>
/// <param name="doEmptyValuesOnly">Boolean determining whether to process fields with empty values only.</param>
public static void SetDefaultValues(IRow row, bool doEmptyValuesOnly)
{
if (row != null)
{
if (HasSubtype(row.Table))
{
IRowSubtypes rowSubtype = row as IRowSubtypes;
if (rowSubtype != null)
{
int defaultCode = ((ISubtypes)row.Table).DefaultSubtypeCode;
int currentCode = ToInteger(GetSubTypeValue(row), -1);
if (currentCode >= 0)
rowSubtype.SubtypeCode = currentCode;
else
rowSubtype.SubtypeCode = defaultCode;
rowSubtype.InitDefaultValues();
}
}
else
{
object o;
string s;
for (int i = 0; i < row.Fields.FieldCount; i++)
{
o = row.get_Value(i);
s = ToText(o);
if (doEmptyValuesOnly)
{
if (string.IsNullOrEmpty(s))
{
if (o == DBNull.Value && row.Fields.get_Field(i).IsNullable || o != DBNull.Value)
row.set_Value(i, row.Fields.get_Field(i).DefaultValue);
}
}
else
{
object defaultValue = row.Fields.get_Field(i).DefaultValue;
if (defaultValue != string.Empty && defaultValue != null && defaultValue != DBNull.Value)
row.set_Value(i, row.Fields.get_Field(i).DefaultValue);
}
}
}
}
}