private void btnDataValidationAdd_Click(object sender, EventArgs e) { // // Bring up the modeling Training selection dialog box; only allow files // that match the training file input count. int InputDimension = Convert.ToInt32(GPDatabaseUtils.FieldValue(m_Project.DataTrainingID, "tblModelingFile", "InputCount")); fmSelectModelingFile dlg = new fmSelectModelingFile(InputDimension); if (dlg.ShowDialog(this) == DialogResult.OK) { // // Add the selection to the project if (dlg.lvFiles.SelectedItems.Count > 0) { ListViewItem lvSelected = dlg.lvFiles.Items[dlg.lvFiles.SelectedItems[0].Index]; ComboDataItem cbItem = new ComboDataItem(lvSelected.Text, Convert.ToInt32(lvSelected.Tag.ToString())); cbDataValidation.Items.Add(cbItem); // // Add it to the results page also cbResultsDataSet.Items.Add(cbItem); // // Select this item cbDataValidation.SelectedIndex = cbDataValidation.Items.Count - 1; // // Add it to the project and Save m_Project.DataValidation.Add(Convert.ToInt32(lvSelected.Tag.ToString())); m_Project.Save(); } } }
private void button3_Click(object sender, EventArgs e) { // // Bring up the modeling Training selection dialog box fmSelectModelingFile dlg = new fmSelectModelingFile(0); if (dlg.ShowDialog(this) == DialogResult.OK) { // // Add the selection to the project if (dlg.lvFiles.SelectedItems.Count > 0) { ListViewItem lvSelected = dlg.lvFiles.Items[dlg.lvFiles.SelectedItems[0].Index]; txtDataTraining.Text = lvSelected.Text; txtDataTraining.Tag = lvSelected.Tag; m_Project.DataTrainingID = Convert.ToInt32(lvSelected.Tag.ToString()); m_Project.Save(); } } }