public Notification(NotificationEntity e)
 {
     _Entity = e;
     _CreationTime = e.CreationTime;
     _Uuid = e.Uuid;
     _State = e.State;
     _Notes = e.Notes;
 }
        public NotificationEntity CreateResultNotification(string userName, string transportName, Guid resultGuid, string notes, string state)
        {
            NotificationEntity entity = new NotificationEntity();

            entity.Uuid = Guid.NewGuid();
            entity.UserTransport = GetUserTransport(userName, transportName);
            entity.CreationTime = DateTime.Now;
            entity.Notes = notes;
            entity.Result = GetResultEntity(resultGuid);
            entity.State = state;

            _ObjectContext.SaveChanges();
            return entity;
        }
        public Notification CreateResultNotification(Notification notification, string selectedTransport)
        {
            _Trace.TraceEvent(TraceEventType.Verbose, -1, "CreateResultNotification");

            CriticalResultsEntityManager crm = new CriticalResultsEntityManager();
            NotificationEntity e = new NotificationEntity();
            e.Notes = notification.Notes;
            e.CreationTime = DateTime.Now;
            e.State = notification.State;
            e.Result = crm.GetResultEntity(notification.Result.Uuid);
            e.UserTransport = crm.GetUserTransport(notification.Result.Receiver.UserName, selectedTransport);
            NotificationEntity ne = crm.CreateResultNotification(e);
            return new Notification(ne);
        }
        /// <summary>
        /// Modified: 
        ///		2009-07-27, Jeremy Richardson
        ///			-Added check to assign a uuid when the uuid is null.
        /// </summary>
        /// <param name="notificationEntity"></param>
        /// <returns></returns>
        public NotificationEntity CreateResultNotification(NotificationEntity notificationEntity)
        {
            if (notificationEntity.Uuid == Guid.Empty)
            {
                notificationEntity.Uuid = Guid.NewGuid();
            }
            _ObjectContext.AddToNotificationEntitySet(notificationEntity);
            _ObjectContext.SaveChanges();

            return notificationEntity;
        }