Esempio n. 1
0
        public bool DeleteNotificationDependency(NotificationDependency notificationDependency)
        {
            Contract.Requires(notificationDependency != null);
            Contract.Requires(notificationDependency.Id >= 0);

            using (IUnitOfWork uow = this.GetUnitOfWork())
            {
                IRepository <NotificationDependency> repo = uow.GetRepository <NotificationDependency>();
                notificationDependency = repo.Reload(notificationDependency);
                repo.Delete(notificationDependency);
                uow.Commit();
            }

            return(true);
        }
Esempio n. 2
0
        //public IQueryable<Notification> GetEventsBySchedule(long scheduleId)
        //{
        //    return NotificationRepo.Query(a => a.Schedules.Any(u => u.Id == scheduleId));
        //}

        #endregion

        #region Notification Dependency Methods

        public NotificationDependency CreateNotificationDependency(Notification notification, long attibuteId, string domainItem)
        {
            DateTime insertDate = DateTime.Now;
            NotificationDependency newNotificationDependency = new NotificationDependency()
            {
                Notification = notification,
                AttributeId  = attibuteId,
                DomainItem   = domainItem
            };

            using (IUnitOfWork uow = this.GetUnitOfWork())
            {
                IRepository <NotificationDependency> repo = uow.GetRepository <NotificationDependency>();
                repo.Put(newNotificationDependency);
                uow.Commit();
            }

            return(newNotificationDependency);
        }
Esempio n. 3
0
 public NotificationDependencyModel(NotificationDependency notificationDependency)
 {
     Notification = notificationDependency.Notification;
     DomainItem   = notificationDependency.DomainItem;
     AttributeId  = notificationDependency.AttributeId;
 }