public CourseEdit(ref List <Course> courses, Course editCourse) : base(ref courses) { InitializeComponent(); //set values this.courses = courses; this.editCourse = editCourse; //pre stuff //change title this.Text = "Edit Course"; //change "add" button to "edit" this.addCourseButton.Text = "Edit Course"; //create course terms string String terms = ""; foreach (TermEnums term in editCourse.validTerms) { terms += term.ToString() + ", "; } terms = terms.Trim(',', ' '); //create course dependencies string String dependencies = ""; foreach (Course dependency in editCourse.dependencies) { dependencies += dependency.courseReference + ", "; } dependencies = dependencies.Trim(',', ' '); //create course copendencies string String copendencies = ""; foreach (Course copencnecy in editCourse.copendencies) { copendencies += copencnecy.courseReference + ", "; } copendencies = copendencies.Trim(' ', ','); //set all text boxes to editCourse values courseNameTB.Text = editCourse.courseName; coursePrefixTB.Text = editCourse.coursePrefix; courseIDTB.Text = editCourse.courseID.ToString(); courseCreditsTB.Text = editCourse.credits.ToString(); courseDescriptionTB.Text = editCourse.courseDescription; validSemestersTB.Text = terms; courseDependenciesTB.Text = dependencies; courseCopendenciesTB.Text = copendencies; //set all course details text boxes to editCourse values detailsEditForm = new CourseAddDetails(); detailsEditForm.courseDetails = editCourse.courseDetails; }
private void CourseAdd_Load(object sender, EventArgs e) { //initiate CourseDetailsForm detailsForm = new CourseAddDetails(); }