Sei sulla pagina 1di 72

Cosmetic Inventory Control System

By

Danish Munawar

Registration#: 2016-GCUF-012047

Tasawar Ali

Registration#: 2016-GCUF-010732

Aqsa Maqbool

Registration#:2016-GCUF-012072

Project submitted in partial fulfillment

of the requirements for the degree of

ASSOCIATE DEGREE

IN

COMPUTER SCIENCE

UNIVERSITY COMMUNITY COLLEGE

GC UNIVERSITY, FAISALABAD

1
2
DECLARATION
This project, a hard work, is carried out by Danish Munawar, Tasawar Ali and Aqsa
Maqbool under the supervision of Mr. Muhammad Usman and Mr. Muhammad Rauf (Senior
lecturers) at UCC GC University, Faisalabad, Pakistan. We feel please to declare that the
“Hayan Traders Inventory Control System” and contents of this project is the pr5oductive
result of our hardworking, studies and research and no part of this is copied from any published
source. This work has been conducted under the practical atmosphere of our studies not for the
award of any other degree / diploma. The University may take action if the information provided
is found guilty at any stage.

Signature of Students

Danish Munawar

Registration#:2016-GCUF-012047

Tasawar Ali

Registration#:2016-GCUF-010732
Aqsa Maqbool
Registration#:2016-GCUF-012072

3
Dedication
At this Moment of joy, we dedicate our hardworking to our beloved Parents, other family
members and friends who encourage us and give us timely support in different ways. We further
dedicate it to our honorable teachers, who played an important role in entire period of learning in
the College, especially to Mr. Muhammad Usman, Mr. Muhammad Rauf and Ma'am Arbab
Kanwal, who encourage us with their broadness in the field and gave us innovative ideas for
successful completion of our project.

Danish Munawar
Registration#: 2016-GCUF-012047
Roll # 43608
Tasawar Ali
Registration#: 2016-GCUF-010732
Roll # 43627
Aqsa Maqbool
Registration#: 2016-GCUF-012072
Roll # 43636

4
ACKNOWLEDGEMENTS
Bowing our head to almighty ALLAH , who is the most merciful and giving all honor to the
Holy Prophet (PBUH) as the model and beacon of light for all the mankind. Prior to anyone
Else, all gratitude and praises are due to the almighty Allah, who gave us health and capacitance
to achieve this goal.

We would like to express our deepest appreciation to our Supervisor, Mr. Muhammad Usman,
Department of Computer Science, University Community College, GC University, Faisalabad,
who always guided us and gave us moral support in every step of our degree program as well as
our project.

We would like to express our deepest appreciation to our Mr. Muhammad Rauf, Lecturer, At
Department of Computer Science, University Community College, GC University Faisalabad,
who also guided us and gave us moral support in every step of our degree program as well as our
project.

We would also like to thank Ms. Arbab Kanwal (Lecturer, Department of Computer Science,
University Community College, GC University Faisalabad), for her constant scholarly guidance,
skillful advice and untiring zeal, which were of immense value for the conduction of this
research work. Her cheerful attitude and warm encouragement always inspired us to work hard
to achieve goal of obtaining degree.

We are immensely grateful to Dr. Nadeem Sohail (Principal, University Community College,
GC University Faisalabad) for providing us conductive environment to complete our project
successfully.

We would not be doing justice without acknowledging the invaluable moral support and
constant encouragement provided to us by our affectionate parents.
Danish Munawar
Roll#:43608
Tasawar Ali
Roll#:43627
Aqsa Maqbool
Roll#:43636

5
To
The Controller of Examinations,
Government College University,
Faisalabad
I, the Supervisor, certifies that the contents and form of the project submitted by
Danish Munawar (43608)
Tasawar Ali (43627)
Aqsa Maqbool (43636)

have been found satisfactory for the award of the degree.

Internal Examiner:

Name: Ms.Arbab Kankal

Signature:

Lecturer: University Community College (Government College University


Faisalabad)

Department of Computer Science

External Examiner:

Name:

Signature:

Lecturer:

Abstract

6
Our Project “Pharmacy Management System” is a complete work flow management system,
designed to improve accuracy, safety and efficiency. The purpose of this Proposal is to provide a
detailed overview of our software product “HAYAN TRADERS (Distributor of Cosmetic)
Advanced Inventory Control System”. Main objective is to good interaction & communication
facilities between buyer and seller and user-friendly system. Inventory system has been design to
manage cosmetics task.

It manages stock report, selling report and also employees’ salary and other detail.
Administrator manages stock information more efficiently. Also the purpose of this project is to
use the advance and modern technology for rapid analysis with the help of Barcode Scanner.At
the front-end we have used C# .NET and at the back-end MS Access Database.

Some Silent Features Are:

 Secure registration and profile management facilities for employees.


 Purchase, Return, Sale, and Also Used Barcode.
 Adequate searching mechanisms for easy and quick access to particular products and
Service.

