public void setEnumeratedDescribedView(bool Enumerated, BaseArtefactInfo artInfo) { try { DescribedPanel.Enabled = false; EnumeratedPanel.Enabled = false; if (Enumerated) { EnumeratedPanel.Enabled = true; ValueDomainListComboBox.SelectedIndex = ValueDomainListComboBox.FindStringExact(((ArtefactInfo.model.ValueDomainSubsetInfo)(artInfo)).vd_id_ref); VTLInt_Service.ServiceClient VTL_service = VTLInt_ServiceManager.GetClient(CommonItem.CurrentSettings.InteractionWebService); BaseComponentInfo[] values = VTL_service.GetSubSetList(((ArtefactInfo.model.ValueDomainSubsetInfo)(artInfo)).vtlId); foreach (BaseComponentInfo bs in values) { for (int i = 0; i < ValuesCheckedListBox.Items.Count; i++) { ValValueDomainObject vl = (ValValueDomainObject)ValuesCheckedListBox.Items[i]; if (vl.value_seq_id.ToString() == bs.seq_id) { ValuesCheckedListBox.SetItemCheckState(i, CheckState.Checked); } } } } else { DescribedPanel.Enabled = true; ValueDomainListComboBox.SelectedIndex = ValueDomainListComboBox.FindStringExact(((ArtefactInfo.model.ValueDomainSubsetInfo)(artInfo)).vd_id_ref + DESCRIBED_SUFFIX); DescribedCriterionTextBox.Text = ((ArtefactInfo.model.ValueDomainSubsetInfo)(artInfo)).set_criterion_id; } } catch (Exception) { throw; } }
private void ValueDomainListComboBox_SelectedIndexChanged(object sender, EventArgs e) { try { BaseComponentInfo[] values; KeyValuePair <int, string>[] value_seq_id; DescribedCriterionTextBox.Clear(); valDomParentDescrTextBox.Clear(); ValuesCheckedListBox.Items.Clear(); if (this.ValueDomainListComboBox.SelectedItem.GetType().ToString() != "System.String") { ValueDomainContainer valCont = (ValueDomainContainer)this.ValueDomainListComboBox.SelectedItem; _selectedParent = valCont.componentObject; if (valCont.isEnumerated) { DescribedPanel.Enabled = false; DescribedPanel.BackColor = Color.Gray; EnumeratedPanel.Enabled = true; EnumeratedPanel.BackColor = Color.SteelBlue; VTLInt_Service.ServiceClient VTL_service = VTLInt_ServiceManager.GetClient(CommonItem.CurrentSettings.InteractionWebService); values = VTL_service.GetValueDomainValues(valCont.vtlID); value_seq_id = VTL_service.GetValueDomain_seq_id(valCont.vtlID); if (values.Count() == 0) { MessageBox.Show("No values found!", "Values missing", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } foreach (BaseComponentInfo val in values) { ValValueDomainObject tmpVal = new ValValueDomainObject(); tmpVal.name = val.name[0].value; tmpVal.Vtl_ID = val.vtlId; var tmpVar = from seq_id in value_seq_id where seq_id.Value == val.vtlId select seq_id.Key; tmpVal.value_seq_id = (int)tmpVar.First(); ValuesCheckedListBox.Items.Add(tmpVal); } } else { DescribedPanel.Enabled = true; DescribedPanel.BackColor = Color.SteelBlue; EnumeratedPanel.Enabled = false; EnumeratedPanel.BackColor = Color.Gray; valDomParentDescrTextBox.Text = valCont.restrictionText; } } else { _selectedParent = null; } } catch (Exception) { throw; } }