View on GitHub

Red-Inventory-Management

C#, WPF, MVVM, MS SQL LocalDB, Inventory management, Entity Framework, log4net

download .ZIPdownload .TGZ

Red’s Inventory Management

Program features

Setup database connection

The program connects to a database file with “.mdf” extension using MS SQL LocalDB. Microsoft SQL Server 2014 Express LocalDB is set as prerequisite in the Setup project, but the program works with other versions of LocalDb as well. (Update: Setup project has been removed, because it’s not supported in new versions of Visual Studio.) When the application starts first time, a small window pops up and you have to create a new database file, or connect to an existing one. You can’t use the program without database connection. The program automatically stores the path of the database folder and the name of the database file in the DatabaseSettings.txt file in the application folder. You can change the database connection settings under the Settings => Database menu.

Login

The program stores usernames and passwords in the “Users” table, and the passwords are encrypted with salted SHA-256 hashing. If the “Users” table is empty at the start of the program, a small window pops up, and you have to add the first user to the database. If there is at least one user in the “Users” table, you can enter the username and the password in the login window. You can Add/Modify/Remove users under the Settings => Users menu.

Notifications

The program sends messages to the user via Notifications in the top right corner of the screen. The notifications are based on this GitHub project

Program log

The program uses log4net to log it’s behaviour into the RedLog.txt file. To see more detailed debug information, open the programs config file, and <– comment –> the filter section from the log4net appender tags.

Tables

Every table builds up in a similar way in the program with the same features. You can Add/Edit/Delete:

If you Add/Edit a record a smaller window pops up in the center of the screen. You can change the details of the record, and you can save or cancel the changes with the two button at the bottom of the window.

Lists

Inventory list

Partner transactions

Program structure

Entity Layer

The Entity Layer contains the classes responsible for the structure of the database tables, and the structure of the lists passed between the layers.

Datatable Entities

List Entities

Data Layer

The Data Layer contains the classes responsible for the Database connection, and the data provider classes responsible for the consistent database state.

Database connection

Data providers

Business Layer

The classes in the Business Layer are providing services used by the UI Layer and connecting the Data Layer and the UI Layer.

UI Layer

The UI Layer was made by using MVVM pattern.

Setup database connection UI

Login UI

Main window UI

Tables UI

Add/Edit table-records

Lists UI

Details list