7
Table of Contents
Chapter -1 .............................................................................................................................................. 15
SOFTWARE REQUIREMENT SPECIFICATION ........................................................................................... 15
1.1 Introduction ................................................................................................................................... 1
1.2 Stakeholders .................................................................................................................................. 2
1.3 Users of the system.................................................................................................................. 2
1.4 Product Functions ........................................................................... Error! Bookmark not defined.
1.5 Administrators .......................................................................... Error! Bookmark not defined.
1.6 Document Purpose........................................................................ Error! Bookmark not defined.
1.7 Product Scope ................................................................................. Error! Bookmark not defined.
1.8 Project Planning .............................................................................. Error! Bookmark not defined.
1.8.1 Project Module Architecture ................................................... Error! Bookmark not defined.
1.8.2 Sale Purchase Module (Inventory) ........................................... Error! Bookmark not defined.
1.8.3 Billing Counter Part (Receipt Generation) ............................... Error! Bookmark not defined.
1.8.4 GSM Device & SMS Notification .............................................. Error! Bookmark not defined.
1.8.5 Payroll System .......................................................................... Error! Bookmark not defined.
1.8.6 Assumptions and Dependencies .............................................. Error! Bookmark not defined.
1.9 Risk Management ....................................................................... Error! Bookmark not defined.
1.10 System Requirement Specifications......................................................................................... 3
1.10.1 Functional Requirements ...................................................................................................... 3
1.10.1.1 Assign ID ............................................................................................................................. 3
1.10.1.2 Delete Employee ID............................................................................................................ 3
1.10.1.3 Built-in salary vouchers ...................................................................................................... 3
1.10.1.4 Behaviour Requirements .................................................... Error! Bookmark not defined.
1.10.2 Non-Functional Requirements ............................................................................................. 3
1.11 Safety and Security requirements................................................. Error! Bookmark not defined.
Technical Feasibility ............................................................................. Error! Bookmark not defined.
Chapter-2 ................................................................................................................................................. 7
Analysis .................................................................................................................................................... 7
2.1 Use Case Model (Admin) ................................................................................................................ 8
Figure2.1: Use Case Model (Admin) .................................................................................................... 8
2.2 Use Case Model (Registered User)................................................................................................. 9
2.3 Description of Admin Use Case in Fully Dressed Format ............................................................. 10

8
2.4 Description of Registered user, Use Case in Fully Dressed Format ............................................. 13
2.5 System Architectural Design ........................................................................................................ 15
2.6 Software sequence diagram ........................................................................................................ 15
2.6.1 SSD_01 of Add new Employees ............................................................................................ 15
2.6.2 SSD_02 of Delete Employees ................................................................................................ 15
2.6.3 SSD_03 of Modify Employees ............................................................................................... 16
2.6.4 SSD_04 of View Employees ................................................................................................... 16
2.6.5 SSD_05 of Add Product ......................................................................................................... 17
2.6.6 SSD_06 of Delete Product ..................................................................................................... 17
2.6.7 SSD_07 of Modify Product .................................................................................................. 18
2.6.8 SSD_08 of View Product........................................................................................................ 18
2.6.9 SSD_09 of Sale Order ............................................................... Error! Bookmark not defined.
2.6.10 SSD_10 of Delete Sale Order...................................................... Error! Bookmark not defined.
2.6.11 SSD_11 of Modify Sale Order ................................................. Error! Bookmark not defined.
2.6.12 SSD_12 of Print Sale Order..................................................... Error! Bookmark not defined.
2.6.13 SSD_13 of Report Sale Order ................................................. Error! Bookmark not defined.
2.6.14 SSD_14 of View Sale Order .................................................... Error! Bookmark not defined.
2.6.15 SSD_15 of Purchase Order ..................................................... Error! Bookmark not defined.
2.6.17 SSD_17 of Modify Purchase Order......................................... Error! Bookmark not defined.
2.6.18 SSD_18 of Print Purchase Order ............................................ Error! Bookmark not defined.
2.6.19 SSD_19 of Reports Purchase Order........................................ Error! Bookmark not defined.
2.6.20 SSD_20 of View Purchase Order ............................................ Error! Bookmark not defined.
2.6.21 SSD_21 of Create Stock Transfer ........................................... Error! Bookmark not defined.
2.6.22 SSD_22 of Delete Stock Transfer............................................ Error! Bookmark not defined.
2.6.23 SSD_23 of Modify Stock Transfer........................................... Error! Bookmark not defined.
2.6.24 SSD_24 of View Stock Transfer .............................................. Error! Bookmark not defined.
2.6.25 SSD_25 of Reports Stock Transfer.......................................... Error! Bookmark not defined.
2.6.26 SSD_26 of Create Salary ......................................................... Error! Bookmark not defined.
2.6.27 SSD_27 of Create Cash Payment Vouchers............................ Error! Bookmark not defined.
2.6.28 SSD_28 of Delete Cash Payment Vouchers ............................ Error! Bookmark not defined.
2.6.28 SSD_29 of Modify Cash Payment Vouchers ........................... Error! Bookmark not defined.
2.6.30 SSD_30 of View Cash Payment Vouchers .............................. Error! Bookmark not defined.
2.6.31 SSD_31 of Print Cash Payment Vouchers............................... Error! Bookmark not defined.

