private void button1_Click(object sender, EventArgs e) { Student newStu = new Student(); newStu.ID = int.Parse(textID.Text); newStu.Name = textName.Text; newStu.Age = int.Parse(textAge.Text); if (stu.AddStudent(newStu)) { MessageBox.Show("added successful"); dataGridView1.DataSource = stu.GetStudents(); } else { MessageBox.Show("added failed!"); } }
private void btnAdd_Click(object sender, EventArgs e) { Student newStu = new Student(); newStu.ID = int.Parse(txtID.Text); newStu.Name = txtName.Text; newStu.Age = int.Parse(txtAge.Text); if (stu.AddStudent(newStu)) { MessageBox.Show("添加成功"); dataGridView1.DataSource = stu.GetStudentList(); } else { MessageBox.Show("添加失败"); } }
private void btnAdd_Click(object sender, EventArgs e) { Student newStu = new Student(); newStu.ID = int.Parse(txtID.Text); newStu.Name = txtName.Text; newStu.Destination = txtDestination.Text; newStu.Departure_date = txtDeparure_date.Text; newStu.Return_date = txtReturn_date.Text; if (stu.AddStudent(newStu)) { MessageBox.Show("添加成功"); dataGridView1.DataSource = stu.GetStudentList(); } else { MessageBox.Show("添加失败"); } }