// Remove a to-do task item from the database and collections.
        public void DeleteSemesterItem(Semestar semesterForDelete)
        {
            ObservableCollection <Subject> marks = new ObservableCollection <Subject>();

            foreach (Subject subject in AllSubjectItems)
            {
                if (semesterForDelete.OznakaSemestra == subject.OznakaSemestra)
                {
                    marks.Add(subject);
                }
            }

            foreach (Subject m in marks)
            {
                this.DeleteSubjectItem(m);
            }

            //studentusDB.SubmitChanges();

            // Remove the to-do item from the "all" observable collection.
            AllSemesterItems.Remove(semesterForDelete);

            // Remove the to-do item from the data context.
            studentusDB.Items.DeleteOnSubmit(semesterForDelete);

            // Save changes to the database.
            studentusDB.SubmitChanges();
        }
        // Add an object to the database and collections.
        public void AddSemester(Semestar newSemesterItem)
        {
            // Add a to-do item to the data context.
            studentusDB.Items.InsertOnSubmit(newSemesterItem);

            // Add a to-do item to the "all" observable collection.
            AllSemesterItems.Add(newSemesterItem);

            // Save changes to the database.
            studentusDB.SubmitChanges();
        }