Exemple #1
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            this.Hide();
            Searching_Filtering_Practices_Form f = new Searching_Filtering_Practices_Form();

            f.ShowDialog();
            this.Show();
        }
        public void TestFilterPractice()
        {
            Searching_Filtering_Practices_Form form = new Searching_Filtering_Practices_Form();

            SqlWorker.GetDataSet("INSERT INTO TeachingExercises(StartTime,EndTime,Class,Practitioner,type,CourseName,Day,AmountOfStudents) VALUES('" + startTime + "','" + endTime + "','" + Class + "','" + practitioner + "','" + type + "','" + CourseName + "','" + day + "','" + amoOfStud + "')");
            DataSet data = SqlWorker.GetDataSet("SELECT ID FROM TeachingExercises WHERE StartTime LIKE '" + startTime + "' AND EndTime LIKE '"
                                                + endTime + "' AND Class LIKE '" + Class + "' AND Practitioner LIKE '" + practitioner + "' AND type LIKE '" + type + "' AND CourseName LIKE '" + CourseName + "' AND Day LIKE '"
                                                + day + "' AND AmountOfStudents LIKE '" + amoOfStud + "'");

            try
            {
                Assert.IsTrue(form.searchPractice(startTime, endTime, Class, practitioner, type, data.Tables[0].Rows[0][0].ToString()).Tables[0].Rows.Count == 1);
            }
            catch
            {
                Assert.Fail();
            }

            SqlWorker.GetDataSet("DELETE FROM TeachingExercises WHERE ID LIKE '" + data.Tables[0].Rows[0][0].ToString() + "'");
        }