9
2.6.32 SSD_32 of Reports Cash Payment Vouchers.......................... Error! Bookmark not defined.
2.6.33 SSD_33 of Create Cash Received Vouchers ........................... Error! Bookmark not defined.
2.6.34 SSD_24 of Delete Cash Received Vouchers ........................... Error! Bookmark not defined.
2.6.35 SSD_35 of Modify Cash Received Vouchers........................... Error! Bookmark not defined.
2.6.36 SSD_36 of View Cash Received Voucher................................ Error! Bookmark not defined.
2.6.37 SSD_37 of Print Cash Received Vouchers .............................. Error! Bookmark not defined.
2.6.38 SSD_38 of Reports Cash Received Vouchers ......................... Error! Bookmark not defined.
2.6.39 SSD_39 of Login...................................................................... Error! Bookmark not defined.
2.6.40 SSD_40 of Change Password .................................................. Error! Bookmark not defined.
Chapter-1 .................................................................................................. Error! Bookmark not defined.
Design........................................................................................................ Error! Bookmark not defined.
3.1 Design Class Diagram ................................................................................................................... 21
Case Login ........................................................................................ Error! Bookmark not defined.
Use Case of Add Product .................................................................. Error! Bookmark not defined.
Use Case Delete Product ................................................................... Error! Bookmark not defined.
Use Case Delete Product ................................................................... Error! Bookmark not defined.
Use Case View Product..................................................................... Error! Bookmark not defined.
Use Case Add Employee................................................................... Error! Bookmark not defined.
Use Case Delete Employee ............................................................... Error! Bookmark not defined.
Use Case Modify Employee ............................................................. Error! Bookmark not defined.
Use Case View Employee ................................................................. Error! Bookmark not defined.
Use Case Create Ledger Accounts .................................................... Error! Bookmark not defined.
Use Case Delete Ledger Accounts .................................................... Error! Bookmark not defined.
Use Case Modify Ledger Accounts .................................................. Error! Bookmark not defined.
Use Case View Ledger Accounts...................................................... Error! Bookmark not defined.
Use Case View Ledger Accounts...................................................... Error! Bookmark not defined.
Use Case Generate Salary Slip.......................................................... Error! Bookmark not defined.
Use Case Create Sale ........................................................................ Error! Bookmark not defined.
Use Case Delete Sale ........................................................................ Error! Bookmark not defined.
Use Case Modify Sales ..................................................................... Error! Bookmark not defined.
Use Case Generate Bill Sale ............................................................. Error! Bookmark not defined.
Use Case Create Purchase ................................................................. Error! Bookmark not defined.
Use Case Delete Purchase ................................................................. Error! Bookmark not defined.

10
Use Case Modify Purchase ............................................................... Error! Bookmark not defined.
Use Case Create Stock Transfer........................................................ Error! Bookmark not defined.
Use Case Delete Stock Transfer........................................................ Error! Bookmark not defined.
Use Case Modify Stock Transfer ...................................................... Error! Bookmark not defined.
Use Case Stock transfer Report ........................................................ Error! Bookmark not defined.
Use Case Change Password .............................................................. Error! Bookmark not defined.
Use Case Account Log out................................................................ Error! Bookmark not defined.

11
List of Table
Table 1.1: Admin Login 4
Table 1.2: User Login 4
Table 1.3: Change Username, Password 5
Table 1.4: Cosmetic product Stock 5
Table 1.5: Sales Log 6
Table 1.6: Print Receipt 6
Figure2.2: Use Case Model (registered user) 9
Table 2.1: Admin Login 10
Table 2.2: Change Username, Password 11
Table 2.3: Employee Salary 12
Table 2.4: User Login 14
Table 2.5: Print Receipt 14
Figure 3.1: Design Class Diagram 21
Figure 3.2: ER Diagram 22

12
13
14
Chapter -1

SOFTWARE REQUIREMENT SPECIFICATION

15
16
17
18
19
20
21
1
1.1 Introduction
This document is the design report for a “Advanced Inventory Control System”. This is mainly
about ‘how to do and also will help provide an insight to the whole system design and
implementation of 5the Cosmetic store.

The project Advanced Inventory Control System includes registration of Employees/admin,


storing their details into the system, and also computerized billing/wage/Stock system in the
Advanced Inventory Control System Software. The software has the facility to give a unique id
for every person and stores the details of every person that firstly entered by the Database
Administrator and the Employees automatically.

From the SMS notification system owner can receive a report of every transaction on cell phone
at home or everywhere. It is accessible either by an administrator or owner. Only they can check
SMS notification. The SMS can send easily by check/mark the “SEND SMS” button. The
interface is very user-friendly as well as based on Advance GUI like Windows 8 & 10
dashboard. The data are well protected for personal use and makes the data processing very fast.

The purpose of the project is to computerize the front office management of “The Store of
Cosmetic Control System” to develop software which is user friendly, simple, fast, and cost –
effective.

It deals with the collection of Employees information, inventory, payroll, Reports and built in
salary Voucher’s, Cash Payment Vouchers, Cash received Vouchers etc. Traditionally, it was
5done manually. The main function of the system is to Receive SMS Notification for the owner
who can check their transaction by SMS at anywhere and when required, and also to manipulate
these details meaningfully System input contains Bar Code reader, missing details, salary details,
especially the specific personal SMS Notification with the help of GSM Module device; while
system output is to get these details on to the LED/Quantum Dot screens.

