private void button1_Click(object sender, EventArgs e) { DBconnector dbc = new DBconnector(); int id = dbc.GetLessID(cmblect.Text, cmbGroup.Text, cmbRoom.Text, cmbMod.Text, cmbStartTime.Text, cmbDay.Text); if (id > -1) { dbc.DeleteLess(id); dgvLesson.DataSource = dbc.LessonVeiw(); } }
private void Lesson_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'timetableseDS.yeargroup' table. You can move, or remove it, as needed. this.yeargroupTableAdapter.Fill(this.timetableseDS.yeargroup); // TODO: This line of code loads data into the 'timetableseDS.room' table. You can move, or remove it, as needed. this.roomTableAdapter.Fill(this.timetableseDS.room); // TODO: This line of code loads data into the 'timetableseDS.module' table. You can move, or remove it, as needed. this.moduleTableAdapter.Fill(this.timetableseDS.module); // TODO: This line of code loads data into the 'timetableseDS.lecturer' table. You can move, or remove it, as needed. this.lecturerTableAdapter.Fill(this.timetableseDS.lecturer); DBconnector dbc = new DBconnector(); dgvLesson.DataSource = dbc.LessonVeiw(); // dt.Fill(dbc.LessonView()); }
// Checks user input for clashes with the database private void btnAdd_Click(object sender, EventArgs e) { DBconnector dbc = new DBconnector(); if (dbc.checkClash(cmblect.Text, cmbGroup.Text, cmbRoom.Text, cmbMod.Text, cmbStartTime.Text, cmbEndTime.Text, cmbDay.Text)) { MessageBox.Show("Sorry there is a clash with your selection"); return; } //TODO: Validate Data // adds the lectuer information form the text boxes to the databases and up dates it dbc.InsertLess(new LessonCL(0, cmblect.Text, cmbGroup.Text, cmbRoom.Text, cmbMod.Text, cmbStartTime.Text, cmbEndTime.Text, cmbDay.Text)); dgvLesson.DataSource = dbc.LessonVeiw(); MessageBox.Show("Lesson added information added"); }
private void Form1_Load(object sender, EventArgs e) { DBconnector dbc = new DBconnector(); // dgvT.DataSource = dbc.LessonVeiw(); dgvTimeTable.DataSource = dbc.LessonVeiw(); }