This project is a simple desktop application for managing a garden center's customer, product, and offer data. It is built using WPF for the UI, with a backend powered by a SQL Server database. The application is structured with a layered architecture, including a data access layer (DAL), a business logic layer (BLL), and a presentation layer.
- .NET 6 or later
- SQL Server
- Visual Studio 2022 or later
Before running the project, you need to configure the following:
Ensure that you have a SQL Server instance running and create a database named TuinCentrumDB
. Use the following SQL script to create the required tables:
CREATE TABLE Klant (
KlantID INT PRIMARY KEY,
Naam NVARCHAR(100) NOT NULL,
Adres NVARCHAR(200) NOT NULL
);
CREATE TABLE Product (
ProductID INT PRIMARY KEY,
NederlandseNaam NVARCHAR(100) NOT NULL,
WetenschappelijkeNaam NVARCHAR(100) NOT NULL,
Beschrijving NVARCHAR(500),
Prijs DECIMAL(10, 2) NOT NULL
);
CREATE TABLE Offerte (
OfferteID INT PRIMARY KEY,
Datum DATE NOT NULL,
KlantID INT NOT NULL,
Aantal INT NOT NULL,
Afhaall BIT NOT NULL,
Aanleg BIT NOT NULL,
CONSTRAINT FK_Klant FOREIGN KEY (KlantID) REFERENCES Klant(KlantID)
);
CREATE TABLE Offerte_Producten (
OfferteID INT NOT NULL,
ProductID INT NOT NULL,
Aantal INT NOT NULL,
CONSTRAINT PK_Offerte_Producten PRIMARY KEY (OfferteID, ProductID),
CONSTRAINT FK_Offerte FOREIGN KEY (OfferteID) REFERENCES Offerte(OfferteID),
CONSTRAINT FK_Product FOREIGN KEY (ProductID) REFERENCES Product(ProductID)
);
Update the connection string in the TuinRepository
class to match your SQL Server configuration. Open TuinRepository.cs
and set the connectionString
variable with your SQL Server details:
private string connectionString = "Server=YOUR_SERVER_NAME;Database=TuinCentrumDB;Trusted_Connection=True;";
If you are using SSL for your SQL Server connection, ensure that the appropriate certificates are installed and configured on your machine. Update the connection string to include Encrypt=True;TrustServerCertificate=True if necessary
.
- Open the solution in Visual Studio.
- Restore the NuGet packages.
- Build the solution.
- Run the application.
Contributions are welcome! Please fork the repository and create a pull request with your changes.