Ejemplo n.º 1
0
        public void UpdateStudent(StudentVO studentVO)
        {
            var temp = GetStudent(studentVO.GetRollNo());

            if (temp != null)
            {
                temp.SetName(studentVO.GetName());
            }
        }
Ejemplo n.º 2
0
    public void Main()
    {
        StudentBO studentBusinessObject = new StudentBO();

        //输出所有的学生
        for (int i = 0; i < studentBusinessObject.GetAllStudent().Count; i++)
        {
            Console.WriteLine("Name:" + studentBusinessObject.GetAllStudent()[i].GetName()
                              + "RollNo:" + studentBusinessObject.GetAllStudent()[i].GetRollNo());
        }
        //更新学生
        StudentVO student = studentBusinessObject.GetAllStudent()[0];

        student.SetName("Michael");
        studentBusinessObject.UpdateStudent(student);

        //获取学生
        student = studentBusinessObject.GetStudent(0);
        Console.WriteLine("Name:" + student.GetName()
                          + "RollNo:" + student.GetRollNo());
    }
Ejemplo n.º 3
0
 public void DeleteStudent(StudentVO student)
 {
     _students.Remove(student);
     Console.WriteLine(student.GetName() + "--" + student.GetRollNo());
 }