public int CreateNotification(NotificationModel nm)
        {
            int result = DaoUtilities.NO_CHANGES;

            NOTIFICATION n = db.NOTIFICATION.Create();

            n.NOTIF_ID = nm.NotificationId;
            n.NOTIF_NAME = nm.Title;
            n.NOTIF_MESSAGE = nm.Message;
            n.NOTIF_DATE = nm.NotifDate;
            n.NOTIF_USERID = nm.UserId;

            db.NOTIFICATION.Add(n);
            try
            {
                int saveResult = db.SaveChanges();

                if (saveResult == 1)
                    result = DaoUtilities.SAVE_SUCCESSFUL;
            }
            catch (DbUpdateConcurrencyException e)
            {
                Console.WriteLine(e.GetBaseException().ToString());
                result = DaoUtilities.UPDATE_CONCURRENCY_EXCEPTION;
            }
            catch (DbUpdateException e)
            {
                Console.WriteLine(e.GetBaseException().ToString());
                result = DaoUtilities.UPDATE_EXCEPTION;
            }
            catch (DbEntityValidationException e)
            {
                Console.WriteLine(e.GetBaseException().ToString());
                result = DaoUtilities.ENTITY_VALIDATION_EXCEPTION;
            }
            catch (NotSupportedException e)
            {
                Console.WriteLine(e.GetBaseException().ToString());
                result = DaoUtilities.UNSUPPORTED_EXCEPTION;
            }
            catch (ObjectDisposedException e)
            {
                Console.WriteLine(e.GetBaseException().ToString());
                result = DaoUtilities.DISPOSED_EXCEPTION;
            }
            catch (InvalidOperationException e)
            {
                Console.WriteLine(e.GetBaseException().ToString());
                result = DaoUtilities.INVALID_OPERATION_EXCEPTION;
            }
            return result;
        }
        public int DeleteNotification(NotificationModel nm)
        {
            int result = DaoUtilities.NO_CHANGES;

            NOTIFICATION n = db.NOTIFICATION.Find(nm.NotificationId);

            if (n != null)
            {
                db.NOTIFICATION.Remove(n);
                try
                {
                    int saveResult = db.SaveChanges();

                    if (saveResult == 1)
                        result = DaoUtilities.SAVE_SUCCESSFUL;
                }
                catch (DbUpdateConcurrencyException e)
                {
                    Console.WriteLine(e.GetBaseException().ToString());
                    result = DaoUtilities.UPDATE_CONCURRENCY_EXCEPTION;
                }
                catch (DbUpdateException e)
                {
                    Console.WriteLine(e.GetBaseException().ToString());
                    result = DaoUtilities.UPDATE_EXCEPTION;
                }
                catch (DbEntityValidationException e)
                {
                    Console.WriteLine(e.GetBaseException().ToString());
                    result = DaoUtilities.ENTITY_VALIDATION_EXCEPTION;
                }
                catch (NotSupportedException e)
                {
                    Console.WriteLine(e.GetBaseException().ToString());
                    result = DaoUtilities.UNSUPPORTED_EXCEPTION;
                }
                catch (ObjectDisposedException e)
                {
                    Console.WriteLine(e.GetBaseException().ToString());
                    result = DaoUtilities.DISPOSED_EXCEPTION;
                }
                catch (InvalidOperationException e)
                {
                    Console.WriteLine(e.GetBaseException().ToString());
                    result = DaoUtilities.INVALID_OPERATION_EXCEPTION;
                }
            }
            return result;
        }
        /// <summary>
        /// Convert a notification from the database to a NotificatiobModel
        /// </summary>
        /// <param name="n"></param>
        /// <returns></returns>
        public NotificationModel ConvertNotificationToNotificatiobModel(NOTIFICATION n)
        {
            NotificationModel nm = new NotificationModel();

            if (n != null)
            {
                nm.NotificationId = n.NOTIF_ID;
                nm.Title = n.NOTIF_NAME;
                nm.Message = n.NOTIF_MESSAGE;
                nm.NotifDate = n.NOTIF_DATE;
                nm.UserId = n.NOTIF_USERID;
            }
            else
                nm = null;

            return nm;
        }