This question is locked. New answers and comments are not allowed.
Hi,
Platform configuration is a database class that has relationship with SensorRadar class.Combobox is loaded from SensorRadar Table.
I want to add new Sensor Radar to Platform Configuration if it doesn't.And change Sensor Radar with selected combobox Sensor Radar if it has .But Platform configuration object_id column doesn't change.It refers to SensorRadar class Id.Please help.How can update.
bool isPlatformHasRadarSensor = false;
foreach (PlatformConfiguration platformConfiguration in m_originalMunitionList)
{
if (platformConfiguration.ConfigurationItemType == Constants.CONFIGURATION_ITEM_TYPE_SENSOR_RADAR)
{
platformConfiguration.SensorRadar = ((SensorRadar)m_cmbbx_loadAirRadar.SelectedItem);
isPlatformHasRadarSensor = true;
}
}
if (!isPlatformHasRadarSensor)
{
IQuery query = m_scope.GetSqlQuery("sp_ins_Pltfrm_Conf ?,?,?,?",
null,
"GUID object_ID, GUID platform_ID, INTEGER configuration_item_type, INTEGER quantity");
IQueryResult a = query.Execute(new object[] { ((SensorRadar)m_cmbbx_loadAirRadar.SelectedItem).Id, selectedAirPlatform.Id, Constants.CONFIGURATION_ITEM_TYPE_SENSOR_RADAR, null });
int count = a.Count;
}
Platform configuration is a database class that has relationship with SensorRadar class.Combobox is loaded from SensorRadar Table.
I want to add new Sensor Radar to Platform Configuration if it doesn't.And change Sensor Radar with selected combobox Sensor Radar if it has .But Platform configuration object_id column doesn't change.It refers to SensorRadar class Id.Please help.How can update.
bool isPlatformHasRadarSensor = false;
foreach (PlatformConfiguration platformConfiguration in m_originalMunitionList)
{
if (platformConfiguration.ConfigurationItemType == Constants.CONFIGURATION_ITEM_TYPE_SENSOR_RADAR)
{
platformConfiguration.SensorRadar = ((SensorRadar)m_cmbbx_loadAirRadar.SelectedItem);
isPlatformHasRadarSensor = true;
}
}
if (!isPlatformHasRadarSensor)
{
IQuery query = m_scope.GetSqlQuery("sp_ins_Pltfrm_Conf ?,?,?,?",
null,
"GUID object_ID, GUID platform_ID, INTEGER configuration_item_type, INTEGER quantity");
IQueryResult a = query.Execute(new object[] { ((SensorRadar)m_cmbbx_loadAirRadar.SelectedItem).Id, selectedAirPlatform.Id, Constants.CONFIGURATION_ITEM_TYPE_SENSOR_RADAR, null });
int count = a.Count;
}