SoftStocks / Inventory-Management-System

This is a case study for Anglia Ruskin University
0 stars 0 forks source link

<!DOCTYPE html>

SOFTSTOCKS-LOGO

SoftStocks
What do you call humorous inventory? A Laughing Stock

Description

SoftStocks makes looking after your Inventory Stock as easy as clicking a few buttons. SoftStocks will keep tabs on the stock levels and stock distributors so that you can always see all of your businesses data all in one place. We put our complete trust in our software to keep your data safe and secure, our authentication system will only allow registered and authenticated users from viewing, deleting and editing data.

Usage

With an easy to use user interface, built around being clean and ituitive we believe that this system is very straight forward. Once run there will be a start up log in screen presented to the user where to access any other pages they will have to sign in with their credentials. After logged in you can access three different pages, Home, Edit and Advanced. The home page serves all supplier infomation and controls to be able to add, edit and delete different entries.

![image](https://user-images.githubusercontent.com/40577677/232230350-11da2522-dc0a-4811-98b4-a0c29a6311dd.png)

Report

Report is the unit of information within SoftStocks. It is an object with which the client interacts via application logic.

Architecturally, this is a read-only layer that makes use of Entity Framework, which in turn makes use of the database. The implementation details of connecting to the database and using DbContext are abstracted away from the client.

Whilst Report itself is an abstract class, the following guide can be used for any class which implements Report:

Constructor

Report report = new Report(id)

A new report can be created by using constructor, with one parameter corresponding to the id of the report's respective entity in the database. Reports will present information derived from a single record, with id specifying which record.

NB: the code above will not work, as it references an abstract class. There will be other types of report implementing this class, but all will have the same behaviours as the base class.

report.Generate(ReportFormat.Pdf)

Part of Report is the ability to render data in a given format. These formats are contained within the enum at ReportFormat.cs. This is a method within the abstract definition of Report, with the implementation details altering based on the type of report being generated. report.Destroy()

The report's entry within persistent object storage will be removed, along with any associated files.

Configuration

Code-First Migrations

When making changes to the database, such as by adding new tables, entities or changing data types, you will need to update the migrations. To do this:

  1. From the top bar, click View
  2. Click Other Windows
  3. Click Package Manager Console
  4. Change the default project to SoftStocksData
  5. Enter Update-Database into the command line. You can optionally add -Verbose

Database population

Data in the database is populated by using a script which extracts table records from CSV files. These CSV files are found within CSV data within the SoftStockData project.

Each of these CSV files corresponds to a table in the database. Please do not change the name of the files as the script depends on the exact filenames to function!

To add data to the database, there is a static PopulateDatabase class. This class has one public method with no arguments, SetUp(). This method serves as a façade, abstracting the backend implementation detail. Specifically, Setup() will clear all existing records and then iterate through each CSV file and populate the database using the data stored within it.

Currently, there is a bug in which the addition of new records will not reset the identity value. This is crucial due to the use of foreign keys in the CSV files. This is captured in #40 and #54