Beispiel #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     DataClasses1DataContext db = new DataClasses1DataContext();
     //添加教师-课程关系
     #region
     teacher_course teachercourse = new teacher_course();
     teachercourse.Teacher_id = teacherbox.Text;
     teachercourse.Course_id = coursebox.Text;
     teachercourse.Class_id = classbox.Text;
     teachercourse.id = teacherbox.Text + classbox.Text + coursebox.Text;
     db.teacher_course.InsertOnSubmit(teachercourse);
     try { db.SubmitChanges(); MessageBox.Show("提交成功"); }
     catch { MessageBox.Show("提交失败"); }
     #endregion
 }
 partial void Deleteteacher_course(teacher_course instance);
 partial void Updateteacher_course(teacher_course instance);
 partial void Insertteacher_course(teacher_course instance);