private void btnAddSpeciality_Click(object sender, EventArgs e) { frmAddSpeciality frm = new frmAddSpeciality(); frm.Text = "新增专业"; frm.Show(); }
private void btnEditSpeciality_Click(object sender, EventArgs e) { if (dgvSepciality.SelectedRows.Count > 0) //是否选中 { Model.Speciality model = (Model.Speciality)dgvSepciality.SelectedRows[0].DataBoundItem; //选中行转换为Model frmAddSpeciality frm = new frmAddSpeciality(); frm.Text = "正在修改 " + model.Name + " 专业"; frm.FormToEdit(model); //更改窗体用途 if (frm.ShowDialog() == DialogResult.OK) { LoadAllSpecialityByDelFlagAndCollegeId(); //刷新 } } }