1.1. Background: Chapter One
1.1. Background: Chapter One
1.1. Background: Chapter One
1. Introduction
Our project focuses on the automation of Harmaz buildings materials shop.Our project
will solve problems related to IT aspects of the shop. Our new Application (software) will
help the shop management by providing daily transaction record database and provides
an easily registration of the materials, update of the materials and registering the items or
materials that are taken through loan by the other shops. The new Application (software)
will also help the shop employee to make their work fast, easy and well organized.
1.1.
Background
Harmaz building material shop is located in centre of Mekelle city in Kebele20 which is
called Jubruk and it starts to give service to the society in the mid of 1992. This shop
sales different building materials for organization and individuals with fair amount of
costs. The company buy or brings those building materials from Addis Abeba and sale
them to some building material shops, organizations and to the individual.
complex.
It was time consumes.
It doesn`t show how many materials are left for sale.
The loans are kept in paper, the paper may lost or is not secure
Unable to prepare accurate and clear report.
1.3. Objective
The main objective of this project is to develop a system to make the system easy and
helps to improve the way that was used previously. It is aimed to help the
users/employees do their work effectively. It is also aimed to make the system much
faster than the existing system.
The specific objective of this project is:
1.4.
The proposed system will be used to get the information from the three customers; those
are: the building material shops customers, the individual customer, and the organisation
(governmental or non-governmental) and prepare that data for future use. The current
system in use is manual or paper based system, it is slow and cant provide updated lists
of building items within a reasonable time frame the intentions of the system is to change
the existing system that is manual/paper based in to computerized system. This helps the
organization to provide fast and accurate service it can also be able to protect an
authorized access; registering, updating ,searching and deletion(if needed) of an building
material items and registration, Updating ,searching and deleting( if needed)of the
employs and the building material shop customers information.
2. Proposed System
The new system is designed to solve the problems found in the current system. In the
new system Harmaz building material shop will be automated using OOP.The system can
be able to register new customers, updating customer information and delete customer
information (if needed), and searching customer information. It can be able to prepare
reports as needed. It can be able to add, delete or update user accounts by the
2
administrator. The system uses to register new building materials; it updates when the
material items are sold or new items are added and searches the items that are found in
that shop. It supports credit management. It also helps to perform calculating of the
material price. This proposed system provides fast and easy access to the customers and
to the employers and it will avoid the complexity and wastage of time of the working
process and the customer can get quick access to register and other activities done by the
System.
This proposed system it have several advantages like
It have user friendly interface (the user can use it easily without
difficulty).
It have fast access
It have accurate and clear item storage
2.1.
Functional Requirements
The functional requirements describe the core functionality of the application. This
section includes the data and functional process requirements. It consists of what task the
system should perform, the processes involved, which data should the system holds and
the interfaces with the user. The proposed system has the following
Functionalities:
It registers new items; the items are identified by different methods
such as product number, brand, size etc.
It updates items, when items are sold, the system subtract from the
available items by the number of items that are sold.
It checks for availability of items.
It provides registration form for the individual customers who buy
an item that have warranty for specific items.
It provides loan (credit) form for those building material shops that
have relation with this shop.
2.2.
Non-Functional Requirements
The system that we are going to develop is an interactive, current software
development technologies using Microsoft visual studio 2010 based on objected oriented
3
2.3.
System Models
2.3.1.
Use Cases
Login
Change account setting
add property type
update property type
search property type
registering customers
search customers
update customers details
Figure 1
Figure 2
2. The property actor adds the customer tin number or customer name for search.
3. The property actor asks the system to persist the customer tin number or customer n
ame.
4. The system checks if customer tin number or customer name exist in database.
5. The system display the details from the database
Post-condition:delivered successful message
8. Use case name: Update customer details
Participating Actors: clerk and admin
Purpose:
Preconditions: property actor should login
Flow of events:
1. A property actor asks the system to update the customer details.
2. The property actor adds the customer tin number or customer name.
3. The property actor asks the system to persist the customer tin number or customer na
me.
4. The system checks if customer tin number in database.
5. The system changes the customer details in the database.
6. The system displays success information to the property actor
Actor Description
[This section contains detail description of the actor, see the example below]
10
2.3.2.
11
12
2.3.3.
Class Diagram
13
2.3.4.
Sequence Diagram
Sequence diagrams define the interactions between objects in order toexecute a use case.
Interactions are called messages
Sequence Diagrams are
14
Simple
Powerful
Readable
used to describe interaction sequences
15
16
17
18
19
20
21
22
CHAPTER TWO
1. Introduction
This system Design Document establishes the Database design for the Harmaz building
material shop and transaction management system. It is dominant significance to build
secured Store management system to support easy and fast store materials and reporting.
As it is mentioned in the Requirements Analysis Document, most materials from the
Harmaz building material shop store provide different types of building materials, selling
materials to the customers. Borrowers shop or organization of the materials will be
registered in the credit form. Based on our prior assessment of the Harmaz building
material shop, the above mentioned processes are conducted manually. Therefore, our
team strongly recommends the use of a database which facilitates effective materials and
transaction management system in the Harmaz building material shop. To this effect, the
team will develop materials and transaction management system to solve the problem
stated in required analysis document.
1.1. Purpose
The purpose of this Harmaz building material shopand transaction management system is
to provide a well-organized and fast materials management for Harmaz building material
shop. In previous system (i.e. Manual System) users or store worker has to go to the store
for checking the building material availability on the store. This is time consuming,
expensive and needs much more workers etc. Through this Database, the workers or
managers can easily and effectively manage the materials.
the systems resources. Moreover, the system should be designed to reject invalid user
inputs to ensure the systems robustness for all interacting users.
End user: The system should provide user friendly and self-explanatory graphical user
interface that eases the interaction of the user with the system. In addition, the
navigational schema should be flexible.
Performance:The response time to users request should be tolerable.
24
Application
25
property item
sales
Employ
customers
account
details
Actors
admin
addAccount()
login()
changePassword()
updateAccount()
disableAccount()
enableAccount()
deleteAccount()
resetPassword()
clerk
addPropertDetail()
updatePropoert
updateCustomer()
viewAccount()
login()
viewPropertyDetail
y()
viewCustomer()
changePassword()
s()
viewProperty()
registreEmploy(
updateCustomer()
login()
viewCustomer()
changePassword()
registerPropert
y()
searchProperty(
manag
addPropertDetail()
er
viewProperty()
)
viewProperty()
viewEmployr()
updateEmploy()
deleteEmploy()
26
3. Detailed Design
3.1. Object Design Model
In this section, detailed description will be given for classes that are behind the main
services of AS. The purpose, type, and constraints that should hold on attributes; the
purpose and signature of operations will be discussed. Moreover, the conditions that
should hold before and after an operation invocation will be described.
property item
-PropertyID: int
-propertiName: string
-Propertyprice: float
-quantity: int
-purchasedDate: date
~Property(PropertyID: int
, propertyName: string )
+getPropertNames(): string[]
+viewProperty(propertyID: string):
Attributes
PropertyID: this is ainteger type that holds property id which uniquely identifies
the property.
Propertyprice:this is a float data type that holds the price of the material.
27
Quantity: this is an integer type that holds property code which uniquely identifies
the property.
purchasedDate:this is a date data type that holds the purchased date of the
material.
Operations
Contracts
Invariant: PropertyName, PropertyIDshould not be null.
Precondition:Property(propertyID,) : the property should not exist before the
creation of this object.
-
sales
28
-PropertyID: int
-propertiName: string
-Propertyprice: float
-quantity: int
~Property(PropertyID: int
, propertyName: string )
+getPropertNames(): string[]
+viewProperty(propertyID: string):
Attributes
PropertyID: this is ainteger type that holds property id which uniquely identifies
the property.
Propertyprice:this is a float data type that holds the price of the material.
Quantity: this is an integer type that holds property code which uniquely identifies
the property.
Operations
Contracts
Invariant: PropertyName, PropertyIDshould not be null.
29
customers details
#customer: string
#firstName: string
#lastName: string
#sex:char
#phoneNumber:int
#profession:string
~Customer( customerID: string, firstName: string, lastName: string, profession : string, phoneNumber:int,
sex:int,)
+get customer ( customer ID: string): string
+delete customer ( customer ID: string : string): void
+edit customer ( customer ID: string : string): void
+search customer ( customer ID: string : string)
Attributes
30
lastName: this is a string type that holds the father name of a customer.
Operations
Contracts
Precondition:Person(Customer
ID: string,firstName:
string, lastName: stringsex:char,
Invariant :Customer ID: string,firstName:
string,lastName:
phoneNumber:int,profession:string:
studentobjectshould not
exist.
string,sex:char,phoneNumber:int,prodession:string,string
should
not be null.
Field
Type
material_name
materialid
Unit
unitcost
madein
Purchaseddate
char(20)
char(20)
int(11)
double
char(20)
Date
Field
Type
material_name
materialid
unit
unitcost
totalcost
salesdate
char(20)
char(20)
int(11)
double
double
date
Key
Key
Field
TypeType KeyKey
material_name
materialid
Unit
purchasedcost
Totalcost
Salescost
Purchaseddate
madein
char(20)
char(20)
int(11)
double
double
double
Date
char(20)
Field
32
idno
fname
Lastname
username
Password
char(5)
char(20)
char(20)
char(20)
char(20)
PRI
Field
Type
Key
idno
fname
Lastname
username
Password
char(20)
char(20)
char(20)
char(20)
char(20)
PRI
Field
Type
Key
idno
fname
char(20)
char(20)
PRI
Lastname
username
Password
char(20)
char(20)
char(20)
employeedeletion table
Field
Type
empid
fname
Lname
Sex
Edulevel
Age
Salary
address
Pno
char(20)
char(20)
Char(20)
Char(6)
Char(20)
Int(11)
Double
char(20)
Char(12)
Field
Key
empid
PRI
fname
Lname
Sex
edulevel
Age
Salary
address
Pno
Type
Key
char(20)
char(20)
Char(20)
Char(6)
Char(20)
Int(11)
Double
char(20)
Char(12)
PRI
Chapter three
34
3. System Implementation
3.1 objective of implementation
The objective of implementation is the stage in the project where the theoretical design is
turned into a working system. The implementation phase constructs, install, and operates
the new system. The most crucial stage in achieving a new successful system is that it
will work efficiently and effectively.
35
publicpartialclassForm4 : Form
{
MySqlConnectionssm = newMySqlConnection(@"server=localhost;User
Id=root;database=harmaz");
DataTabledt;
DataSet ds;
MySqlDataAdapter da;
MySqlCommandBuildercb;
public Form4()
{
InitializeComponent();
}
privatevoid linkLabel3_LinkClicked(object sender,
LinkLabelLinkClickedEventArgs e)
{
Form7 j = newForm7();
j.Show();
this.Visible = false;
}
privatevoid button5_Click(object sender, EventArgs e)
{
int unit = Convert.ToInt32(textBox4.Text);
doublepurchasedcost = Convert.ToDouble(textBox5.Text);
doubletotalcost = unit * purchasedcost;
textBox6.Text = totalcost.ToString();
if (comboBox1.Text == "" || comboBox2.Text == "" || textBox4.Text ==
"" || textBox5.Text == "" || textBox6.Text == "" || textBox6.Text == "" ||
textBox7.Text == "" || textBox8.Text == "")
{
MessageBox.Show("fill the data ");
}
37
else
{
MySqlCommand t = newMySqlCommand();
t.CommandType = CommandType.Text;
t.CommandText = "select * from material where
(material_name='" + comboBox1.Text + "'
&&materialid='"+comboBox2.Text+"'
&&madein='"+textBox8.Text+"')";
t.Connection = ssm;
ssm.Open();
MySqlDataReader y;
y = t.ExecuteReader();
if (y.Read())
{
t.CommandText = "update material set unit=unit + '" +
textBox4.Text + "' where (material_name='" + comboBox1.Text+ "'
&&materialid='" + comboBox2.Text + "' )";
MySqlCommand cd = ssm.CreateCommand();
cd.CommandType = CommandType.Text;
cd.Connection = ssm;
cd.CommandText = "Insert into
purchase(material_name,materialid,unit,purchasedcost,totalcost,salesc
ost,purchaseddate,madein)
values(@material_name,@materialid,@unit,@purchasedcost,@totalcos
t,@salescost,@purchaseddate,@madein)";
cd.Parameters.AddWithValue("@material_name", comboBox1.Text);
cd.Parameters.AddWithValue("@materialid", comboBox2.Text);
cd.Parameters.AddWithValue("@unit",
Convert.ToInt32(textBox4.Text));
38
cd.Parameters.AddWithValue("@purchasedcost",
Convert.ToDouble(textBox5.Text));
cd.Parameters.AddWithValue("@totalcost",
Convert.ToDouble(textBox6.Text));
cd.Parameters.AddWithValue("@salescost", textBox7.Text);
cd.Parameters.AddWithValue("@purchaseddate",
dateTimePicker1.Value);
cd.Parameters.AddWithValue("@madein", textBox8.Text);
y.Close();
t.ExecuteNonQuery();
cd.ExecuteNonQuery();
MessageBox.Show("the materials in store is updated");
}
else
{
MySqlCommand c = ssm.CreateCommand();
c.CommandType = CommandType.Text;
c.CommandText = "Insert into
material(material_name,materialid,unit,unitcost,madein,purchaseddate
)
values(@material_name,@materialid,@unit,@unitcost,@madein,@purc
haseddate)";
c.Parameters.AddWithValue("@material_name", comboBox1.Text);
c.Parameters.AddWithValue("@materialid", comboBox2.Text);
c.Parameters.AddWithValue("@unit", Convert.ToInt32(textBox4.Text));
c.Parameters.AddWithValue("@unitcost", textBox7.Text);
c.Parameters.AddWithValue("@madein", textBox8.Text);
c.Parameters.AddWithValue("@purchaseddate",
dateTimePicker1.Value);
MySqlCommand cd = ssm.CreateCommand();
cd.CommandType = CommandType.Text;
39
textBox5.Clear();
textBox6.Clear();
textBox7.Clear();
textBox7.Clear();
}
privatevoid button3_Click(object sender, EventArgs e)
{
ssm.Open();
DataSet h = newDataSet();
DataTable f = newDataTable();
h.Tables.Add(f);
MySqlDataAdapterabc = newMySqlDataAdapter("select * from
purchase ",
ssm);
abc.Fill(f);
dataGridView1.DataSource = f.DefaultView;
dataGridView1.Enabled = true;
ssm.Close();
}
privatevoid button4_Click(object sender, EventArgs e)
{
if (comboBox1.Text == ""|| comboBox2.Text =="")
{
MessageBox.Show("fill the material name and its identification");
}
else
{
MySqlCommandcmd = newMySqlCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from purchase where
(material_name='" + comboBox1.Text + "'&&materialid='"+
comboBox2.Text +"')";
41
cmd.Connection = ssm;
ssm.Open();
MySqlDataReader y;
y = cmd.ExecuteReader();
if (y.Read())
{
MySqlCommand c = newMySqlCommand();
c.CommandType = CommandType.Text;
c.CommandText = "select * from purchase where (material_name='" +
comboBox1.Text + "'&&materialid='"+ comboBox2.Text +"')";
c.Connection = ssm;
y.Read();
comboBox1.Text = y[0].ToString();
comboBox2.Text = y[1].ToString();
textBox4.Text = y[2].ToString();
textBox5.Text = y[3].ToString();
textBox6.Text = y[4].ToString();
textBox7.Text = y[5].ToString();
dateTimePicker1.Text = y[6].ToString();
textBox8.Text = y[7].ToString();
y.Close();
}
else
MessageBox.Show("the name of the material you entered doesn't
exist");
ssm.Close();
}
}
privatevoid comboBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar))
42
{
e.Handled = false;
}
elseif (char.IsWhiteSpace(e.KeyChar))
{
e.Handled = false;
}
elseif (char.IsControl(e.KeyChar))
{
e.Handled = false;
}
else
{
e.Handled = true;
MessageBox.Show("only letter is allowed");
}
}
privatevoid comboBox2_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetterOrDigit(e.KeyChar))
{
e.Handled = false;
}
elseif (char.IsWhiteSpace(e.KeyChar))
{
e.Handled = false;
}
elseif (char.IsControl(e.KeyChar))
{
e.Handled = false;
43
}
else
{
e.Handled = true;
MessageBox.Show("only letter and/or number is allowed");
}
}
privatevoid textBox4_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsNumber(e.KeyChar))
{
e.Handled = false;
}
elseif (char.IsControl(e.KeyChar))
{
e.Handled = false;
}
else
{
e.Handled = true;
MessageBox.Show("only nubmber is allowed ");
}
}
privatevoid textBox5_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsNumber(e.KeyChar))
{
e.Handled = false;
}
elseif (char.IsPunctuation(e.KeyChar))
{
44
e.Handled = false;
}
elseif (char.IsControl(e.KeyChar))
{
e.Handled = false;
}
else
{
e.Handled = true;
MessageBox.Show("only nubmber and dot is allowed ");
}
}
privatevoid textBox6_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsNumber(e.KeyChar))
{
e.Handled = false;
}
elseif (char.IsPunctuation(e.KeyChar))
{
e.Handled = false;
}
elseif (char.IsControl(e.KeyChar))
{
e.Handled = false;
}
else
{
e.Handled = true;
MessageBox.Show("only nubmber is allowed ");
45
}
}
privatevoid textBox7_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsNumber(e.KeyChar))
{
e.Handled = false;
}
elseif (char.IsPunctuation(e.KeyChar))
{
e.Handled = false;
}
elseif (char.IsControl(e.KeyChar))
{
e.Handled = false;
}
else
{
e.Handled = true;
MessageBox.Show("only nubmber and dot is allowed ");
}
}
privatevoid textBox8_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar))
{
e.Handled = false;
}
elseif (char.IsWhiteSpace(e.KeyChar))
{
e.Handled = false;
46
}
elseif (char.IsControl(e.KeyChar))
{
e.Handled = false;
}
else
{
e.Handled = true;
MessageBox.Show("only letter is allowed");
}
}
privatevoid comboBox1_MouseClick(object sender, MouseEventArgs e)
{
comboBox1.Items.Clear();
ssm.Open();
da = newMySqlDataAdapter("SELECT * FROM material", ssm);
cb = newMySqlCommandBuilder(da);
ds = newDataSet();
da.Fill(ds);
dt = ds.Tables[0];
ssm.Close();
for (intcurRecord = 0; curRecord<dt.Rows.Count; curRecord++)
{
comboBox1.Items.Add(dt.Rows[curRecord]["material_name"]);
}
}
privatevoid comboBox2_MouseClick(object sender, MouseEventArgs e)
{
comboBox2.Items.Clear();
ssm.Open();
da = newMySqlDataAdapter("SELECT * FROM material", ssm);
47
cb = newMySqlCommandBuilder(da);
ds = newDataSet();
da.Fill(ds);
dt = ds.Tables[0];
ssm.Close();
for (intcurRecord = 0; curRecord<dt.Rows.Count; curRecord++)
{
comboBox2.Items.Add(dt.Rows[curRecord]["materialid"]);
}
}
}
}
Chapter Four
4. System Testing
48
4.1. Introduction
Testing is the basic part of every system. Since it is the basic part of our application, we
try to test individual forms as well as the whole system. This process involves any
activity aimed at evaluating an attribute of form, or capability of application and
determined that it meets its intended objectives. In short, it is the execution of the system
to see its capability and effectiveness. Our main objective in this phase is finding errors
and correcting them.
Generally, the objective of testing is confirming that the system satisfying its
requirement. There are different types of testing like unit testing, integration testing,
system testing and acceptance.
4.2 Unit testing
We have to test each subsystem individually whether it meets the requirement
functionality or not within the group. If any error happens we would try to solve it until
the system meets the required goal. Each of individual form accepts the valid input and
gives the expected output. Each and every procedure on the system is tested to be flexible
and produce exact output to achieve the exact objective of the proposed system.
4.3 Application Related services
There are different privileges like clerk, manager and admin so each privilege can
access their own page only.
4.4 Functionality Testing
During this testing each and every individual module has been test to ensure that they
have meets the requirement operation by taking input different kinds of data, and also we
have checked that valid input is entered or not.
4.5 Error Handling
In our project we have used key press method in order to handle errors by displaying the
message alert when inappropriate input in used.
Inappropriate input
System response
Empty Control
49
Error during entering some detail information without fulfilment of all data record is
handled in message alert.
Empty Box
Trying to save information without filling the
System response
Please enter the data
data
Sample code for checking empty control for selling materials
if (comboBox1.Text == "" ||comboBox2.Text == "" || textBox3.Text ==
"" ||
comboBox3.Text=="")
{
{
e.Handled = false;
}
else
{
e.Handled = true;
MessageBox.Show("only nubmber is allowed ");
}
}
52
Chapter Five
5. Group Members responsibilities
53
Name
Mekdes Abate
ID_NO
0086/03
Organization
MU
Responsibility
Requirement
Analysis
Ruhama hailu
Tanawork ayelign
Temesgen Meressa
0110/03
0124/03
0126/03
6 Glossary
54
MU
document
System design
MU
MU
document
Testing
Implementation
55