private void AddTeacherCourseForm_Load(object sender, EventArgs e) { CourseSearchForm csf = new CourseSearchForm(); string courseNo = b; Course c = new Course(courseNo, ""); CourseManagerAction cma = new CourseManagerAction(); cma.setCourse(c); cma.loadOpenedCourseDetail(lv); }
private void button1_Click(object sender, EventArgs e) { string courseNo = b; CourseManagerAction cma = new CourseManagerAction(); cma.openCourse(courseNo, tb1.Text, tb2.Text, tb3.Text); Course c = new Course(courseNo, ""); cma.setCourse(c); cma.loadOpenedCourseDetail(lv); }
private void bt4_Click(object sender, EventArgs e) { Course c = new Course(tb3.Text, tb4.Text); CourseManagerAction cma = new CourseManagerAction(); cma.setCourse(c); if (cma.CourseUpdate()) { MessageBox.Show("修改成功!", "提示信息", MessageBoxButtons.OK); } else { MessageBox.Show("修改失败!", "提示信息", MessageBoxButtons.OK); } }
private void bt3_Click(object sender, EventArgs e) { if (lv.SelectedItems.Count == 0) { MessageBox.Show("请选择一条信息", "Error", MessageBoxButtons.OK); return; } else { this.ClientSize = new System.Drawing.Size(458, 464); courseNo = lv.SelectedItems[0].SubItems[0].Text; Course c = new Course(courseNo, ""); CourseManagerAction cma = new CourseManagerAction(); cma.setCourse(c); cma.loadOpenedCourse(lv1); } }
private void bt2_Click(object sender, EventArgs e) { if (lv.SelectedItems.Count == 0) { MessageBox.Show("请选择一条信息", "Error", MessageBoxButtons.OK); return; } string courseNo = lv.SelectedItems[0].Text.ToString(); Course c = new Course(courseNo, ""); CourseManagerAction cma = new CourseManagerAction(); cma.setCourse(c); if (cma.CourseDelete()) { MessageBox.Show("该学生记录已删除!", "提示信息", MessageBoxButtons.OK); } else { MessageBox.Show("删除失败!", "提示信息", MessageBoxButtons.OK); } }
private void bt_Click(object sender, EventArgs e) { if (tbcno.Text == "") { MessageBox.Show("课号不能为空!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { CourseManagerAction cma = new CourseManagerAction(); Course course = new Course(tbcno.Text, tbcna.Text); cma.setCourse(course); if (cma.CourseInsert()) { ListViewItem lvi = new ListViewItem(); lvi.SubItems[0].Text = tbcno.Text; lvi.SubItems.Add(tbcna.Text); lv.Items.Add(lvi); MessageBox.Show("添加成功!", "提示信息", MessageBoxButtons.OK); } } tbcno.Clear(); tbcna.Clear(); }