public Dictionary <string, string> getCUSTENTPropertyVal(VDF.Vault.Currency.Connections.Connection connection, string entityClassIDs, CustEnt custEnt) { try { using (WebServiceManager serviceManager = connection.WebServiceManager) //using will log out after usage { var propDefs = connection.PropertyManager.GetPropertyDefinitions(entityClassIDs, null, VDF.Vault.Currency.Properties.PropertyDefinitionFilter.IncludeAll); VDF.Vault.Currency.Entities.CustomObject custObj = new VDF.Vault.Currency.Entities.CustomObject(connection, custEnt); foreach (var key in propDefs.Keys) { object propValue = connection.PropertyManager.GetPropertyValue(custObj, propDefs[key], null); custPropDict.Add(propDefs[key].DisplayName.ToString(), propValue == null ? "" : propValue.ToString()); } } } catch (SystemException ex) { result = ex.ToString(); } return(custPropDict); }
public DataTable getCENTCollPropertyValinDataTable(VDF.Vault.Currency.Connections.Connection connection, string entityClassIDs, CustEnt[] custEntscoll, List <string> properties) { DataTable dataTable = new DataTable(); try { dataTable.Clear(); using (WebServiceManager serviceManager = connection.WebServiceManager) //using will log out after usage { var propDefs = connection.PropertyManager.GetPropertyDefinitions(entityClassIDs, null, VDF.Vault.Currency.Properties.PropertyDefinitionFilter.IncludeAll); //set datatable columns Debug.Write(properties.Count); if (properties.Count == 0 || properties == null) { allProps = true; } else { allProps = false; } dataTable = setProptoCol(propDefs, properties); foreach (CustEnt custEnt in custEntscoll) { VDF.Vault.Currency.Entities.CustomObject custObj = new VDF.Vault.Currency.Entities.CustomObject(connection, custEnt); row = dataTable.NewRow(); foreach (var key in propDefs.Keys) { if (allProps) { object propValue = connection.PropertyManager.GetPropertyValue(custObj, propDefs[key], null); //custPropDict.Add(propDefs[key].DisplayName.ToString(), propValue == null ? "" : propValue.ToString()); if (propValue != null) { Debug.Write("\n" + key + " | " + propValue.ToString() + "\n"); row[propDefs[key].DisplayName.ToString()] = propValue; } } else { if (properties.Contains(propDefs[key].DisplayName.ToString())) { object propValue = connection.PropertyManager.GetPropertyValue(custObj, propDefs[key], null); //custPropDict.Add(propDefs[key].DisplayName.ToString(), propValue == null ? "" : propValue.ToString()); if (propValue != null) { Debug.Write("\n" + key + " | " + propValue.ToString() + "\n"); row[propDefs[key].DisplayName.ToString()] = propValue; } } } } dataTable.Rows.Add(row); } } } catch (SystemException ex) { Debug.Write(ex.ToString()); } return(dataTable); }