コード例 #1
0
        }         // end of method

        /// <summary>
        /// DeleteStudent
        /// Finds a Student by the Person ID and deletes the object
        /// </summary>
        /// <param name="id">(string) identifier of the Person</param>
        public void DeleteStudent(string id)
        {
            PersonList data = DataStore.LoadData();

            data.RemoveAll(person => person is Student && (person as Student).ID == id);
            DataStore.SaveData();
        }         // end of method
コード例 #2
0
        }     // end of method

        /// <summary>
        /// DeleteTeacher
        /// Deletes a Teacher object by its Teacher ID
        /// </summary>
        /// <param name="id">(int) identifier of the Teacher</param>
        public void DeleteTeacher(int id)
        {
            PersonList data = DataStore.LoadData();

            data.RemoveAll(person => person is Teacher && (person as Teacher).ID == id);
            DataStore.SaveData();
        } // end of method