From 4700268fcf282e67e547c125a15537aea5929082 Mon Sep 17 00:00:00 2001 From: Jack Stratton Date: Sat, 9 Oct 2021 23:24:10 -0700 Subject: [PATCH] Add files --- phms/Database.cs | 13 +++++++++++++ phms/Notes.cs | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 phms/Database.cs create mode 100644 phms/Notes.cs diff --git a/phms/Database.cs b/phms/Database.cs new file mode 100644 index 0000000..6e69d13 --- /dev/null +++ b/phms/Database.cs @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later + +using Npgsql; + +namespace phms +{ + public class Database + { + public static string DatabaseUri { get; set; } + + public static NpgsqlConnection Connection => new NpgsqlConnection(DatabaseUri); + } +} \ No newline at end of file diff --git a/phms/Notes.cs b/phms/Notes.cs new file mode 100644 index 0000000..a820468 --- /dev/null +++ b/phms/Notes.cs @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later + +using Android.App; +using Android.Content; + +namespace phms +{ + public static class Notes + { + public static void Send(string message) + { + var intent = new Intent(Application.Context, typeof(BackgroundService)); + intent.SetAction(BackgroundService.UpdateNotificationAction); + intent.PutExtra("message", message); + Application.Context.StartService(intent); + } + } +} \ No newline at end of file -- 2.38.5