private void UpdateNot(CL_Notification newNot)
        {
            CL_Notification notInDb = (from CL_Notification _not in ClarolineDB.Notifications_Table
                               where _not.Equals(newNot)
                               select _not).First();

            notInDb.notifiedDate = newNot.notifiedDate;
            NotifByCours[notInDb.Cours.sysCode][NotifByCours[notInDb.Cours.sysCode].IndexOf(notInDb)].notifiedDate = newNot.notifiedDate;
            AllNotifications[AllNotifications.IndexOf(notInDb)].notifiedDate = newNot.notifiedDate;
            notInDb.updated = newNot.updated;
            NotifByCours[notInDb.Cours.sysCode][NotifByCours[notInDb.Cours.sysCode].IndexOf(notInDb)].updated = newNot.updated;
            AllNotifications[AllNotifications.IndexOf(notInDb)].updated = newNot.updated;
            ClarolineDB.SubmitChanges();
        }
        public void DeleteNotification(CL_Notification notForDelete)
        {

            // Remove the cours item from the "all" observable collection.

            AllNotifications.Remove(notForDelete);

            NotifByCours[notForDelete.Cours.sysCode].Remove(notForDelete);

            // Remove the cours item from the data context.

            ClarolineDB.Notifications_Table.DeleteOnSubmit(notForDelete);

            // Save changes to the database.

            ClarolineDB.SubmitChanges();
        }
        public void AddNotification(CL_Notification newNot)
        {
            newNot.updated = true;
            newNot.Cours.notifiedDate = true;
            UpdateCours(newNot.Cours);

            if (AllNotifications.Contains(newNot))
            {
                CL_Notification not = (from CL_Notification not_ in AllNotifications
                                    where not_.Equals(newNot)
                                    orderby not_.date descending
                                    select not_).First();
                if (not.date.Date == newNot.date.Date)
                    return;
            }
                // Add a to-do item to the data context.

                ClarolineDB.Notifications_Table.InsertOnSubmit(newNot);

                // Save changes to the database.

                ClarolineDB.SubmitChanges();

                // Add a to-do item to the "all" observable collection.

                AllNotifications.Add(newNot);

                NotifByCours[newNot.Cours.sysCode].Add(newNot);
            /*}
            else
                UpdateNot(newNot);*/
        }