예제 #1
0
파일: Form1.cs 프로젝트: The-Luxs/DVA313-02
        private void button3_Click(object sender, EventArgs e) // Save test cases button click
        {
            if (dataGridView2.Rows.Count == 0)                 // error handling
            {
                return;
            }

            CSV csv = new CSV();

            //string name = listBox1.SelectedItem.ToString();

            if (TB_name.Text.Length > 0 && XMLChoice.Checked == false)
            {
                filename = TB_name.Text;
                csv.SaveTests(filename, getTestCasesFromGUI(), varList);
            }
            else if (TB_name.Text.Length <= 0 && XMLChoice.Checked == false)
            {
                MessageBox.Show("Please Enter filename");
            }
            else if (TB_name.Text.Length <= 0 && treeView1.SelectedNode.Text == null && XMLChoice.Checked == false)
            {
                MessageBox.Show("Please Enter filename");
            }
            else if (XMLChoice.Checked && TB_name.Text.Length > 0)
            {
                filename = TB_name.Text;
                csv.SaveTests(filename, getTestCasesFromGUI(), varList);
            }
            else if (XMLChoice.Checked && TB_name.Text.Length <= 0)
            {
                MessageBox.Show("Please Enter filename");
            }
            else
            {
                MessageBox.Show("Please Enter filename");
            }

            //csv.SaveTests(filename, getTestCasesFromGUI(), varList);
        }
예제 #2
0
        // Save test cases button click
        private void button3_Click(object sender, EventArgs e)
        {
            if (dataGridView2.Rows.Count == 0) // error handling
                return;

            CSV csv = new CSV();
            //string name = listBox1.SelectedItem.ToString();

            if (TB_name.Text.Length > 0 && XMLChoice.Checked == false)
            {
                filename = TB_name.Text;
                csv.SaveTests(filename, getTestCasesFromGUI(), varList);
            }
            else if (TB_name.Text.Length <= 0 && XMLChoice.Checked == false)
            {
                MessageBox.Show("Please Enter filename");
            }
            else if (TB_name.Text.Length <= 0 && treeView1.SelectedNode.Text == null && XMLChoice.Checked == false)
            {
                MessageBox.Show("Please Enter filename");
            }
            else if (XMLChoice.Checked && TB_name.Text.Length > 0)
            {
                filename = TB_name.Text;
                csv.SaveTests(filename, getTestCasesFromGUI(), varList);
            }
            else if (XMLChoice.Checked && TB_name.Text.Length <= 0)
            {
                MessageBox.Show("Please Enter filename");
            }
            else
                MessageBox.Show("Please Enter filename");

            //csv.SaveTests(filename, getTestCasesFromGUI(), varList);
        }