private void btnYes_Click(object sender, EventArgs e) { if (!_ViewModel.Modify(NewStudent = StuInfoControl.GetStudent())) { MessageBox.Show("修改失败!!!"); } else { this.DialogResult = DialogResult.OK; this.Close(); } }
private void btnYes_Click(object sender, EventArgs e) { StudentMsg student = StuInfoControl.GetStudent(); if (student == null) { //MessageBox.Show("添加失败!!!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { _ViewModel.AddStudent(student); } }
public ModifyWindow(StudentMsg student) : this() { StuInfoControl.SetStudent(student); }