internal int UpdateFeatures(MgResourceIdentifier fsId, string className, MgPropertyCollection props, string filter) { try { MgFeatureCommandCollection cmds = new MgFeatureCommandCollection(); MgUpdateFeatures update = new MgUpdateFeatures(className, props, filter); cmds.Add(update); MgFeatureService fs = (MgFeatureService)this.Connection.CreateService(MgServiceType.FeatureService); MgPropertyCollection result = fs.UpdateFeatures(fsId, cmds, false); var ip = result.GetItem(0) as MgInt32Property; if (ip != null) return ip.GetValue(); return -1; } catch (MgException ex) { var exMgd = new FeatureServiceException(ex.Message); exMgd.MgErrorDetails = ex.GetDetails(); exMgd.MgStackTrace = ex.GetStackTrace(); ex.Dispose(); throw exMgd; } }
internal void InsertFeatures(MgResourceIdentifier fsId, string className, MgPropertyCollection props) { try { MgFeatureCommandCollection cmds = new MgFeatureCommandCollection(); MgInsertFeatures insert = new MgInsertFeatures(className, props); cmds.Add(insert); MgFeatureService fs = (MgFeatureService)this.Connection.CreateService(MgServiceType.FeatureService); MgPropertyCollection result = fs.UpdateFeatures(fsId, cmds, false); ((MgFeatureProperty)result.GetItem(0)).GetValue().Close(); } catch (MgException ex) { var exMgd = new FeatureServiceException(ex.Message); exMgd.MgErrorDetails = ex.GetDetails(); exMgd.MgStackTrace = ex.GetStackTrace(); ex.Dispose(); throw exMgd; } }
internal void CreateDataStore(MgResourceIdentifier fsId, MgFeatureSourceParams fp) { try { MgFeatureService fs = (MgFeatureService)this.Connection.CreateService(MgServiceType.FeatureService); fs.CreateFeatureSource(fsId, fp); } catch (MgException ex) { var exMgd = new FeatureServiceException(ex.Message); exMgd.MgErrorDetails = ex.GetDetails(); exMgd.MgStackTrace = ex.GetStackTrace(); ex.Dispose(); throw exMgd; } }
internal void ApplySchema(MgResourceIdentifier fsId, MgFeatureSchema schemaToApply) { try { MgFeatureService fs = (MgFeatureService)this.Connection.CreateService(MgServiceType.FeatureService); fs.ApplySchema(fsId, schemaToApply); } catch (MgException ex) { var exMgd = new FeatureServiceException(ex.Message); exMgd.MgErrorDetails = ex.GetDetails(); exMgd.MgStackTrace = ex.GetStackTrace(); ex.Dispose(); throw exMgd; } }
internal int UpdateFeatures(MgResourceIdentifier fsId, string className, MgPropertyCollection props, string filter) { try { MgdFeatureService fs = GetFeatureService(); return fs.UpdateFeatures(fsId, className, props, filter); } catch (MgException ex) { var exMgd = new FeatureServiceException(ex.Message); exMgd.MgErrorDetails = ex.GetDetails(); exMgd.MgStackTrace = ex.GetStackTrace(); ex.Dispose(); throw exMgd; } }
internal void InsertFeatures(MgResourceIdentifier fsId, string className, MgPropertyCollection props) { try { MgdFeatureService fs = GetFeatureService(); MgFeatureReader fr = null; try { fr = fs.InsertFeatures(fsId, className, props); } finally { if (fr != null) fr.Close(); } } catch (MgException ex) { var exMgd = new FeatureServiceException(ex.Message); exMgd.MgErrorDetails = ex.GetDetails(); exMgd.MgStackTrace = ex.GetStackTrace(); ex.Dispose(); throw exMgd; } }