Private Sub cboTechnologySet_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboTechnologySet.SelectedIndexChanged
Try
RemoveHandler lvSubprograms.ItemCheck, AddressOf lvSubprograms_ItemChecked
If cboTechnologySet.SelectedIndex > -1 Then
Dim strSP As String = cboTechnologySet.SelectedItem.ToString
TechnologyList = TechnologySetDB.GetProgramSubprogramList(strSP)
lvSubprograms.Items.Clear()
For j As Integer = 0 To TechnologyList.Count - 1
Dim t As New TechnologySet
t = TechnologyList(j)
lvSubprograms.Items.Add(t.TechnologySetCode)
lvSubprograms.Items(lvSubprograms.Items.Count - 1).SubItems.Add(t.SubTechnologyCode)
lvSubprograms.Items(lvSubprograms.Items.Count - 1).Checked = False
Next
Else
MessageBox.Show("A selection must be made")
End If
Catch ex As Exception
MessageBox.Show(ex.Message, ex.GetType.ToString)
Finally
AddHandler lvSubprograms.ItemCheck, AddressOf lvSubprograms_ItemChecked
End Try
End Sub
Private Sub lvSubprograms_ItemChecked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ItemCheckedEventArgs) Handles lvSubprograms.ItemChecked
Dim mymetriclist As New List(Of Metrics)
Try
lvMetrics.Items.Clear()
For Each checkedItem As ListViewItem In lvSubprograms.CheckedItems
Dim m As New Metrics
If cboInputCode.Text = "NEMS" Then
m.Technology = "NM"
Else
m.Technology = checkedItem.SubItems(1).Text.ToString
End If
mymetriclist.Add(m)
Next
Dim myDataTable As New DataTable
myDataTable = MetricsDB.GetMetricList(mymetriclist)
'PopulateMetricsListView(myDataTable)
Dim ds As New DataSet
Dim dsHelper = New DataSetHelper(ds)
ds.Tables.Add(myDataTable)
Dim dtnew As New DataTable
dtnew = dsHelper.SelectDistinct("DistinctMetrics", ds.Tables(0), "MetricName")
'PopulateMetricsListView(dtnew)
Catch ex As Exception
MessageBox.Show(ex.Message, ex.GetType.ToString)
End Try
End Sub
|