From 70f9e00692589544418b9ce98cd3c926b77d85a5 Mon Sep 17 00:00:00 2001 From: Peter Stibitz Date: Sat, 28 Oct 2023 15:53:37 +0100 Subject: [PATCH 01/14] Assed Views Folder --- DB-Manager.csproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DB-Manager.csproj b/DB-Manager.csproj index 1a8369d..9ecf39f 100644 --- a/DB-Manager.csproj +++ b/DB-Manager.csproj @@ -61,4 +61,8 @@ + + + + From cb3289a30786e98db8e8b791f737728643ec5bb1 Mon Sep 17 00:00:00 2001 From: Peter Stibitz Date: Sat, 28 Oct 2023 18:35:55 +0100 Subject: [PATCH 02/14] added new ContentPage Request Specialists --- AppShell.xaml | 15 +++++++++++---- DB-Manager.csproj | 5 ++++- Views/RequestSpecialists.xaml | 11 +++++++++++ Views/RequestSpecialists.xaml.cs | 9 +++++++++ 4 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 Views/RequestSpecialists.xaml create mode 100644 Views/RequestSpecialists.xaml.cs diff --git a/AppShell.xaml b/AppShell.xaml index b1bb675..bb1210e 100644 --- a/AppShell.xaml +++ b/AppShell.xaml @@ -4,11 +4,18 @@ xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:MauiApp1" + xmlns:views="clr-namespace:MauiApp1.Views" Shell.FlyoutBehavior="Disabled"> - + + + + + diff --git a/DB-Manager.csproj b/DB-Manager.csproj index 9ecf39f..1821f9a 100644 --- a/DB-Manager.csproj +++ b/DB-Manager.csproj @@ -28,6 +28,7 @@ 10.0.17763.0 10.0.17763.0 6.5 + en @@ -62,7 +63,9 @@ - + + MSBuild:Compile + diff --git a/Views/RequestSpecialists.xaml b/Views/RequestSpecialists.xaml new file mode 100644 index 0000000..f87721a --- /dev/null +++ b/Views/RequestSpecialists.xaml @@ -0,0 +1,11 @@ + + + + + diff --git a/Views/RequestSpecialists.xaml.cs b/Views/RequestSpecialists.xaml.cs new file mode 100644 index 0000000..93faf7d --- /dev/null +++ b/Views/RequestSpecialists.xaml.cs @@ -0,0 +1,9 @@ +namespace MauiApp1.Views; + +public partial class RequestSpecialists : ContentView +{ + public RequestSpecialists() + { + InitializeComponent(); + } +} \ No newline at end of file From 71d1e83f1d717ddbf27b51ef1d3e706cfadca8cc Mon Sep 17 00:00:00 2001 From: Peter Stibitz Date: Sun, 29 Oct 2023 01:27:46 +0100 Subject: [PATCH 03/14] new tables for skills_request --- DatabaseInitialiser.cs | 12 +++++++++--- Views/RequestSpecialists.xaml | 11 +++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/DatabaseInitialiser.cs b/DatabaseInitialiser.cs index cceb894..1175228 100644 --- a/DatabaseInitialiser.cs +++ b/DatabaseInitialiser.cs @@ -85,7 +85,9 @@ private static List GetTableCreationCommands() "CREATE TABLE IF NOT EXISTS rota_type (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL)", "CREATE TABLE IF NOT EXISTS equipment_type (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL)", "CREATE TABLE IF NOT EXISTS organisation_type (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL)", - "CREATE TABLE IF NOT EXISTS order_status (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL)", + "CREATE TABLE IF NOT EXISTS organisation (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL)", + "CREATE TABLE IF NOT EXISTS person (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL, FieldName TEXT NOT NULL)", + "CREATE TABLE IF NOT EXISTS order_status (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL)", "CREATE TABLE IF NOT EXISTS resource_types (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL)", "CREATE TABLE IF NOT EXISTS room_type (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL)", "CREATE TABLE IF NOT EXISTS room_use_type (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL)", @@ -100,7 +102,11 @@ private static List GetTableCreationCommands() "CREATE TABLE IF NOT EXISTS role (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL)", "CREATE TABLE IF NOT EXISTS skill (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL)", "CREATE TABLE IF NOT EXISTS team_member (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL)", - "CREATE TABLE IF NOT EXISTS partner_agencies (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL)" - }; + "CREATE TABLE IF NOT EXISTS partner_agencies (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL)", + "CREATE TABLE IF NOT EXISTS skills_request (Id INTEGER PRIMARY KEY AUTOINCREMENT, skill_name TEXT NOT NULL, " + + "organisation_id INTEGER, request_date DATE, requested_by INTEGER, number_required INTEGER, start_date DATE, end_date DATE, " + + "status TEXT, confirmed_date DATE, FOREIGN KEY (skill_name) REFERENCES skill(Name), " + + "FOREIGN KEY (organisation_id) REFERENCES organisation(id),FOREIGN KEY (requested_by) REFERENCES person(id));" + }; } } diff --git a/Views/RequestSpecialists.xaml b/Views/RequestSpecialists.xaml index f87721a..1e100b9 100644 --- a/Views/RequestSpecialists.xaml +++ b/Views/RequestSpecialists.xaml @@ -2,10 +2,9 @@ - - + + + + + From 4af66046aad46965d61de0d93e011fa6c0d595ab Mon Sep 17 00:00:00 2001 From: Peter Stibitz Date: Sun, 29 Oct 2023 01:19:51 +0000 Subject: [PATCH 04/14] fixed RequestSpecialists --- AppShell.xaml | 2 +- DB-Manager.csproj | 2 +- Views/RequestSpecialists.xaml | 10 ---------- Views/RequestSpecialists.xaml.cs | 9 --------- Views/RequestSpecialities.xaml | 12 ++++++++++++ Views/RequestSpecialities.xaml.cs | 9 +++++++++ 6 files changed, 23 insertions(+), 21 deletions(-) delete mode 100644 Views/RequestSpecialists.xaml delete mode 100644 Views/RequestSpecialists.xaml.cs create mode 100644 Views/RequestSpecialities.xaml create mode 100644 Views/RequestSpecialities.xaml.cs diff --git a/AppShell.xaml b/AppShell.xaml index bb1210e..4d09ede 100644 --- a/AppShell.xaml +++ b/AppShell.xaml @@ -15,7 +15,7 @@ + ContentTemplate="{DataTemplate views:RequestSpecialities}" /> diff --git a/DB-Manager.csproj b/DB-Manager.csproj index 1821f9a..3cf8a9a 100644 --- a/DB-Manager.csproj +++ b/DB-Manager.csproj @@ -63,7 +63,7 @@ - + MSBuild:Compile diff --git a/Views/RequestSpecialists.xaml b/Views/RequestSpecialists.xaml deleted file mode 100644 index 1e100b9..0000000 --- a/Views/RequestSpecialists.xaml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - diff --git a/Views/RequestSpecialists.xaml.cs b/Views/RequestSpecialists.xaml.cs deleted file mode 100644 index 93faf7d..0000000 --- a/Views/RequestSpecialists.xaml.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace MauiApp1.Views; - -public partial class RequestSpecialists : ContentView -{ - public RequestSpecialists() - { - InitializeComponent(); - } -} \ No newline at end of file diff --git a/Views/RequestSpecialities.xaml b/Views/RequestSpecialities.xaml new file mode 100644 index 0000000..c265be6 --- /dev/null +++ b/Views/RequestSpecialities.xaml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/Views/RequestSpecialities.xaml.cs b/Views/RequestSpecialities.xaml.cs new file mode 100644 index 0000000..c451419 --- /dev/null +++ b/Views/RequestSpecialities.xaml.cs @@ -0,0 +1,9 @@ +namespace MauiApp1.Views; + +public partial class RequestSpecialities : ContentPage +{ + public RequestSpecialities() + { + InitializeComponent(); + } +} \ No newline at end of file From dd4c8b145af23619f88542646551cf54527ee4b2 Mon Sep 17 00:00:00 2001 From: Peter Stibitz Date: Sun, 29 Oct 2023 02:07:59 +0000 Subject: [PATCH 05/14] Added UI for request SpecialistsService to enter new Requests --- AppShell.xaml | 2 +- DB-Manager.csproj | 8 ++++++- Services/RequestSpecialistsService.cs | 32 +++++++++++++++++++++++++++ Views/RequestSpecialists.xaml | 24 ++++++++++++++++++++ Views/RequestSpecialists.xaml.cs | 27 ++++++++++++++++++++++ Views/RequestSpecialities.xaml | 12 ---------- Views/RequestSpecialities.xaml.cs | 9 -------- 7 files changed, 91 insertions(+), 23 deletions(-) create mode 100644 Services/RequestSpecialistsService.cs create mode 100644 Views/RequestSpecialists.xaml create mode 100644 Views/RequestSpecialists.xaml.cs delete mode 100644 Views/RequestSpecialities.xaml delete mode 100644 Views/RequestSpecialities.xaml.cs diff --git a/AppShell.xaml b/AppShell.xaml index 4d09ede..bb1210e 100644 --- a/AppShell.xaml +++ b/AppShell.xaml @@ -15,7 +15,7 @@ + ContentTemplate="{DataTemplate views:RequestSpecialists}" /> diff --git a/DB-Manager.csproj b/DB-Manager.csproj index 3cf8a9a..b85e7d5 100644 --- a/DB-Manager.csproj +++ b/DB-Manager.csproj @@ -63,7 +63,13 @@ - + + RequestSpecialists.xaml + + + + + MSBuild:Compile diff --git a/Services/RequestSpecialistsService.cs b/Services/RequestSpecialistsService.cs new file mode 100644 index 0000000..bf52e8b --- /dev/null +++ b/Services/RequestSpecialistsService.cs @@ -0,0 +1,32 @@ +using Microsoft.Data.Sqlite; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MauiApp1.Services +{ + internal class RequestSpecialistsService + { + private readonly SqliteConnection _connection; + + /// + /// Creates a new database operation instance, initializing the connection to the SQLite database. + /// + /// The SQLite database connection string. + public RequestSpecialistsService(string connectionString) + { + _connection = new SqliteConnection(connectionString); + + try + { + _connection.Open(); + } + catch (Exception ex) + { + throw new Exception("Error establishing database connection.", ex); + } + } + } +} diff --git a/Views/RequestSpecialists.xaml b/Views/RequestSpecialists.xaml new file mode 100644 index 0000000..6173458 --- /dev/null +++ b/Views/RequestSpecialists.xaml @@ -0,0 +1,24 @@ + + + + + + + +