1
This software has the following main components:
Implement the different types of user – Administrator, Employees

1. Implementation of the GSM Module Device from SMS Notification.

2. Management of Products and Orders.

This design document mainly consists of Block Diagram, Activity, Flow Diagrams, Internal Data
Structures, Architectural design, User Interface and Testing.

The main purposes of this design document are listed below.

 Precise understanding of the requirements and constraints related with the programming
language and user interface.
 System decomposition into manageable units or modules
 Abstraction of the system implementation with the help of classes
 Provide a basic outline of the User Interface of the Store Cosmetics Control System.

This report is the result of the design phase. The class diagrams and activity provide a schematic
representation of the various classes used and design flow respectively. The diagrams were
prepared using The Consolidated Activity diagram provides a model to visualize the flow in the
system as a whole. The class diagrams also hold the data structures that would be used and also
their data types.

The Distributor will be implemented using C# as the programming language. MySQL server
database will be used to store vital user, product and order information.

1.2 Stakeholders
1.2.1 Owner of the Shop or Admin
1.2.2 User or Employee

Users of the system


1.3.1 Administrator

2
1.3.2 Registered User (Employee)

1.3 System Requirement Specifications

1.3.1 Functional Requirements


Registration:

1.3.1.1 Assign ID
The BMVS will allow DB administrator to provide ID to the new Employee.

1.3.1.2 Delete Employee ID


The administrative staff in the office shall be allowed to delete the ID of the user.

1.3.1.3 Built-in salary vouchers


The BMVS will also provide them the built-in salary vouchers

1.3.2 Non-Functional Requirements


Non-Functional Requirements are defined as below:

 Response Time:

The system shall give responses in 3 second.

 Capacity:

The System must support many people at a time.

 User-interface:

The user-interface screen shall respond within 2 seconds.

 Conformity:

The systems must conform to the Microsoft Accessibility

3
Requirement Name: Admin Login

Requirement #: Req01 Requirement Type: Functional

This requirement enables admin to login into the main panel or system.
Description: For login Admin should have username and password which allowed by
owner of the Cosmetic Shop.

Rationale: To login in cosmetic Inventory Control system

Originator: Administrator of the system

Fit Criterion: Admin is login in system.

Customer 7 Customer 1
Satisfaction: Dissatisfaction:

Priority: 1 Conflicts: Nil

Supporting Materials: NA

History: NA
Table 1.1: Admin Login

Requirement Name: User Login

Requirement #: Req02 Requirement Type: Functional

This requirement enables Users to login into the specified panel or


Description: system. For login user should have username and password which
allowed by Admin.

Rationale: To login into the system

Originator: Registered User

Fit Criterion: For login into the system.


Table 1.2: User Login

4
Requirement Name: Change Username, Password

Requirement #: Req03 Requirement Type: Functional

This requirement enables admin to change username, password at any


Description:
time, for this purpose admin enter a unique code.

Rationale: To protect from other unrelated persons.

Originator: Administrator

Fit Criterion: For safe login in the system.

Customer 8 Customer 2
Satisfaction: Dissatisfaction:

Priority: 3 Conflicts: Nil

Supporting Materials: NA

History: NILL
Table 1.3: Change Username, Password
Requirement Name: Cosmetic product Stock

Requirement #: Req04 Requirement Type: Functional

This requirement enables Users to check, maintain and modify (only


Description:
admin), the Cosmetic product available and diminishing stock

Rationale: To check status

Originator: Admin/ Registered User

Fit Criterion: while diminishing Cosmetic product stock

Customer 8 Customer 2
Satisfaction: Dissatisfaction:

Priority: 3 Conflicts: Nil


Table 1.4: Cosmetic product Stock

5
Requirement Name: Sales Log

Requirement #: Req05 Requirement Type: Functional

This requirement enables Users to save and check the sale of the day,
Description:
week or month.

Rationale: To check the sales of the Cosmetic product

Originator: Admin / Registered User

Fit Criterion: After every month may be

Customer 7 Customer 3
Satisfaction: Dissatisfaction:

Priority: 3 Conflicts: Nil

Supporting NA
Materials:

History: NILL
Table 1.5: Sales Log
Requirement Name: Print Receipt

Requirement #: Req06 Requirement Type: Functional

This requirement enables Users to save and print prescription form and
Description:
make a hard copy receipt for customers

Rationale: To take print and save

Fit Criterion: When prescription form is completed

Customer 7 Customer 3
Satisfaction: Dissatisfaction:

Priority: 3 Conflicts: Nil


Table 1.6: Print Receipt

6
Chapter-2

Analysis

7
2.1 Use Case Model (Admin)

Figure2.1: Use Case Model (Admin)

8
2.2 Use Case Model (Registered User)

Figure2.2: Use Case Model (registered user)

9
2.3 Description of Admin Use Case in Fully Dressed Format
Use Case Name: Admin Login

UC # 1 Ref: Req. #1

UC Name Admin Login

Level (Abstract or Detailed)

Description This requirement enables admin to login in system.

