public void DeleteTeacherItem(Teacher teacherForDelete) { // Remove the to-do item from the "all" observable collection. AllTeacherItems.Remove(teacherForDelete); // Remove the to-do item from the data context. studentusDB.TeacherItems.DeleteOnSubmit(teacherForDelete); // Save changes to the database. studentusDB.SubmitChanges(); }
public void AddTeacher(Teacher newTeacherItem) { studentusDB.TeacherItems.InsertOnSubmit(newTeacherItem); AllTeacherItems.Add(newTeacherItem); studentusDB.SubmitChanges(); }