示例#1
0
 void When(NotificationCreated e)
 {
     NotificationId   = e.NotificationId;
     NotificationType = e.NotificationType;
     Subject          = e.Subject;
     Content          = e.Content;
     ReferenceId      = e.ReferenceId;
     DateSent         = e.DateSent;
     DateCreated      = DateTime.UtcNow;
 }
        public void Handle(DepositPaid depositPaid)
        {
            var tenantNotificationCreated =
                new NotificationCreated(depositPaid.TenantId, depositPaid.PaymentId, depositPaid.AgreementId);

            _eventRegistry.Publish(tenantNotificationCreated);

            var ownerNotificationCreated =
                new NotificationCreated(depositPaid.OwnerId, depositPaid.PaymentId, depositPaid.AgreementId);

            _eventRegistry.Publish(ownerNotificationCreated);
        }
示例#3
0
        void HandleEvent(NotificationCreated evt)
        {
            const string sql = @"
insert into core_Notification(NotificationId, NotificationType, Subject, Content, Referenceid, DateSent, DateCreated, DateUpdated, DateEnabled, DateDeleted)
    values  (@Id, @NotificationType, @Subject, @Content, @Referenceid, @DateSent, @DateCreated, @DateUpdated, @DateEnabled, @DateDeleted)
;
";

            DbConnection.Execute(sql, new
            {
                evt.NotificationId.Id,
                evt.NotificationType,
                evt.Subject,
                evt.Content,
                evt.ReferenceId,
                evt.DateSent,

                DateCreated = DateTime.UtcNow,
                DateUpdated = DateTime.UtcNow,
                DateEnabled = DateTime.MaxValue,
                DateDeleted = DateTime.MaxValue
            }, DbTransaction);
        }
示例#4
0
 public void Notify(string title, string text)
 {
     NotificationCreated?.Invoke(this, new Notification(title, text));
 }
示例#5
0
 /// <summary>
 /// Invokes the NotificationCreated event subscribers.
 /// </summary>
 /// <param name="notification">
 /// a newly created Notification
 /// </param>
 protected void OnNotificationCreated(NotificationModel notification)
 {
     NotificationCreated?.Invoke(this, notification);
 }