diff --git a/SQLite_test.sln b/SQLite_test.sln new file mode 100644 index 0000000..dd1da94 --- /dev/null +++ b/SQLite_test.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.13.35919.96 d17.13 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite_test", "SQLite_test\SQLite_test.csproj", "{164810E3-EA38-48C7-834F-3252AC1C9069}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {164810E3-EA38-48C7-834F-3252AC1C9069}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {164810E3-EA38-48C7-834F-3252AC1C9069}.Debug|Any CPU.Build.0 = Debug|Any CPU + {164810E3-EA38-48C7-834F-3252AC1C9069}.Release|Any CPU.ActiveCfg = Release|Any CPU + {164810E3-EA38-48C7-834F-3252AC1C9069}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BA6C2E1F-3F6F-4F8C-81CB-E4DB2F060DE2} + EndGlobalSection +EndGlobal diff --git a/SQLite_test/App.xaml b/SQLite_test/App.xaml new file mode 100644 index 0000000..0b2960c --- /dev/null +++ b/SQLite_test/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/SQLite_test/App.xaml.cs b/SQLite_test/App.xaml.cs new file mode 100644 index 0000000..b9af7c1 --- /dev/null +++ b/SQLite_test/App.xaml.cs @@ -0,0 +1,14 @@ +using System.Configuration; +using System.Data; +using System.Windows; + +namespace SQLite_test +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } + +} diff --git a/SQLite_test/AssemblyInfo.cs b/SQLite_test/AssemblyInfo.cs new file mode 100644 index 0000000..b0ec827 --- /dev/null +++ b/SQLite_test/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/SQLite_test/Classes/Crud.cs b/SQLite_test/Classes/Crud.cs new file mode 100644 index 0000000..274ee1b --- /dev/null +++ b/SQLite_test/Classes/Crud.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Data.Entity.Migrations.Model; +using System.Data.SQLite; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SQLite_test.Classes +{ + internal class Crud + { + + private SQLiteConnection _connection; + string connectionString = "Data Source=mydatabase.db;Version=3;"; + + + // Connection to the database would be established here + public Crud() + { + // Initialize database connection or any other setup + _connection = new SQLiteConnection(connectionString); + try + { + _connection.Open(); + Debug.WriteLine("Verbinding met de database is geopend!"); + } + catch (Exception ex) + { + Debug.WriteLine($"Fout bij het openen van de database: {ex.Message}"); + } + } + + + protected void Add() + { + // implement Add logic here + } + + protected void Create() + { + // Implement create logic here + } + + protected void Read() + { + // Implement read logic here + } + + protected void Delete() + { + // Implement delete logic here + } + + } +} diff --git a/SQLite_test/Classes/User.cs b/SQLite_test/Classes/User.cs new file mode 100644 index 0000000..55931b4 --- /dev/null +++ b/SQLite_test/Classes/User.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SQLite_test.Classes +{ + internal class User : Crud + { + + // call inherited methods from Crud class + public void AddUser() + { + Add(); + + } + + public void CreateUser() + { + Create(); + } + + public void ReadUser() + { + Read(); + } + + public void DeleteUser() + { + Delete(); + } + + + } +} diff --git a/SQLite_test/MainWindow.xaml b/SQLite_test/MainWindow.xaml new file mode 100644 index 0000000..35e7697 --- /dev/null +++ b/SQLite_test/MainWindow.xaml @@ -0,0 +1,19 @@ + + + + + + + +