/// <summary> /// The the properties of an object /// </summary> /// <param name="ObjectName">The object to get the proeprties of</param> /// <returns>The properties associated to the object</returns> public static OSAEObjectPropertyCollection GetObjectProperties(string ObjectName) { OSAEObjectPropertyCollection props = new OSAEObjectPropertyCollection(); try { using (MySqlCommand command = new MySqlCommand()) { DataSet dataset = new DataSet(); command.CommandText = "SELECT object_property_id, property_name, property_value, property_datatype, last_updated FROM osae_v_object_property WHERE object_name=@ObjectName ORDER BY property_name"; command.Parameters.AddWithValue("@ObjectName", ObjectName); dataset = OSAESql.RunQuery(command); foreach (DataRow drp in dataset.Tables[0].Rows) { OSAEObjectProperty p = new OSAEObjectProperty(); p.Name = drp["property_name"].ToString(); p.Value = drp["property_value"].ToString(); p.DataType = drp["property_datatype"].ToString(); p.LastUpdated = drp["last_updated"].ToString(); p.Id = drp["object_property_id"].ToString(); props.Add(p); } } return props; } catch (Exception ex) { Logging.GetLogger().AddToLog("API - GetObjectProperty error: " + ex.Message, true); return props; } }
private OSAEObjectPropertyCollection getProperties(string objName) { OSAEObject oObj = OSAEObjectManager.GetObjectByName(objName); OSAEObjectPropertyCollection props = oObj.Properties; OSAEObjectPropertyCollection properties = new OSAEObjectPropertyCollection(); foreach (OSAEObjectProperty prop in props) { OSAEObjectProperty p = new OSAEObjectProperty(); p.Name = prop.Name; p.Value = prop.Value; p.DataType = prop.DataType; p.LastUpdated = prop.LastUpdated; p.Id = prop.Id; properties.Add(p); } return(properties); }
private OSAEObjectPropertyCollection getProperties(string objName) { OSAEObject oObj = OSAEObjectManager.GetObjectByName(objName); OSAEObjectPropertyCollection props = oObj.Properties; OSAEObjectPropertyCollection properties = new OSAEObjectPropertyCollection(); foreach (OSAEObjectProperty prop in props) { OSAEObjectProperty p = new OSAEObjectProperty(); p.Name = prop.Name; p.Value = prop.Value; p.DataType = prop.DataType; p.LastUpdated = prop.LastUpdated; p.Id = prop.Id; properties.Add(p); } return properties; }