protected void btnAddTeachers_Click(object sender, EventArgs e) { DepartmentAdminDAL dal = new DepartmentAdminDAL(); var crnRow = this.dvwTeacherCourse.Rows[1]; var crnCell = crnRow.Cells[1]; var crn = int.Parse(crnCell.Text); string teacherID = this.ddlTeachers.SelectedValue; TeacherDAL tdal = new TeacherDAL(); Models.Teacher teacher = tdal.GetTeacherByTeacherID(teacherID); dal.AssignTeacherToCourse(teacher, crn); }
protected void gvwDepartmentCourses_RowUpdating(object sender, GridViewUpdateEventArgs e) { var rowIndex = e.RowIndex; var updateRow = this.gvwDepartmentCourses.Rows[rowIndex]; var crn = int.Parse(((Label)updateRow.FindControl("crn")).Text); var name = ((TextBox)updateRow.FindControl("name")).Text; var description = ((TextBox)updateRow.FindControl("description")).Text; var location = ((TextBox)updateRow.FindControl("location")).Text; var credit = int.Parse(((TextBox)updateRow.FindControl("creditHours")).Text); var section = ((TextBox)updateRow.FindControl("section")).Text; var department = ((TextBox)updateRow.FindControl("department")).Text; var seats = int.Parse(((TextBox)updateRow.FindControl("seats")).Text); var semesterID = ((Label)updateRow.FindControl("semesterID")).Text; //TODO add course_time_id with a ddl //TODO make semesterID a ddl //TODO make crn a label //TODO make department a label //Course updateCourse = new Course(crn,department,name,description,section,credit,seats,location,semesterID); DepartmentAdminDAL dal = new DepartmentAdminDAL(); //dal.UpdateCourse(updateCourse); }