public void AddStationPoints(string SqlWhereClause) { int idFld = m_StationPointsFC.FindField("StationPoints_ID"); int fieldFld = m_StationPointsFC.FindField("FieldID"); int lblFld = m_StationPointsFC.FindField("Label"); int plotFld = m_StationPointsFC.FindField("PlotAtScale"); int locConfFld = m_StationPointsFC.FindField("LocationConfidenceMeters"); int latFld = m_StationPointsFC.FindField("Latitude"); int longFld = m_StationPointsFC.FindField("Longitude"); int dsFld = m_StationPointsFC.FindField("DataSourceID"); IQueryFilter QF = new QueryFilterClass(); QF.WhereClause = SqlWhereClause; IFeatureCursor theCursor = m_StationPointsFC.Search(QF, false); IFeature theFeature = theCursor.NextFeature(); while (theFeature != null) { StationPoint anStationPoint = new StationPoint(); anStationPoint.StationPoints_ID = theFeature.get_Value(idFld).ToString(); anStationPoint.FieldID = theFeature.get_Value(fieldFld).ToString(); anStationPoint.Label = theFeature.get_Value(lblFld).ToString(); anStationPoint.PlotAtScale = int.Parse(theFeature.get_Value(plotFld).ToString()); anStationPoint.LocationConfidenceMeters = double.Parse(theFeature.get_Value(locConfFld).ToString()); anStationPoint.Latitude = double.Parse(theFeature.get_Value(latFld).ToString()); anStationPoint.Longitude = double.Parse(theFeature.get_Value(longFld).ToString()); anStationPoint.DataSourceID = theFeature.get_Value(dsFld).ToString(); anStationPoint.Shape = (IPoint)theFeature.Shape; anStationPoint.RequiresUpdate = true; m_StationPointsDictionary.Add(anStationPoint.StationPoints_ID, anStationPoint); theFeature = theCursor.NextFeature(); } }
public string NewStationPoint(string StationID, string Type, string Label, int PlotAtScale, double LocationConfidenceMeters, double Latitude, double Longitude, string DataSourceID, IPoint Shape) { StationPoint newStationPoint = new StationPoint(); sysInfo SysInfoTable = new sysInfo(m_theWorkspace); newStationPoint.StationPoints_ID = SysInfoTable.ProjAbbr + ".StationPoints." + SysInfoTable.GetNextIdValue("StationPoints"); newStationPoint.FieldID = StationID; newStationPoint.Label = Label; newStationPoint.PlotAtScale = PlotAtScale; newStationPoint.LocationConfidenceMeters = LocationConfidenceMeters; newStationPoint.Latitude = Latitude; newStationPoint.Longitude = Longitude; newStationPoint.DataSourceID = DataSourceID; newStationPoint.Shape = Shape; newStationPoint.RequiresUpdate = false; m_StationPointsDictionary.Add(newStationPoint.StationPoints_ID, newStationPoint); return newStationPoint.StationPoints_ID; }
public void UpdateStationPoint(StationPoint theStationPoint) { try { m_StationPointsDictionary.Remove(theStationPoint.StationPoints_ID); } catch { } theStationPoint.RequiresUpdate = true; m_StationPointsDictionary.Add(theStationPoint.StationPoints_ID, theStationPoint); }