Actor (s) Administrator

Stakeholders Admin

Preconditions Admin must know his username and Password before login to
the system.

Success Guarantee Admin is successfully login.

Main Success Action Response


Scenario
1. Entered username and
password in form and
press login button or
Enter button

2. Admin is successfully
entered in admin panel

3. System shows the contents


to be changed to the Admin.

Extensions If the username and password is wrong then show error message
according to error.

Special requirements Admin remember his Username and Password.


Table 2.1: Admin Login

10
Use Case Name: Change password

UC # 2 Ref: Req. #2

UC Name Change password

Level (Abstract or Detailed)

Description Admin Change password after some day to protect admin area
from other person

Actor (s) Administrator

Stakeholders Admin

Preconditions Admin is logged in.

Success Guarantee User's password is changed successfully.

Main Success Action Response


Scenario
1.Click to change password area .

2. Show change password


form

3-Admin successfully change


password

Extensions If form not fill correctly show some error message about error.

Special requirements admin username, password.

Frequency of Occure Multiple times in a day


Table 2.2: Change Username, Password

11
Use Case Name: Employee Salary

UC # 3 Ref: Req. #3

UC Name Admin can add and calculate employee’s Salary

Level (Abstract or Detailed)

Description The admin can add, update or delete employ record

Actor (s) Administrator

Stakeholders Admin

Preconditions Admin is login.

Success Guarantee Add successfully, update or delete.

Main Success Action Response


Scenario
1. Click and login admin
account.

2- add, update and delete


records

Extensions If not add, update or delete records show error messages


respectively

Special requirements Admin must be login before this.

Frequency of Update any time


Occurrence
Table 2.3: Employee Salary

12
2.4 Description of Registered user, Use Case in Fully Dressed Format
2.4.1 Use Case Name: User Login

UC # 1 Ref: Req. #1

UC Name User Login

Level (Abstract or Detailed)

Description This requirement enables User to login in system.

Actor (s) User

Stakeholders User

Preconditions User must remember his username and Password which provide
in registration form

Success Guarantee User is successfully logged in.

Main Success Action Response


Scenario
1. Entered username and
password in form and
press login button

2. user is successfully entered


in welcome page

3- System shows the first


information form

Extensions If the username and password is wrong than return into login
page, and show error message

Special requirements User remembers his Username and Password.

Frequency of Login to the User Panel Multiple times in a day.


Occurrence

13
Table 2.4: User Login

2.4.2 Use Case Name: Print Receipt

UC # 2 Ref: Req. #2

UC Name Print Receipt

Level (Abstract or Detailed)

Description This requirement enables Users to save and print the receipt of
Sales

Actor (s) User

Stakeholders Admin/Users

Preconditions Registered user is login

Success Guarantee If login successful

Main Success Scenario Action Response

1. Add sales to the


prescription form and print it

2. Sales added

3- Print the receipt

Extensions If something went wrong, system respond accordingly.

Special requirements User must add stocks

Frequency of Login to the User Panel Multiple times in a day and then and
Occurrence stocks and print the receipt
Table 2.5: Print Receipt

14
2.5 System Architectural Design
The Architectural design is the main 'solution phase' of the project because it defines the
software in terms of the major software components and interfaces. It provide us main
detailed framework of the project with the help of models, shapes, diagrams and pictures. It
is very important part of the project shows us the true understanding and the visibility and
the guess of the product is to design

2.6 Software sequence diagram


2.6.1 SSD_01 of Add new Employees

Figure 2.3 SSD of Add new employees

2.6.2 SSD_02 of Delete Employees

Figure 2.4 SSD of Delete employees

15
2.6.3 SSD_03 of Modify Employees

Figure 2.5 SSD of Modify employees

2.6.4 SSD_04 of View Employees

Figure 2.6 SSD of View employees

16
2.6.5 SSD_05 of Add Product

Figure 2.7 SSD of Add Product

2.6.6 SSD_06 of Delete Product

Figure 2.8 SSD of Delete Product

17
2.6.7 SSD_07 of Modify Product

Figure 2.9 SSD of Modify Product

2.6.8 SSD_08 of View Product

Figure 2.10 SSD of View Product

18
19
Chapter-3

Design

20
3.1 Design Class Diagram

Figure 3.1: Design Class Diagram

21
3.2 Entity Relationship Diagram

Figure 3.2: ER Diagram

22
Chapter-4

Implementation

23
4.1 Coding

4.1.1 Login Form


using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Configuration;

using System.Data;

using System.Data.SqlClient;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace HayyanTrader

public partial class frmLogin : Form

string connString =
ConfigurationManager.ConnectionStrings["CosmeticInventory"].ConnectionString;

SqlConnection conn;

SqlDataAdapter objda;

DataSet objds;

int rc;

public frmLogin()

24
InitializeComponent();

private void btnLogin_Click(object sender, EventArgs e)

try

if (txtUserName.Text != "" || txtPassword.Text != "")

using (conn = new SqlConnection(connString))

using (SqlCommand cmd = new SqlCommand("Select * from users where user_Name = '" +
txtUserName.Text + "'", conn))

conn.Open();

objda = new SqlDataAdapter(cmd.CommandText, conn);

