Пример #1
0
		public static void Db_Notify_CauseCreated(this RIdentity identity, string notificationUrl)
		{
			foreach (var accessRole in identity.AccessRoles)
			{
				if (accessRole.ReceiveNotifications)
				{
					var notification = identity.DataSet.PendingNotifications.NewRow();
					notification.Type = NotificationTypes.NewRIdentity;
					notification.ReferencedTable = RIdentitysTable.NativeName;
					notification.ReferencedId = identity.Id;
					notification.Text = $"{identity}";
					notification.WebUser = accessRole.WebUser;
					notification.Time = identity.CreationTime;
					notification.Table.Add(notification);
				}
				if (accessRole.ReceiveMails)
				{
					var html = new DefaultHtmlMail
					{
						Footer = MailFooter,
						Title = "Neuer Benutzer",
						Parts = new List<DefaultHtmlMail.Part>
						{
							GetPartWithDetails($"Neuer Benutzer", identity.CreationTime, identity)
						},
						Urls = new List<DefaultHtmlMail.Url>
						{
							new DefaultHtmlMail.Url {Text = "Für weitere Details online gehen", Link = notificationUrl}
						}
					};
					identity.DataSet.WebConfigurations.Mail.SendMailAsync(accessRole.WebUser.EMail, null, $"Neuer Benutzer: {identity}", html.GetString(), true);
				}
			}
		}
Пример #2
0
		public static void Db_Notify_CauseCreated(this RException exception, string notificationUrl)
		{
			foreach (var accessRole in exception.RIdentity.AccessRoles)
			{
				if (accessRole.ReceiveNotifications)
				{
					var notification = exception.DataSet.PendingNotifications.NewRow();
					notification.Type = NotificationTypes.NewRException;
					notification.ReferencedTable = RExceptionsTable.NativeName;
					notification.ReferencedId = exception.Id;
					notification.Text = $"{exception}";
					notification.TextFooter = $"{exception.RIdentity}";
					notification.WebUser = accessRole.WebUser;
					notification.Time = exception.Time;
					notification.Table.Add(notification);
				}
				if (accessRole.ReceiveMails)
				{
					var html = new DefaultHtmlMail
					{
						Footer = MailFooter,
						Title = "Neue remote exception",
						Parts = new List<DefaultHtmlMail.Part>
						{
							GetPartWithDetails($"EXCEPTION: {exception.Type}", exception.Time, exception.RIdentity),
							
							new DefaultHtmlMail.Part
							{
								Title = $"Nachricht",
								Message = $"{exception.Message}"
							},
							new DefaultHtmlMail.Part
							{
								Title = $"Stacktrace (abgekürzt)",
								Message = $"{exception.ShortenedStackTrace}"
							},
							new DefaultHtmlMail.Part
							{
								Title = $"Stacktrace",
								Message = $"{exception.StackTrace}"
							},
							
						},
						Urls = new List<DefaultHtmlMail.Url>
						{
							new DefaultHtmlMail.Url {Text = "Für weitere Details online gehen", Link = notificationUrl}
						}
					};
					exception.DataSet.WebConfigurations.Mail.SendMailAsync(accessRole.WebUser.EMail, null, $"RException: {exception}", html.GetString(), true);
				}
			}
		}
Пример #3
0
		public static void Db_Notify_CauseCreated(this RFeedback feedback, string notificationUrl)
		{
			foreach (var accessRole in feedback.RIdentity.AccessRoles)
			{
				if (accessRole.ReceiveNotifications)
				{
					var notification = feedback.DataSet.PendingNotifications.NewRow();
					notification.Type = NotificationTypes.NewRFeedback;
					notification.ReferencedTable = RFeedbacksTable.NativeName;
					notification.ReferencedId = feedback.Id;
					notification.Text = $"{feedback.Message}";
					notification.TextFooter = $"{feedback.RIdentity}";
					notification.WebUser = accessRole.WebUser;
					notification.Time = feedback.Time;
					notification.Table.Add(notification);
				}
				if (accessRole.ReceiveMails)
				{
					var html = new DefaultHtmlMail
					{
						Footer = MailFooter,
						Title = "Neues remote Feedback",
						Parts = new List<DefaultHtmlMail.Part>
						{
							GetPartWithDetails($"Neues Feedback von {feedback.Autor}", feedback.Time, feedback.RIdentity),
							new DefaultHtmlMail.Part
							{
								Title = $"Nachricht",
								Message = $"{feedback.Message}"
							},
						},
						Urls = new List<DefaultHtmlMail.Url>
						{
							new DefaultHtmlMail.Url {Text = "Für weitere Details online gehen", Link = notificationUrl}
						}
					};
					feedback.DataSet.WebConfigurations.Mail.SendMailAsync(accessRole.WebUser.EMail, null, $"Feedback: {feedback}", html.GetString(), true);
				}
			}
		}
Пример #4
0
		public static void Db_Notify_CauseCreated(this RLog log, string notificationUrl)
		{
			foreach (var accessRole in log.RIdentity.AccessRoles)
			{
				if (accessRole.ReceiveNotifications)
				{
					var notification = log.DataSet.PendingNotifications.NewRow();
					notification.Type = NotificationTypes.NewRLog;
					notification.ReferencedTable = RLogsTable.NativeName;
					notification.ReferencedId = log.Id;
					notification.Text = $"{log.Message}";
					notification.TextFooter = $"{log.RIdentity}";
					notification.WebUser = accessRole.WebUser;
					notification.Time = log.Time;
					notification.Table.Add(notification);
				}
				if (accessRole.ReceiveMails)
				{
					var html = new DefaultHtmlMail
					{
						Footer = MailFooter,
						Title = "Neuer remote log",
						Parts = new List<DefaultHtmlMail.Part>
						{
							GetPartWithDetails("Neuer Remote Log", log.Time, log.RIdentity),
							new DefaultHtmlMail.Part
							{
								Title = $"Nachricht",
								Message = $"{log.Message}"
							}
						},
						Urls = new List<DefaultHtmlMail.Url>
						{
							new DefaultHtmlMail.Url {Text = "Für weitere Details online gehen", Link = notificationUrl}
						}
					};
					log.DataSet.WebConfigurations.Mail.SendMailAsync(accessRole.WebUser.EMail, null, $"Rlog: {log}", html.GetString(), true);
				}
			}
		}