/// <summary> /// 编辑学生信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tsXjStudent_Click(object sender, EventArgs e) { FrmStuNews few = new FrmStuNews(); few.MdiParent = this;//设置父窗体容器=当前窗体 few.Show(); }
/// <summary> /// 修改学生信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tsmiUpdate_Click(object sender, EventArgs e) { if (this.lvStudent.SelectedItems.Count > 0) { FrmStuNews frm = new FrmStuNews(); //将选中的学号传递到"编辑学生信息"窗体 frm.studentNo = (this.lvStudent.SelectedItems[0].Text); frm.Show(); } else { MessageBox.Show("请选择一名学生", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// 编辑学生信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tsmiBjStudent_Click(object sender, EventArgs e) { FrmStuNews frm = new FrmStuNews(); if (dgvSearch.SelectedRows.Count > 0) { string studentno = dgvSearch.SelectedRows[0].Cells[0].Value.ToString(); frm.studentNo = studentno; //执行修改 frm.UpdateStudent(); frm.ShowDialog(); SearchButton();//刷新 } }