private void AddStudent_Click(object sender, EventArgs e) { AddOrUpdaetStudent student = new AddOrUpdaetStudent(); student.ShowDialog(); Refresh(); }
private void btnUpdate_Click(object sender, EventArgs e) { int id = int.Parse(dgStudent.SelectedCells[0].FormattedValue.ToString()); var studentModel = GloblMain.dbo.StudentDMs.Find(id); AddOrUpdaetStudent student = new AddOrUpdaetStudent(studentModel); student.ShowDialog(); Refresh(); }