Professional Documents
Culture Documents
FinalReport DB
FinalReport DB
FOICDT
Information Systems
The whole team would like to show their appreciation to the following lecturers:
Mrs. S.Nagowah
i
Abstract
The aim of this project is to help each individual to learn how to work in teams and how they must
study by themselves by doing researches. This will also help us in our final year project and helps
us develop the skills to have a proper understanding of Information Systems.
ii
Table of Contents
Acknowledgement .......................................................................................................................... i
Abstract ……………………………………………………………………………………...ii
iii
2.8 Conclusion...................................................................................................................... 13
3.2 List of functional Requirements (FR) and Non-Functional Requirements (NFR) that the
new system will cover ............................................................................................................... 14
4.1 Sequence diagram, Activity diagram and state chart diagram for each Business process:
………………………………………………………………………………………….31
iv
4.3 Database design: ............................................................................................................. 49
Chapter 7 Summary................................................................................................................ 97
v
Chapter 9 Appendix .............................................................................................................. 100
vi
List of Figures
Figure 1.1 Gantt Chart .................................................................................................................... 3
vii
Figure 4. 13 Inventory System Sequence Diagram ...................................................................... 42
Figure 4. 14 Inventory System Activity Diagram ......................................................................... 43
Figure 4. 15 Inventory System State Chart Diagram .................................................................... 43
Figure 4. 16 Sale System Flowchart ............................................................................................. 44
Figure 4. 17 Purchase System Flowchart ...................................................................................... 45
Figure 4. 18 Product System Flowchart ........................................................................................ 46
Figure 4. 19 Payroll System Flowchart......................................................................................... 47
Figure 4. 20 Inventory System Flowchart..................................................................................... 48
Figure 4. 21 Overall ER Diagram ................................................................................................. 49
Figure 4. 22 Overall Relational Schema ....................................................................................... 50
Figure 4. 23 Login system ............................................................................................................ 51
Figure 4. 24 Manager's menu ........................................................................................................ 51
Figure 4. 25 Manager's system access .......................................................................................... 52
Figure 4. 26 Employee's menu ...................................................................................................... 52
Figure 4. 27 Sale System User Interface ....................................................................................... 53
Figure 4. 28 Sale system if item is out of stock ............................................................................ 53
Figure 4. 29 Customer receipt ....................................................................................................... 54
Figure 4. 30 Purchase system User Interface ................................................................................ 55
Figure 4. 31 Product System User Interface ................................................................................. 55
Figure 4. 32Product system ‘adding new product’ User Interface ............................................... 55
Figure 4. 33 Product system ‘modifying a product’ User Interface ............................................. 56
Figure 4. 34 Product system 'Deleting a product' User Interface.................................................. 56
Figure 4. 35 Payroll system User Interface ................................................................................... 57
Figure 4. 36 Inventory system User Interface ............................................................................... 57
viii
Figure 5. 7 Sale system procedure explanation ............................................................................ 61
Figure 5. 8 Sale system cursor explanation .................................................................................. 62
Figure 5. 9 Sales system cursor (continue) ................................................................................... 63
Figure 5. 10 Sale system cursor (Continue) .................................................................................. 64
Figure 5. 11 Updated table salesTransaction ................................................................................ 64
Figure 5. 12 Sale system additional procedure spGetGift ............................................................ 65
Figure 5. 13 Sale system trigger explained ................................................................................... 66
Figure 5. 14 Updated table inventory ........................................................................................... 66
Figure 5. 15 Create and insert in table Product ............................................................................. 67
Figure 5. 16 Create and Insert table Inventory ............................................................................. 68
Figure 5. 17 Create and Inserting values in table StockPurchase ................................................. 69
Figure 5. 18 Procedure and cursor with output showing items that should be restocked ............. 70
Figure 5. 19 Trigger and output showing table inventory being updated after a purchase from the
supplier.......................................................................................................................................... 71
Figure 5. 20 Table product ............................................................................................................ 73
Figure 5. 21 Basic queries from table product .............................................................................. 73
Figure 5. 22 Basic update from table product ............................................................................... 74
Figure 5. 23 Create and insert value in table employee ................................................................ 77
Figure 5. 24 Output table employee .............................................................................................. 77
Figure 5. 25 Create and insert values in table salaryDetail........................................................... 78
Figure 5. 26 Output table salaryDetail .......................................................................................... 78
Figure 5. 27 Stored Procedure to calculate hoursWorked and eSalary in table salaryDetail ....... 79
Figure 5. 28 Cursor to calculate the values in every row.............................................................. 80
Figure 5. 29 Output of table salaryDetail from running the cursor and procedure ....................... 80
Figure 5. 30 Trigger to take the latest value of eSalary from table salaryDetail to update table
employee ....................................................................................................................................... 81
Figure 5. 31 Output of table employee after running Trigger....................................................... 81
Figure 5. 32 Function to display the details Total Salary and Number of working days for an
employee ....................................................................................................................................... 81
Figure 5. 33 Creating and inserting table product values ............................................................. 82
Figure 5. 34 Out of table product .................................................................................................. 82
ix
Figure 5. 35 Creating and inserting table Inventory Values ......................................................... 83
Figure 5. 36 Output of table Invemtory ........................................................................................ 83
Figure 5. 37 Procedure and cursor for the Inventory system ........................................................ 84
Figure 5. 38 Outputs for the Inventory System checking product by product .............................. 85
Figure 5. 39 Procedure and cursor for Inventory System showing stock level for all products at
once ............................................................................................................................................... 85
Figure 5. 40 Output checkStockForAll ......................................................................................... 86
x
Figure 9. 6 Company Profile ....................................................................................................... 105
Figure 9. 7 Stocks being delivered to the shopInventory............................................................ 106
xi
Chapter 1 Introduction
The change when dealing with businesses is due to the advancement to the IT sector, especially
the relationship concerning the customer, employee and suppliers. As a team and as well as having
the privilege to be an Information Systems students, we were asked to study this particular field
by taking into consideration the current situation of the business and the design and implement a
suitable Information System for it. Thus, we decided to implement a clothing shop for our project
with the concept of computerizing the main business processes of the company.
The owner has a shop in Curepipe (Jan Palach Arcade). Mr Shuhail has 6 workers including a
driver.
When the owner places his order to the supplier, the supplier will deliver the good in about one-
month time depending on the quantity.
The owner makes the necessary arrangements with the driver for him to collect the goods.
Products can be classified into different categories (shirt, jean, dress), size (XS, S, M, X, XL) and
color. Information stored about the products are the Product ID, Product Name and product price.
The shop stores the information about its employees (name, Id, phone number, age, address,
position, qualifications, part or full time, salary), suppliers (name, Id, phone number, address
consisting of country, city and street name). The employees and the suppliers can have more than
one phone number.
The received products are transferred into the shop inventory. A vehicle is used to bring the cargos
at the shop. Stock remaining in inventory is recorded. The shop currently has 2 small vehicles
available for the transportation. Information stored about the vehicles is the vehicle ID, Vehicle
Name and Vehicle model
When a customer arrives, he places his order to the employee by choosing on the shop magazine.
The employee then checks in the available stock manually. If there is sufficient stock, the
employee will pack the product, and give the customer an invoice else he will request for changing
the order.
Customers information are also stored – ID, name, phone number (various), address and payment
method. Payment can be done either in cash or via credit card. Good once sold cannot be returned.
Whenever a sale transaction has been done, the shop writes it in a hard cover copybook to record
the sales. The transaction ID, name and date are also recorded.
Due to daily transactions, the records are increasing and the owner need to keep track of them for
further conclusion. With this system, recorded data are at risk and the record book may lost or may
be damaged.
2
1.4 Chart Graph
The above Gantt chart describes the amount of days we have allocated to our assignment. This
also includes the specific tasks which we managed to accomplish as a team. Moreover, each
member of the team has been able to design diagrams for the specific business processes that was
assigned to them. The diagrams include a sequence, state, activity and use case.
3
1.5 Work Distribution
Team Member Task Allocated
DOMUN Raamiz Saad – 1914169 Team leader
• Payroll System
• Dividing and assigning each
member’s tasks
• Setting up deadlines
• Worked on the Literature Review
• Designed the payroll system
interface
• Assembling all the works
• 20% contribution
BHOLAH Sambhav – 1913983 • Inventory System
• Designed the Inventory, Login,
Manager Menu, Employee Menu,
Receipt, Interfaces
• Assembling the diagrams together
• Worked on the design process
• 20% contribution
HOSANY Uthmaan Muhammad – 1915052 • Product System
• Worked on the Literature Review
• Worked on the Final Summary
• Designed Product system interfaces
• Filtering the wordings that has been
used
• 20% contribution
BISSONATH Rohan -1914153 • Purchase system
• Worked on the Introduction
• Worked on the design process
• Designed the purchase system
interface
• Worked on the analysis
• 20% contribution
SOOBRON Yashveer – 1913318 • Sales System
• Worked on the Introduction
• Worked on the analysis
• Designed the sale interface
• Filtering the wordings that has been
used
• 20% contribution
4
1.6 Report Structure
Chapter Work covering
1 – Introduction • Introduction
• Company Profile
• Problem Statement
• Aims and objectives
• Gantt Chart
• Work Distribution
2 - Literature Review • Information Systems
• Methodologies used
• Technologies and tools used
• Existing Systems
• Would be system
• Conclusion
3 - Analysis • Problems with existing system
• Identifying new business
processes
• List of Requirements
• Proposed Solution
• Conclusion
4 – Design Process • Design of all business processes
• Algorithm Design
• Database Design
• User Interface Design
5 - Implementation • Creating tables
• Inserting values
• Creating procedures, cursors and
triggers
• Screenshots of outputs
5
Chapter 2 Literature review
2.1 Information Systems
It is a set of interrelated components used for the collection, processing, storing and distribution
of information. This information is used to support decision making and to have a better control
over a business.
The components consist of hardware, software, database, network and people. These components
are merged to perform input, process, output, feedback and control. Hardware consists of
input/output device, processor, operating system and media devices. Software consists of various
programs and procedures. Database consists of data organized in the required structure. Network
consists of hubs, communication media and network devices. People consist of device operators,
network administrators and system specialist (Managementstudyguide, 2020).
Information refers to the data that is accessed by a user for some particular purpose and is
considered as asset in an organization. The main activities of an information system are to capture
raw data from an organization or from the external environment (data instructions are fed to the
system) and convert it into a meaningful form. Then the information is transferred to the people
that uses it (data is presented in structured format and reports).
i) Operational Excellence
Using new technologies helps to improve efficiency and increase productivity. This will
help to increase profits. If a business can do something better, quicker and have more
quality in its product, it will result into success.
6
ii) New products, services and business models
Business enables new tools for new products, services and business models. A business
model describes how a company will produce, deliver and sell its products in order to
acquire profits.
iii) Customer and Supplier Intimacy
Developing a good relationship with the customers by serving them well will lead to
customers coming back. These customers can also advertise the company and bring in more
clients. This will help to increase revenues and profits.
Developing a good relationship with the suppliers will allow them to provide the vital
inputs which will lowers cost.
iv) Improving Decision Making
Before this technology, managers used to make forecasts, guesses and this would lead to
over-production, under-production and poor response times.
Poor outcomes raise costs and lose customers.
Now, Information Systems will help improve decision making by providing the manager
with facts and figures. These accurate decisions will help the company to be more
profitable.
v) Competitive Advantage
Having a good technology will help to have a better performance in the real world. For
example, charge less for superior products and responding to customers and suppliers
quicker.
vi) Survival
Investing in Information Systems has a better chance in resulting into a superior return by
• Increasing productivity
• Increasing revenues
• Investing in complementary assets
7
2.4 Adopting the right model for SABA FASHION
System development are the steps followed to develop a software and the activities required to
develop a new system are:
1. Identify the problems / needs of the user and we need to obtain approval to proceed for
each business process
2. Plan and monitor the project (What to do? / How to do? / organize team and distribute task)
3. Discover and understand the need
4. Design the system component that solves the problem
5. Build, test and integrate
6. Complete system test and deploy solution.
Advantages:
Disadvantages:
8
2.4.2 The prototyping model (A throw away version)
It is a simulation of the actual processing and a simplified model providing sufficient functionality
to understand the main purpose of project. The main aim of this model is to get more requirements
from the user.
Advantages:
1. This model can resolve misunderstanding between the customer and the analyst
2. A prototype can be easily understood
3. Customer can see a steady process
4. Useful when requirements are changing rapidly
Disadvantages:
1. It is impossible to know how long it takes as it depend on whether or not the requirements
of the customer are met
2. Do not know the number of iterations that will be required
Characteristic:
Advantages:
1. Increases flexibility
2. Delivers the right solution as team consist of right people therefore delivering to the
customer the desired solution
3. Accelerates delivery
4. Reduce risk and increase quality
9
Disadvantage:
1. It is hard to develop
2. Makes all dysfunction visible and the team has to fix everything
• Stored procedures
• Cursors
• Triggers
10
ERDPlus:
• ER Diagrams
• Relational Schemas
11
2.7 New Would Be Implemented System
A business process is a set of activities leading to accomplishing a set of organizational goals
which involves both a human and system interaction and they can be controlled by decisions,
triggers, exceptions and events. Business Process Management is to improve a business from end
to end to create a more efficient and effective organization by analyzing it, by modelling how it
works in different situations, by executing improvements, by monitoring the improved process and
by continually optimizing it. Business Process Management focus more on repetitive and ongoing
processes that follows a pattern.
• Sales: The process of sales would be automated. For example, only a click would save all
the concerned records of a sale to its appropriate part in the system.
• Purchase: The hassle of ordering to the suppliers would be consequently reduced as the
new system will include a no human intervention system which can broadly be explained
by the automatic ordering when a certain product has attained certain level.
• Inventory: The system will provide a clear and detailed information about the whole
inventory in just few clicks through a PC.
• Payroll System: A new and advanced payroll system will be available with the system
which will enable the owner to calculate the salary of any type of employee by only
entering few details and literally pressing a button.
• Product: We forecast to use innovative system such as barcode or QR code in the system
which will facilitate the process of purchase in the business.
12
The manager and each will have a login password to get access to the new would be system. The
manager and the employees each have a different menu as the manager can get access to internal
information which is not accessible to the employees.
2.8 Conclusion
To conclude, as per the requirements gathered by the team from the owner, Mr. Shuhail Seck-
Diouman, we will use the agile software development. The team leader of our team had set up
several meetings where we met and discussed about what needs to be done and how it needs to be
done. As we chose the agile development model, everyone had their allocated process, but we
worked all of them together that is, we all focused on a single process at a time to emphasize on
quality work as well as being time effective. At the end of each process we incremented it to the
previous process worked and tested all over as a whole. The system is created process by process
and then each process completed is incremented to one another in order to obtain the whole wanted
software.
Also, the modules and components used to build up the system was carefully chosen and pondered
upon so as to established which of these elements goes where and whether these components are
the most appropriate to this kind of situation. This was possible after a deep analysis of the different
software methodologies like prototyping and agile, of which we decided to settle on. Having
established a schema now the coding part was in. Tools like Visual Studio and Ms SQL Server
proved to become handy to this part as to the numerous features provided. Finally, after several
local test, the system was fully functional with all the required parts and ready for deployment at
the client’s business.
13
Chapter 3 Analysis
3.1 Existing Systems
The owner, Mr. Shuhail Seck Diouman do not have a well-established system in his shop. After
gathering information by interviewing Mr Shuhail, we found out that he would record his sales in
a hard cover copybook by writing all the details of the transaction. He would not update the
inventory. When a customer would come, and place his order, the employee would check the
inventory. As for purchases, he would record the transaction in another copy book along with the
details (quantity bought). When Mr. Shuhail introduces a new product in his shop, he would only
record the transaction in a copybook. As for the salary of the employees, he would calculate their
hours worked manually and make the necessary calculations to get the net salary pay.
As we can see, the old systems can cause a lot of problems such as he would not have any control
on his inventory. So, the team decided to implement the following business processes:
1) Sale System
2) Purchase System
3) Product System
4) Payroll System
5) Inventory System
These business processes will facilitate the owner with his routine at work.
FR 1.0 The system shall allow the user to enter the quantity of product to be sold.
FR2.0 The system shall allow the user to enter the employee ID of the employee.
14
NFR1.0 The system shall display the employee name.
2) Purchase system
FR 1.0 The system shall allow the owner to enter its ID and the password.
FR 1.1 The system shall validate the owner ID and its password.
FR 2.0 The system shall allow the owner to check the inventory.
FR 3.0 The system shall send a notification in case of stocklevel is less than budgetlevel.
FR 5.0 The system shall allow the owner to enter quantity of product to buy.
3) Product system
FR 1.0 The system shall ensure that the products are recorded in some sort of inventory.
FR 2.0 The system shall monitor the ins and outs of the products within the business.
FR 3.0 The system shall process complex event by having multiple event handlers in built
NFR 2.0 The system shall show the products in a menu-based format.
NFR 3.0 The system shall cater for automation further on in the process
4) Payroll system
FR 1.0 The system shall allow user to enter the employee ID of the employee
FR 2.0 The system shall allow user to enter the payrate for the employee
FR 3.0 The system shall allow user to enter the hours worked of the employee
15
NFR 1.0 The system shall update the database automatically
5) Inventory system
FR 1.0 The system shall let the user see the inventory details with the proper details of the products
NFR 1.0 The system shall automatically compare the remaining stock with the budget stock level
and give the appropriate message
NFR 2.0 The system shall display which products with their respective quantity are out of order
16
USE CASE DESCRIPTION
5)Alternative Flows
Post condition:
17
ER DIAGRAM
RELATIONAL SCHEMA
18
3.3.2 Purchase system
USE CASE DIAGRAM
19
USE CASE DESCRIPTION
20
ER DIAGRAM
RELATIONAL SCHEMA
21
3.3.3 Product system
USE CASE DIAGRAM
22
USE CASE DESCRIPTION
1) A sale transaction
2) Participating actors: Customer, System (Product & Shop)
3) Entry criteria: Must make a purchase
4) Basic flow of events:
i) The customer makes a purchase in the shop
ii) The system records the personal details of the customer
iii) The customer presents his/her purchases to the counter
iv) The customer confirms the purchases
v) The customer choses a payment method
vi) The system confirms payment methods chosen
vii) The customer makes the payment
viii) The system validates the payment
ix) The system shows a confirmation message
x) The customer is then allowed to leave the with the paid products
xi) The system process and records the transaction ID, transaction name and
transaction date
xii) In the process the shop details are recorded which are already known by the
system
5) Alternative flows 1: in case step viii in basic flow of events, the validation is resulted in a
negative result:
i) Prompts the user to reenter details
ii) Then, the use case resumes to step vii in the basic flow of events or ends
6) Post conditions:
i) The customer is satisfied with the shopping experience and purchase
ii) The customer receives his/her products
23
ER DIAGRAM
RELATIONAL SCHEMA
24
3.3.4 Payroll system
USE CASE DIAGRAM
25
vi) Owner enter payrate
vii) Owner enter hours worked
viii) Owner add overtime of employee
ix) System calculates salary
x) System display salary
5) Alternative flows:
i) At step(ii) owner enters the wrong password, use case will resumes at step(i).
ii) At step(v) owner enters a wrong employee ID, use case will resume at step(v).
iii) At step(viii) employee does not have an overtime, use case will resume at step(ix).
6) Post condition
The owner gives the salary
ER DIAGRAM
26
RELATIONAL SCHEMA
27
USE CASE DESCRIPTION
At step vi, the system displays a message that a certain product is below budget stock level
6. Post conditions
28
ER DIAGRAM
RELATIONAL SCHEMA
29
3.4 Intermediate Conclusion:
After completing the diagrams and use case specification, a clear image is created on how the
whole system will work with the utmost details on different levels of the system. Having said that,
the pictorial definitions will allow us to have a graphical and visual interpretation of the working
system and the use case specification will provide proper details on how the system will work in a
clear and explicit way.
30
Chapter 4 Design Process
4.1 Sequence diagram, Activity diagram and state chart diagram
for each Business process:
4.1.1 Sales system
31
Figure 4. 2 Sale System Activity Diagram
32
Figure 4. 3 Sale System State Chart Diagram
33
4.1.2 Purchase system
34
Figure 4. 5 Purchase System Activity Diagram
35
Figure 4. 6 Purchase System State Chart Diagram
36
Figure 4. 8 Product System Activity Diagram
37
Figure 4. 9 Product System State Chart Diagram
38
4.1.4 Payroll system:
39
Figure 4. 11 Payroll System Activity Diagram
40
Figure 4. 12 Payroll System State Chart Diagram
41
4.1.5 Inventory system
42
Figure 4. 14 Inventory System Activity Diagram
43
4.2 Algorithm Design
4.2.1 Sale system
44
4.2.2 Purchase system
45
4.2.3 Product system
46
4.2.4 Payroll System
47
4.2.5 Inventory system
48
4.3 Database design:
4.3.1 ER Diagram for overall system
49
4.3.2 Relational Schema for overall system
50
4.4 User Interface Design
51
Figure 4. 25 Manager's system access
52
Figure 4. 27 Sale System User Interface
53
Figure 4. 29 Customer receipt
54
Figure 4. 30 Purchase system User Interface
55
Figure 4. 33 Product system ‘modifying a product’ User Interface
56
Figure 4. 35 Payroll system User Interface
57
Chapter 5 Implementation
5.1 Writing sample codes
5.1.1 Sales system
Step 1: The salesTransaction table was created.
58
Step 3: The values were added to the salesTransaction table.
59
Step 5: A stored procedure which includes a cursor is created. The procedure is meant to calculate
the total price of the product. Values from the column Quantity_sold from salesTransaction table
and price from Inventory table is used (kudvenkat, 2020) (Sharma, 2018).
Figure 5. 5 Procedure and cursor of sale system to calculate total price of product
60
Figure 5. 6 cursor of sale system(continue)
i)
61
4. A WHERE CURRENT OF clause is used in order to update the record that was last
fetched by the cursor. (SALESCURSOR in this case) (UPDATE, 2020)
ii) The cursor is used to retrieve data from a result set one row at a time. The cursor helps the
procedure to loop between the records of the table. Thus, it helps me to calculate the total price for
each row until the end of the table. As seen in figure 5.7 the data has been updated.
1)At first,a cursor named SALESCURSOR is declared and a select statement is attached to it.(A
cursor is declared and not created because it is not a database object. Otherwise, we would have
used created)
2)Then, the price and Quantity_sold is selected using the inner join between the tables
product,Inventory and salesTransaction.
The inner join is used to be able to have a result set that has all of the columns from
product,Inventory and salesTransaction.
3)3 variables are declared to store the price, quantity sold and total.
62
iii)
1)When we use OPEN SALESCURSOR,the result set will be generated in the database.
2)when we start using FETCH NEXT FROM cursor, the first record from the result set is
fetched. (i.e only one record is read at a time)
E.g When we fetch the first record,the price and Quantity_sold is assigned to the @price and
@Quantity_sold variables.
6)The process is carried out until @FETCH_STATUS returns value -1,that is,there is no record
left.
63
Figure 5. 10 Sale system cursor (Continue)
The updated salesTransaction table where the total_price column has changed as shown in above
figure 5.11.
64
PROCEDURE spGetGift:
The purpose of this trigger is to determine which gift that the customer is to be offered.If the
purchase is greater than rs7000,then the customer is offered a watch.Else,he/she is offered a gift
voucher card.
As shown in the following table,when we insert the transaction ID (tId),we can see the type of gift
that the customer is offered depending on the sale price.
65
TRIGGER
A trigger named trg_updStocks is added to update the remaining stock value in the Inventory after
a sale process.This means that the quantity of product sold in the salesTransaction table is
subtracted from the remaining stock column in the Inventory (kudvenkat, 2012).
66
5.1.2 Purchase system
Creating table product and inserting its values:
67
Creating table Inventory which will store details about the stock:
68
Creating table StockPurchase which will store details about orders made to the supplier:
69
Creating a stored procedure and a cursor to check the inventory and provide information where
product need to be restocked (kudvenkat, 2020):
Figure 5. 18 Procedure and cursor with output showing items that should be restocked
70
Creating a trigger to update table Inventory column name remainingStock taking the values of
prodQuantity from table StockPurchase (kudvenkat, 2012) :
Figure 5. 19 Trigger and output showing table inventory being updated after a purchase from the
supplier
use prodDetails
71
BudgetLevelStock int,
Constraint fkprod Foreign key (prodId) references products(prodId));
select *
from products
select *
from ShopInventory
72
Figure 5. 20 Table product
Here (for this business process) the column BudgeStockLevel was not required to be used in any
circumstances, this is why it was declared 0 everywhere.
UPDATE products
SET price = 2000
WHERE prodName = 'Jean';
73
Figure 5. 22 Basic update from table product
Trigger:
1. When inserting a new product with all its details in the database, it also inserts the data in
the concerned table (here ShopInventory) which qualifies as the inventory of the shop
(kudvenkat, 2012).
ON products
AFTER INSERT AS
BEGIN
DECLARE @ID CHAR(10)
DECLARE @full Varchar(20)
SET @ID = (SELECT TOP 1 products.prodId FROM products ORDER BY prodId DESC)
SET @full = (SELECT TOP 1 products.quantity FROM products ORDER BY products.prodId
DESC)
INSERT ShopInventory
VALUES (@ID, @full,null)
END
74
2. When the user will delete a record, it will automatically remove the deleted records details
in the inventory.
Note: we must remove the foreign key constraint in table ShopInventory to be able to delete a
record. For this we used:
BEGIN
DECLARE @ID CHAR(10)
DECLARE @name Varchar(20)
DECLARE @type Varchar(20)
DECLARE @price Varchar(20)
DECLARE @quantity Varchar(20)
75
3. When the user wants to make an update of any products in the inventory, a simple sql
command will update the database and the following trigger will update the shop’s inventory.
BEGIN
update ShopInventory
SET Stock = @quantity,
prodId = @ID
where prodId = @ID
END
76
5.1.4 Payroll system
Creating table Employee and inserting its values:
77
Creating the table salary details which will store the details concerning the salary for each
employee:
78
Creating a stored procedure and a cursor to calculate the hours worked and the employee salary
for each employee (kudvenkat, 2020) (Sharma, 2018):
79
Figure 5. 28 Cursor to calculate the values in every row
Figure 5. 29 Output of table salaryDetail from running the cursor and procedure
80
Creating a trigger to update table employee column eSalary detail by taking the value of Esalary
from table salaryDetail (kudvenkat, 2012)
Figure 5. 30 Trigger to take the latest value of eSalary from table salaryDetail to update table employee
Figure 5. 32 Function to display the details Total Salary and Number of working days for an employee
81
5.1.5 Inventory System
82
Creating table Inventory
83
Procedure specifying the products that are out of stock and by how much is needed to be restocked
to reach budgetStockLevel (kudvenkat, 2020)
84
Figure 5. 38 Outputs for the Inventory System checking product by product
Figure 5. 39 Procedure and cursor for Inventory System showing stock level for all products at once
85
Figure 5. 40 Output checkStockForAll
86
Chapter 6 User Testing
6.1 White Box testing the code
6.1.1 Sale system
The following trasactions have been recorded:
87
Figure 6. 3 Output of updated table Inventory
88
6.1.2 Purchase system
The manager has restocked the product quantity as shown below:
89
6.1.3 Product system
i)
Figure 6. 5 User testing the product system to add a new product automatically update table inventory
We notice here a product being added using the INSERT command in the table product. The ID
and quantity are automatically entered in the table ShopInventory acting as the inventory of the
shop.
90
ii)
Figure 6. 6 User testing product system to delete an existing product automatically update table inventory
It shows that product bearing ID P1245 was deleted from the table products as well as in table
ShopInventory as per the trigger.
91
iii)
update products
set quantity = 25
where prodName = 'Shirt' and price = 350
Figure 6. 7 User testing product system to modify an existing product automatically update table
inventory
We see that ‘Shirt’ of price ‘350’ had ID P0012, so quantity in table products changed to 25 as per
the query but also changed the stock to 25 in table ShopInventory keeping it updated.
92
6.1.4 Payroll system
The manager is keeping track of the employee salaries for some days having different time ins and
time outs:
Figure 6. 8 User testing payroll system by adding different days of coming to work
93
Table salaryDetail is updated as follows and it showing us the different hoursWorked per day and
their daily salary (Esalary):
Table Employee is update as follows, showing the salary of the latest day for each employee:
Figure 6. 10 Updated table employee showing the latest daily salary according to hoursWorked
94
The manager can also keep track of the total salary and the number of days present at work for
each employee:
Figure 6. 11 Output showing total salary and number of presences for a selected employee
Figure 6. 12 The owner was briefed about how to use the system
95
Figure 6. 13 The Owner using the system
96
Chapter 7 Summary
7.1 Brief explanation on how we tackled the process
This system is one that is for a retail shop (Saba Fashion) which is a clothing shop selling different
types of clothes, its own ordering and delivery methods as per the shop’s policy. To these facts we
had to consider the following factors that would directly affect our model choice of business and
ultimately our system:
After taking all these elements into consideration we started building our system for the shop.
Based on an Agile methodology that promotes collaboration, we started by analyzing the different
components and tools needed to create the system in its whole. Following was the hardest part, we
had to settle on a fix and permanent method about the coding and testing process. Once this was
completed, we started coding the software and creating appropriate infrastructures (Database) that
would accompany it. After that we had to compile all the code and testing was the next step.
Following the tests, we located some logical and runtime errors which we corrected right away.
97
• Finalize everything in a video conference
98
Chapter 8 References
kudvenkat, 2012. DML Triggers - Part 43. [Online]
Available at: Csharp-video-tutorials.blogspot.com. Available at: https://csharp-video-
tutorials.blogspot.com/2012/09/dml-triggers-part-43.html
[Accessed 7 April 2020].
UPDATE, O., 2020. Oracle PL/SQL WHERE CURRENT OF & FOR UPDATE. [Online]
Available at: https://sql-plsql.blogspot.com/2007/05/oracle-plsql-where-current-of-for.html?m=0
[Accessed 1 April 2020].
99
Chapter 9 Appendix
9.1 Meeting one
Date: 6th March 2020
Time: 9hr
Members Present:
• The team met to decide on the business processes that the company needed and everyone
was allocated a specific business process to work on.
• The project was planned in a way so that the team could tackle any difficulties
Proof of meeting 1:
100
9.2 Meeting two
Date: 11th March 2020
Time: 19hrs
Members Present:
Proof of meeting 2:
101
9.3 Meeting Three
Date: 07th April 2020
Time: 21hrs
Members Present:
Proof of meeting 3:
102
9.4 Meeting Four
Date: 17th April 2020
Time: 20hrs
Members Present:
Proof of meeting 4:
103
9.5 Meeting Five
Date: 18th April
Time: 21hrs
Members Present:
Proof of meeting 5:
104
Figure 9. 6 Company Profile
105
Figure 9. 7 Stocks being delivered to the shopInventory
106