Esempio n. 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     DataClasses1DataContext db = new DataClasses1DataContext();
     course xin = new course();
     xin.Course_id = courseID.Text;
     xin.Course_name = namebox.Text;
     xin.Course_period = Convert.ToInt32(periodbox.Text);
     xin.Course_credit = Convert.ToInt32(this.creditbox.Text);
     xin.Course_descible = describebox.Text;
     if (radioButton1.Checked)
         xin.Course_kind = radioButton1.Text;
     if (radioButton2.Checked)
         xin.Course_kind = radioButton2.Text;
     if (radioButton3.Checked)
         xin.Course_kind = radioButton3.Text;
     db.course.InsertOnSubmit(xin);
     try
     {
         db.SubmitChanges();
         MessageBox.Show("添加成功!");
     }
     catch { MessageBox.Show("添加失败!"); }
 }
Esempio n. 2
0
 partial void Deletecourse(course instance);
Esempio n. 3
0
 partial void Updatecourse(course instance);
Esempio n. 4
0
 partial void Insertcourse(course instance);