Add project files.
This commit is contained in:
57
SQLite_test/Classes/Crud.cs
Normal file
57
SQLite_test/Classes/Crud.cs
Normal file
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
36
SQLite_test/Classes/User.cs
Normal file
36
SQLite_test/Classes/User.cs
Normal file
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user