private static string GetProperty(Borehole well, string propertyName) { BoreholePropertyCollection bhPropertyColl = well.BoreholeCollection.BoreholePropertyCollection; DictionaryBoreholeProperty dicProperty = FindDictionaryProperty(bhPropertyColl, propertyName); return(well.PropertyAccess.GetPropertyValue <string>(dicProperty).ToString()); }
public static DictionaryBoreholeProperty FindDictionaryProperty(BoreholePropertyCollection bhpc, string propName) { DictionaryBoreholeProperty dbhp = DictionaryBoreholeProperty.NullObject; foreach (DictionaryBoreholeProperty p in bhpc.DictionaryProperties) { if (p.Name == propName) { if (p.DataType == typeof(string)) { dbhp = p; break; } } } return(dbhp); }
public List <WellLogFile> GetWellLogFiles(BoreholeCollection wells) { var files = new List <WellLogFile>(); BoreholePropertyCollection bhPropertyColl = wells.BoreholePropertyCollection; DictionaryBoreholeProperty dicProperty = DictionaryBoreholeProperty.NullObject; dicProperty = WellsImporter.FindDictionaryProperty(bhPropertyColl, "FIELDPRO ID"); foreach (Borehole well in wells) { string id = well.PropertyAccess.GetPropertyValue <string>(dicProperty); if (!String.IsNullOrEmpty(id.Trim())) { files.AddRange(WellLogFile.Broker.GetAllOfWell(id.Trim())); } } return(files); }
private void SetProperty(string propertyName, string value, Borehole well, Boolean isPropertyGroup) { using (ITransaction tr = DataManager.NewTransaction()) { BoreholePropertyCollection bhPropertyColl = well.BoreholeCollection.BoreholePropertyCollection; DictionaryBoreholeProperty dicProperty = DictionaryBoreholeProperty.NullObject; dicProperty = FindDictionaryProperty(bhPropertyColl, propertyName); if (dicProperty == null) { // Create attribute from BoreholePropertyCollection tr.Lock(bhPropertyColl); dicProperty = bhPropertyColl.CreateDictionaryProperty(typeof(string), propertyName); dicProperty.IsGroupProperty = isPropertyGroup; } tr.Lock(well); well.PropertyAccess.SetPropertyValue(dicProperty, value); tr.Commit(); } }