//修改学院按钮 private void btnSpecialityUpdate_Click(object sender, EventArgs e) { if (this.dgvCollage.RowCount == 0 || this.dgvCollage.CurrentRow == null) { MessageBox.Show("没有要修改的信息!", "修改提示"); return; } //获取要修改学生的学号 string CollageName = this.dgvCollage.CurrentRow.Cells["CollageName"].Value.ToString(); Collage objCollage = objCollageService.GetCollageByCollageName(CollageName); //显示修改窗体 FrmCollageUpdate objUpdateForm = new FrmCollageUpdate(objCollage); DialogResult result = objUpdateForm.ShowDialog(); //判断是否修改成功 if (result == DialogResult.OK) { list = objCollageService.GetCollageBagByCollageName(); this.dgvCollage.AutoGenerateColumns = false; this.dgvCollage.DataSource = list; } }
//删除学院 private void ToolStripMenuItemCollageUpdate_Click(object sender, EventArgs e) { FrmCollageUpdate add = new FrmCollageUpdate(); add.Show(dockPanel1); }