Ejemplo n.º 1
0
        public static void rosterToDatabaseTablesTest()
        {
            string excelFileName = "C:\\Users\\briggs_mc\\cs350\\CS-connect\\DatabaseConnector\\CS142roosterTest.xlsx";
            FillDatabase myFillDatabase = new FillDatabase();
            myFillDatabase.getRoster(excelFileName);
            myFillDatabase.rosterToDatabaseTables();

            OleDbConnection connection = DatabaseConnector.CommonFunctions.connectToDB();

            string commandCourse = "SELECT Course from allCourses where Course = '" + myFillDatabase.course[2] + "';";

            //returns list of courses that matches - should be either course name or nothing?
            List<string> coursesAlreadyInTable = DatabaseConnector.CommonFunctions.readData(connection, commandCourse);
            bool inTable = coursesAlreadyInTable.Any();
            //   Assert.IsTrue(inTable);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// When the professor wants to add a class roster to the database
 /// he puts the path and file name for the roster and clicks 
 /// add class this will read the excel file and put the necessary info into
 /// the database
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void profAddClassButton_Click(object sender, EventArgs e)
 {
     string excelFileName = profFilePathTextBox.Text;
     FillDatabase myFillDatabase = new FillDatabase();
     myFillDatabase.getRoster(excelFileName);
     myFillDatabase.rosterToDatabaseTables();
 }
Ejemplo n.º 3
0
 public static void getRosterTest()
 {
     string excelFileName = "C:\\Users\\briggs_mc\\cs350\\CS-connect\\DatabaseConnector\\CS142roosterTest.xlsx";
     FillDatabase myFillDatabase = new FillDatabase();
     myFillDatabase.getRoster(excelFileName);
     Assert.IsNotEmpty(myFillDatabase.course[2]);
 }