private void button1_Click(object sender, EventArgs e) { try { RepastModel.Coursedetails cd = new RepastModel.Coursedetails(); RepastBLL.wordsManager wm = new RepastBLL.wordsManager(); cd.Cd_id = int.Parse(textBox1.Text); cd.C_id = int.Parse(tB1.Text); cd.Cd_name = tB2.Text; cd.Cd_yinbiao = tB3.Text; cd.Cd_mean = tB4.Text; cd.Cd_sentence = textBox2.Text; cd.Cd_right_pic = pictureBox1.ImageLocation; cd.Cd_wrong_pic1 = pictureBox2.ImageLocation; cd.Cd_wrong_pic2 = pictureBox3.ImageLocation; cd.Cd_wrong_pic3 = pictureBox4.ImageLocation; int num = wm.InsertCouresDetails(cd); if (num > 0) { MessageBox.Show("添加单词成功!!!"); //GuanLiMain gl = new GuanLiMain(); //gl.DanCiInitialze(); this.Close(); dc d = new dc(); d.dcx(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void 点击查看单词ToolStripMenuItem_Click(object sender, EventArgs e) { dc c = new dc(); c.Show(); }