objds = new DataSet();

objda.Fill(objds, "users");

rc = objds.Tables["users"].Rows.Count;

//cmd = new SqlCommand("Select * from users where user_Name = '" + txtUserName.Text +


"'", con);

25
//da = new SqlDataAdapter(cmd.CommandText, con);

//ds = new DataSet();

//da.Fill(ds, "users");

//rc = ds.Tables["users"].Rows.Count;

if (rc > 0)

using (conn = new SqlConnection(connString))

using (SqlCommand cmd = new SqlCommand("Select * from users where


user_name = '" + txtUserName.Text + "' and Password = '" + txtPassword.Text + "'", conn))

conn.Open();

objda = new SqlDataAdapter(cmd.CommandText, conn);

objds = new DataSet();

objda.Fill(objds, "users");

rc = objds.Tables["users"].Rows.Count;

if (rc > 0)

Class1.username = txtUserName.Text;

Class1.role = objds.Tables["users"].Rows[0]["Role"].ToString();

frmDashBoard1 frmd = new frmDashBoard1();

26
frmd.Show();

this.Close();

else

MessageBox.Show("Incorrect Password", "Cosmetic", MessageBoxButtons.OKCancel,


MessageBoxIcon.Error);

txtPassword.Clear();

txtPassword.Focus();

else

MessageBox.Show("Incorrect Username & Password", "Cosmetic",


MessageBoxButtons.OKCancel, MessageBoxIcon.Error);

txtPassword.Clear();

txtUserName.Clear();

txtUserName.Focus();

else

MessageBox.Show("Please enter Username/Password", "Cosmetic",


MessageBoxButtons.OKCancel, MessageBoxIcon.Error);

if (txtUserName.Text == "")

27
{

txtUserName.Focus();

if (txtPassword.Text == "")

txtPassword.Focus();

catch (Exception ex)

MessageBox.Show(ex.Message);

private void txtUserName_KeyPress(object sender, KeyPressEventArgs e)

if (e.KeyChar == (char)Keys.Enter)

txtPassword.Focus();

private void txtPassword_KeyPress(object sender, KeyPressEventArgs e)

28
if (e.KeyChar == (char)Keys.Enter)

btnLogin.PerformClick();

5private void frmLogin_Load(object sender, EventArgs e)

txtUserName.Focus();

Pr5ivate void btnClear_Click(object sender, EventArgs e)

txtPassword.Clear();

txtUserName.Clear();

txtUserName.Focus();

5private void frmLogin_FormClosing(object sender, FormClosingEventArgs e)

29
Private void button1_Click(object sender, EventArgs e)

Application.Exit();

4.1.2 Stock Opening


using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Configuration;

using System.Data;

using System.Data.SqlClient;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace HayyanTrader

public partial class frmOpeningStock : Form

private List<OpeningStock> SalingCart = new List<OpeningStock>();

private DataTable dt;

public bool IsUpdate { get; set; }

30
conn = new SqlConnection(connString))

SqlCommand cmd = new SqlCommand("Select Doc_Id=Max(Doc_Id)+1 From SalePurchaseDT


where Doc_Type='Opening Stock'", conn);

conn.Open();

SqlCommand cmd = new SqlCommand("select Sum(Stock_Qty) as 'Qty' from [SalePurchaseDT]


where Product_Id=@Idproduct And Location_Id=@Idlocation group by Product_Id order by Product_Id",
conn);

conn.Open();

cmd.Parameters.AddWithValue("@Idproduct", productId);

cmd.Parameters.AddWithValue("@Idlocation", locationId);

SqlDataReader Reader = cmd.ExecuteReader();

Dt.Load(Reader);

return Dt;

private void txtPcs_TextChanged(object sender, EventArgs e)

if (txtPacking.Text != "0" && txtPacking.Text != "")

if (txtPcs.Text != "")

31
{

txtTotalQty.Text = (Convert.ToDouble(txtPacking.Text) *
Convert.ToDouble(txtPcs.Text)).ToString();

else

txtTotalQty.Text = "0";

if (txtPacking.Text == "0" || txtPacking.Text == "")

if (txtPcs.Text != "")

txtTotalQty.Text = (1 * Convert.ToDouble(txtPcs.Text)).ToString();

else

txtTotalQty.Text = "0";

private void btnAddProductdgv_Click(object sender, EventArgs e)

if (txtPcs.Text.Trim() == string.Empty)

32
MessageBox.Show("Qty is required ", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

txtPcs.Focus();

return;

bool sameproductalreadyexit = false;

foreach (DataGridViewRow row in dgvOpeningStock.Rows)

//if ()

//{

if (row.Cells["ProductName"].Value == cmbProdName.Text && row.Cells["Location"].Value ==


cmbLocation.Text)

row.Cells["Pcs"].Value = Convert.ToInt16(row.Cells["Pcs"].Value) +
Convert.ToInt16(txtTotalQty.Text);

sameproductalreadyexit = true;

//}

if (sameproductalreadyexit == false)

OpeningStock Item = new OpeningStock

33
serialNo = Convert.ToInt16(txtProductId.Text),

ProductName = cmbProdName.Text.ToString(),

Location = cmbLocation.Text.ToString(),

Packing = txtPacking.Text.Trim(),

Pcs = (this.txtTotalQty.Text == "") ? 0 : Convert.ToInt16(txtTotalQty.Text.Trim()),

LocationId = (this.cmbLocation.SelectedValue == "") ? 0 :


Convert.ToInt16(this.cmbLocation.SelectedValue),

CompanyId=Convert.ToInt16(PD.CompanyId),

CatagoryId=Convert.ToInt16(PD.CatagoryId),

UomId = Convert.ToInt16(PD.UomId)

};

SalingCart.Add(Item);

dgvOpeningStock.DataSource = null;

dgvOpeningStock.DataSource = SalingCart;

//dgvOpeningStock.Columns[5].Visible = false;

dgvOpeningStock.Columns[5].Visible = false;

dgvOpeningStock.Columns[6].Visible = false;

dgvOpeningStock.Columns[7].Visible = false;

dgvOpeningStock.Columns[8].Visible = false;

int TotalPcs = SalingCart.Sum(x => x.Pcs);

txtTotalPcs.Text = TotalPcs.ToString();

34
txtProductId.Clear();

txtPacking.Clear();

txtPcs.Clear();

txtTotalQty.Clear();

txtPacking.Clear();

txtBarcode.Clear();

cmbLocation.SelectedIndex = -1;

cmbProdName.SelectedIndex = -1;

btnDeletedgv.Enabled = false;

btnUpdatedgv.Enabled = false;

btnAddProductdgv.Enabled = true;

txtBarcode.Focus();

private void btnRefreshgdv_Click(object sender, EventArgs e)

txtProductId.Clear();

txtPacking.Clear();

txtPcs.Clear();

txtTotalQty.Clear();

txtPacking.Clear();

txtBarcode.Clear();

35
cmbLocation.SelectedIndex = -1;

cmbProdName.SelectedIndex = -1;

btnDeletedgv.Enabled = false;

btnUpdatedgv.Enabled = false;

btnAddProductdgv.Enabled = true;

txtBarcode.Focus();

private void dgvOpeningStock_DoubleClick(object sender, EventArgs e)

try

int index = dgvOpeningStock.Rows.GetFirstRow(DataGridViewElementStates.Selected);

cmbLocation.Text = dgvOpeningStock.Rows[index].Cells["Location"].Value.ToString();

cmbProdName.Text = dgvOpeningStock.Rows[index].Cells["ProductName"].Value.ToString();

txtProductId.Text = dgvOpeningStock.Rows[index].Cells["serialNo"].Value.ToString();

txtPacking.Text = dgvOpeningStock.Rows[index].Cells["Packing"].Value.ToString();

//txtPcs.Text = dgvPurchaseCartProduct.Rows[index].Cells[""].Value.ToString();

txtTotalQty.Text = dgvOpeningStock.Rows[index].Cells["Pcs"].Value.ToString();

PD.CatagoryId = Convert.ToInt16(dgvOpeningStock.Rows[index].Cells["CatagoryId"].Value);

PD.CompanyId = Convert.ToInt16(dgvOpeningStock.Rows[index].Cells["CompanyId"].Value);

PD.UomId = Convert.ToInt16(dgvOpeningStock.Rows[index].Cells["UomId"].Value);

//for (int i = 0; i <= dgvOpeningStock.Rows.Count - 1; i++)

//{

36
// string connString =
ConfigurationManager.ConnectionStrings["CosmeticInventory"].ConnectionString;

// using (SqlConnection conn = new SqlConnection(connString))

// {

// conn.Open();

// SqlCommand cmd = new SqlCommand("Update Product set [Qty]=[Qty]-@StockQty


where Product_Id=@ProductId", conn);

// cmd.Parameters.AddWithValue("@ProductId",
Convert.ToInt16(dgvOpeningStock.Rows[i].Cells["serialNo"].Value));

// cmd.Parameters.AddWithValue("@StockQty",
Convert.ToInt16(dgvOpeningStock.Rows[i].Cells["Pcs"].Value));

// cmd.ExecuteNonQuery();

// }

// MessageBox.Show("Record Successfull SAVE.... ", "SAVE", MessageBoxButtons.OK,


MessageBoxIcon.Information);

//}

SalingCart.RemoveAt(index);

dgvOpeningStock.DataSource = null;

dgvOpeningStock.DataSource = SalingCart;

dgvOpeningStock.Columns[5].Visible = false;

dgvOpeningStock.Columns[6].Visible = false;

37
dgvOpeningStock.Columns[7].Visible = false;

dgvOpeningStock.Columns[8].Visible = false;

int TotalPcs = SalingCart.Sum(x => x.Pcs);

txtTotalPcs.Text = TotalPcs.ToString();

btnDeletedgv.Enabled = false;

btnUpdatedgv.Enabled = true;

btnAddProductdgv.Enabled = false;

IsUpdate = true;

catch (Exception ex)

MessageBox.Show(ex.Message);

private void dgvOpeningStock_CellClick(object sender, DataGridViewCellEventArgs e)

try

btnDeletedgv.Enabled = true;

btnAddProductdgv.Enabled = false;

dgvOpeningStock.Columns[5].Visible = false;

catch (Exception ex)

38
{

MessageBox.Show(ex.Message);

private void lblLocation_Click(object sender, EventArgs e)

private void cmbLocation_SelectedIndexChanged(object sender, EventArgs e)

private void btnClose_Click(object sender, EventArgs e)

this.Close();

string doctype = "Opening Stock";

private void btnSave_Click(object sender, EventArgs e)

try

39
string connString =
ConfigurationManager.ConnectionStrings["CosmeticInventory"].ConnectionString;

using (SqlConnection conn = new SqlConnection(connString))

conn.Open();

SqlCommand cmd = new SqlCommand("AddOpeningStockMaster", conn);

cmd.CommandType = CommandType.StoredProcedure;

cmd.Parameters.AddWithValue("@DocId", Convert.ToInt16(txtInvoice.Text));

cmd.Parameters.AddWithValue("@DocType", Convert.ToString(doctype));

cmd.Parameters.AddWithValue("@date", Convert.ToDateTime(dtpdate.Value).Date);

cmd.Parameters.AddWithValue("@description", txtDescription.Text);

cmd.ExecuteNonQuery();

for (int i = 0; i <= dgvOpeningStock.Rows.Count - 1; i++)

using (SqlConnection conn = new SqlConnection(connString))

conn.Open();

40
Chapter-5

Testing

41
5 Implementation and Testing
5.1 Testing Methods / Techniques
Testing is very important part of any type of Software engineering products and tasks. It
identifies that it is working correctly or not and what are the flaws of the product. Bugs and
Errors are detected and recovered with the help of multiple testing techniques like unit testing,
module testing, integration testing as well as white box and black box testing’s. Similarly alpha
and beta testing’s are performed when the product is almost at finalized state. Some testing’s
techniques are also used in our product “SUMS Mall Control System” are defined below.

5.2 Test Cases

5.2.1 Test Case Login


Test Case :1 Login

Preconditions: 1.System has Windows as an Operating system.


2.This system must be supported C# and SQL server.
3.Cosmetic Inventory System Software must be installed
correctly.
4.SQL Server must be installed in the system as a database.
Actions: The user click on Execution file and login
Enter user name and password
Click on OK or login button
User logged in successfully.

Expected Results: Admin or user must be login

Tested By: Tasawar Ali,Danish Munawar,Aqsa Maqbool

Result: Pass

Table No 5.2.1: Test Case Login

42
5.2.2 Test Case Login
Test Case :2 Login
Preconditions: 1. System has Windows as an Operating system.
2. This system must be supported C# and SQL server.
3. Cosmetic Inventory System Software must be installed correctly.
4. SQL Server must be installed in the system as a database.
Actions: The user click on Execution file and login.
Enter wrong user name and password.
Click on OK or login button
User or Admin did not login.

Expected Results: System will show Error Message.

Tested By: Tasawar Ali,Danish Munawar,Aqsa Maqbool

Result: Pass

Table No 5.2.2: Test Case Login

43
5.2.3 Test Case Add Company
Test Case :3 Add Company
Preconditions: 1. Cosmetic Inventory software must be installed on the system.
2. Admin must be login in the system.
3. SQL server must be installed.

Actions: Click on the Define Button and show the menu.


Click on the Company form.
See the Company record on Datagrid View
Add new Company in database.
Save the Company record.
Close the Company form.
Expected Results: Company must be added in the database successfully.

Tested By: Tasawar Ali, Aqsa Maqbool, Danish Munawar

Result: Pass

44
5.2.7 Test Case Delete Company
Test Case :7 View Company

Preconditions: 1. Cosmetic Inventory software must be installed on the system.


2. System must be in running condition
3. SQL server must be working as a database
4. Admin must be log in
Actions: Click on the Define Button and show the menu.
Click on the Company form.
See the Company record on Datagrid View.
If the Press F3 Key then filter the record According to the
Id/Name.
Show Company Name/Id.

Expected Results: Database must be displayed the view of Company.


Tested By: Tasawar Ali,Danish Munawar,Aqsa Maqbool
Result: Pass

Table No 5.2.7: Test Case View Company

45
5.2 Screen Shots

5.2.1 Login Form


User can login through previously provided Username & password.

5.5.2 Main Dashboard


User can chose any required Module from Dashboard for further process initiation. If the
Users Role is Admin then access All Module and Role is User then Access specific Module.

Define menu is only access by Admin Role

46
5.5.3 Main Dashboard/Voucher Menu
Vouchers menu is only access by Admin Role

5.5.4 Main Dashboard/Voucher Menu


Purchase Menu is access by Both Admin and User Role.

47
Figure 5.5.4 Dashboard/Purchase Menu

5.5.5 Main Dashboard/Voucher Menu


Sale Menu is access by Both Admin and User Role.

5.5.6 Main Dashboard/Voucher Menu


Reports Menu is access by Both Admin and User Role.

48
5.5.7 Sale Form
If the Role is Admin then performs all Action like (Save, Delete, Modify, View, Print etc) and if
the role is User then Performs Specific Actions like (Save, View, Print).

49
50

Potrebbero piacerti anche