private void routineAddButton_Click(object sender, EventArgs e) { routineOb = new AddRoutineClass(); routineOb.DeptName = deptNameComboBox.Text; routineOb.TeacherOneName = teacherOneComboBox.Text; routineOb.TeacherTwoName = teacherTwoComboBox.Text; routineOb.Year = yearComboBox.Text; routineOb.Semester = semesterComboBox.Text; routineOb.CourseName = courseComboBox.Text; routineOb.Day = dayComboBox.Text; routineOb.StartTime = startTimePicker.Text; routineOb.EndTime = endTimePicker.Text; if ((deptNameComboBox.Text == "") || (teacherOneComboBox.Text == "") || (yearComboBox.Text == "") || (semesterComboBox.Text == "") || (courseComboBox.Text == " ") || (dayComboBox.Text == "")) { MessageBox.Show("Please fill-up all field"); this.Update(); } else { if (gateways.InserIntoRoutineInfoTable(routineOb) == 1) { MessageBox.Show("Information Added Successfully!!!"); routineResetButton_Click(sender, e); } else { MessageBox.Show("This time slot is already booked!"); } } }