Sei sulla pagina 1di 118

INVENTORY MANAGEMENT SYSTEM

A PROJECT REPORT
ON
STUDENT MANAGEMENT SYSTEM

Submitted By
ABHILASH PREMKANT JHA
Seat No-
23rd April -2018

Under the Guidance Of


Mrs. Nilima Gajare

Submitted in partial fulfilment of the requirements for


qualifying
B.s.c-(IT) SEM-VI-Examination

K.V. Pendharkar College of Arts, Science


Commerce
Near Gharda Circle, K.D.M.C Ground,
MIDC Road, Dombivali (East)

1|Page
INVENTORY MANAGEMENT SYSTEM

K.V. Pendharkar College of Arts, Science & Commerce


BSCIT(SEM-VI)

This is to certify that the project entitled STUDENT MANAGEMENT


SYSTEM submitted by Mr. Abhilash Premkant Jha seat no- is record of
benefited work carried out by him/her under my guidance, in partial
fulfilment of B.S.C (IT) degree (Semester VI) had not been submitted
for any other examination and does not form part of any other course
undergone by the candidate.
It is further certified that he/she has completed all required
phase of the project.

Signature of Internal Signature of External

Signature of charge

2|Page
INVENTORY MANAGEMENT SYSTEM

ACKNOWLEDGEMENT

We wish to avail this opportunity to acknowledge our profound


indebtedness and extend our deep sense of gratitude to our guide for
their valuable guidance profound advice and encouragement that has feel
to the successful completion of this project.

We are exceeding grateful to our H.O.D. Mrs.Nilima Gajare for


her full co-operations and help every time and also other staff members.

We would like to thank Mrs.Nilima Gajare Faculty of Information


Technology for encouraging us to take up this Project and guiding us
through the project, without whom the project would not have tested
today’s success.

Finally we would like to express our deepest gratitude and


reverence of our parents for their stead fast encouragement throughout
the progress of this work.

Yours Thankfully,

Ab
hilash Premkant Jha

3|Page
INVENTORY MANAGEMENT SYSTEM
PREFACE

Practical training is the utmost important in order to gain better


experience and also to get in touch with real field and its requirement.

By preparing this report we have understood the need of practical


training in the educational field. It is easier to work with computerized
system than the manual system. It saves time, efforts, space and also
increases the efficiency by creating interest.

The business world always works on the principle of Darwin’s “Survival of


Fittest”. It means that companies can always enter the door of success, if
it concentrates on the current environment imperative. In the exact
manner the development can only be effective if it is customer needs
oriented. So for that they have to implement a system, which gives
automation with very less efforts.

We are trying to develop the project of “Inventory Management


System”.

As it is a website we have tried the level best to provide each and every
item configurable, so that the user can change according to his/her
needs.

By considering all above details we have designed the website, which


incorporates Courier Management System including courier information,
tracking facility etc.

4|Page
INVENTORY MANAGEMENT SYSTEM
TOPIC PAGE NO
1. Preliminary Investigation
1.1 System Development Lifecycle
1.2 Description and Limitation
1.3 Proposed system
1.4 Objective Of Proposed System
1.5 Scope Of Proposed System

2. System Analysis
2.1 Research Methodology
2.2 Software Requirement Specification
2.3 Requirements Of The Project
2.4 Modules In The Project

3. System Design
3.1 DFD (Data Flow Diagram)
3.1.1 DFD level 0
3.2.2 DFD level 1
3.2 Entity Relationship
3.3 Database Model Diagram
3.4 Use Case Diagram
3.5 Class Diagram
4. Database design

5. System Testing
5|Page
INVENTORY MANAGEMENT SYSTEM
5.1 Testing Of Data
5.2 Screenshot
5.3 Coding

6. Future Enhancement
7. Conclusion
8. Reference and Bibliography

INDEX

6|Page
INVENTORY MANAGEMENT SYSTEM

1. PRELIMNARY INVESTIGATION

1.1 SYSTEM DEVELOPMENT LIFECYCLE


7|Page
INVENTORY MANAGEMENT SYSTEM

It is a method of system development that consist of planning, analysis,


design and implementation and support phases.

Phases:-

 Planning Phase :-
The Project Planning Phase is the second phase in the project
life cycle. It involves creating of a set of plans to help guide your
team through the execution and closure phases of the project.
The plans created during this phase will help you to manage time,
cost, quality, change, risk and issues. They will also help you
manage staff and external suppliers, to ensure that you deliver the
project on time and within budget.

 Analysis Phase :-
The analysis phase defines the requirements of the system,
independent of how these requirements will be accomplished. This
phase defines the problem that the customer is trying to solve. The
deliverable result at the end of this phase is a requirement
document. Ideally, this document states in a clear and precise
fashion what is to be built. This analysis represents the ``what''
phase. The requirement document tries to capture the
requirements from the customer's perspective by defining goals
and interactions at a level removed from the implementation
details.

 Design Phase :-
In the design phase the architecture is established. This phase
starts with the requirement document delivered by the requirement
phase and maps the requirements into an architecture.
The architecture defines the components, their interfaces and
8|Page
INVENTORY MANAGEMENT SYSTEM
behaviors. The design document describes a plan to implement the
requirements. This phase represents the ``how'' phase. Details on
computer programming languages and application architecture,
distributed architecture layering, memory size, platform,
algorithms, data structures, global type definitions, interfaces, and
many other engineering details are established.

 Code Generation Phase :-

The design must be translated into a machine readable form. The


code generation phases these task. If design is perform in a
detailed manner, code generation can be accomplished easily.

 Testing Phase :-
Once code has been generated program testing begins. The testing
process focuses on the logical internals of the software, insuring
that all the statements have been tested and on the functional
externals i.e. conducting tests to uncover errors and insures that
input will produce actual results that will agree with required result.

1.2 DESCRIPTION AND LIMITATION OF PRESENT SYSTEM

 Accessing the customer details is difficult as most of it is stored

manually.
 Every year they have to make different registers for maintaining

the records.

9|Page
INVENTORY MANAGEMENT SYSTEM
 System has to make a separate storage place for keeping these

registers.
 Every time buying new registers may lead to wastage of money.
 This technique searching records from the files is inconvenient.
 Each or process to maintain records in registers is very time

consuming.

1.3 PROPOSED SYSTEM

The purpose of the system is computerization of organization and


makes the complex task easier.
 The proposed model is efficient to manage the model details
such as:

 Total number of models purchased from each


publication.
 Total number of sales and purchase transactions.
 The cost and discount based on each models.
 Managing the models in list based on categories

 Finance details such as :

 Total amount earned in the current mounth.


10 | P a g e
INVENTORY MANAGEMENT SYSTEM
 Total amount add in particular mounth.
 Total amount of bill transaction done in particular
mounth.

 The Reports generated such as:


 Stock report .
 Inward transactions report.
 Outward transactions report.

1.4 OBJECTIVE OF THE PROJECT SYSTEM

 Making customer related record.


 Maintaining product information.
 Providing “view and search” utility for searching and viewing

the records related to customer, models and staff.


 Maintaining sales and purchase transaction details.
 Maintaining up-to-date information about customer’s order.
 Maintaining all sorts of purchase orders records.

11 | P a g e
INVENTORY MANAGEMENT SYSTEM

1.5 SCOPE OF THE PROPOSED SYSTEM

 By using the software the software we are making, we will be

able to maintain the records properly.


 Installing the software and working on it is not a time

consuming process.
 Paperwork is avoided.
 Complex task can be easily understood.
 Proper system
 Security is provided due to the presence of login and

password.
 Also many validations at many places to prevent invalid data

entries
 We can change and update the input data easily.
 Time will be served.

12 | P a g e
INVENTORY MANAGEMENT SYSTEM

2. SYSTEM ANALYSIS

13 | P a g e
INVENTORY MANAGEMENT SYSTEM

2.1 METHODOLOGY

SPIRAL MODEL :

The spiral model combines the idea of iterative development with


the systematic, controlled aspects of the waterfall model. This
Spiral model is a combination of iterative development process
model and sequential linear development model i.e. the waterfall
model with a very high emphasis on risk analysis. It allows
incremental releases of the product or incremental refinement
through each iteration around the spiral

Diagram of Spiral model :-

14 | P a g e
INVENTORY MANAGEMENT SYSTEM

Planning Phase :-

Requirements are gathered during the planning phase. Requirements like


‘BRS’ that is ‘Business Requirement Specifications’ and ‘SRS’ that is
System Requirement specifications’.

Risk Analysis :-

In the risk analysis phase, a process is undertaken to identify risk and


alternate solutions. A prototype is produced at the end of the risk
analysis phase. If any risk is found during the risk analysis then alternate
solutions are suggested and implemented.

Engineering Phase :-

In this phase software is developed, along with testing at the end of the
phase. Hence in this phase the development and testing is done.

Evaluation phase :-

This phase allows the customer to evaluate the output of the project to
date before the project continues to the next spiral.

15 | P a g e
INVENTORY MANAGEMENT SYSTEM
When to use Spiral Model :-

 When project is large

 When releases are required to be frequent

 When creation of a prototype is applicable

 When risk and costs evaluation is important

 For medium to high-risk projects

 When requirements are unclear and complex

 When changes may require at any time

 When long term project commitment is not feasible due to changes

in economic priorities

 For Medium and High-Risk project.

16 | P a g e
INVENTORY MANAGEMENT SYSTEM

2.2 SOFTWARE REQUIREMENT SPECIFICATION

Purpose :-

The main purpose of this project is to keep all the information regardinfg
the corporation.

The corporation will be benefited by the software as it keeps the


information computerized.

System also helps the administration to keep the records of members


associated with company the track of complaints, and also maintain the
record of citizens who have submitted the complaints.

Goals of implementation :-

The proposed system should be built in such a way that it should fulfil
the following goals

i. The code should be easily manageable.

ii. The code should be reusable.

iii. The Performance rate should be high.

iv. It should be fast.

17 | P a g e
INVENTORY MANAGEMENT SYSTEM

2.3 REQUIREMENT OF THE PROJECT

Hardware Configuration:

Processor : INTEL CORE i-3

RAM : 4 GB RAM

Hard Disk Drive : 20 GB HDD

Software Configuration:

Operating System : Windows 7,8,10

Web server : Personal Web Server

Designing Tool : Dreamweaver3.0, HTML

Server Side Scripting : ASP.NET

Client Side Scripting : C#

Backend : SQL SERVER 2008/2017

18 | P a g e
INVENTORY MANAGEMENT SYSTEM

2.4.MODUL IN THE PROJECT:-

The modules used in this software are as follows:

*Login:-

This module has a drop down list box from where we have to select

*ADMIN or USER:-

The ADMIN has all the rights in the software the status of his site. The
other fields in login are username
and password. If the username and password are correct then it is direct
ed tonext page.

*New user:-
This module is for the users who do not have their account. Here user is
allowed to create an account to login. The account creation is done by
filling the registration form with user details such as name, phone, email
etc.

*Product:-
This module has information regarding the products such as
its ID, name, Description, price, image of product etc. The ADMIN has
the authority to Add, Delete, Update etc. The USER can only view the
product information.

19 | P a g e
INVENTORY MANAGEMENT SYSTEM

*Accessories:-
This module consists of various available accessories of
the product with its name and picture, price information etc.

*Search:-

This module helps the user to ease his search based on the
required product in the stock. The search can be done on different
categories like Product id, Product Name, Product Description and
Product price etc.

*Stock:-

In these the information of the stock is maintained according to


the required product. User can able to view the stock information about
the required product and maintain the stock properly as per the company
need. The particular product stock not has to be less then 5 else the user
has to increase the stock by adding the required product in the stock

*Report:-
The Report may contain two option that is the product list and stock
list. The product list contain the list of the various different product. And the stock
list contain the list of the various product stock list in the record. It may able to get
information easily to the user about the product and stock list

*Customer:-

The Customer may contain all the detail information about


the customers like Customer Name, Customer Address, Customer
Contact Number, Customer Email-Id, etc.

20 | P a g e
INVENTORY MANAGEMENT SYSTEM

3. SYSTEM DESIGN

21 | P a g e
INVENTORY MANAGEMENT SYSTEM

Introduction to System Design:

System design is the process of planning a new system or to


replace the existing system. Simply, system design is like the blueprint
for building, it specifies all the features that are to be in the finished
product.

System design phase follows system analysis phase. Design is


concerned with identifying functions, data streams among those
functions, maintaining a record of the design decisions and providing a
blueprint the implementation phase.

Design is the bridge between system analysis and system


implementation. Some of the essential fundamental concepts involved in
the design of application software are:

 Abstraction

 Modularity

 Verification

Abstraction is used to construct solutions to problem without


having to take account of the intricate details of the various component
sub problems. Abstraction allows system designer to make step-wise
22 | P a g e
INVENTORY MANAGEMENT SYSTEM
refinement, which at each stage of the design may hide, unnecessary
details associated with representation or implementation from the
surrounding environment.

Modularity is concerned with decomposing of main module into


well-defined manageable units with well-defined interfaces among the
units. This enhances design clarity, which in turn eases implementation,
Debugging, Testing, Documenting and Maintenance of the software
product. Modularity viewed in this sense is a vital tool in the construction
of large software projects.

Verification is fundamental concept in software design. A design is


verifiable if it can be demonstrated that the design will result in
implementation that satisfies the customer’s requirements. Verification is
of two types namely.

 Verification that the software requirements analysis satisfies


the customer’s needs.

 Verification that the design satisfies the requirement


analysis.

Some of the important factors of quality that are to be considered


in the design of application software are:

Reliability:

The software should behave strictly according to the original


specification and should function smoothly under normal conditions.

Extensibility:

The software should be capable of adapting easily to changes in


the specification.

23 | P a g e
INVENTORY MANAGEMENT SYSTEM
Reusability:

The software should be developed using a modular approach,


which permits modules to be reused by other application, if possible.
The System Design briefly describes the concept of system design
and it contains four sections. The first section briefly describes the
features that the system is going to provide to the user and the outputs
that the proposed system is going to offer.

The second section namely Logical Design describes the Data Flow
Diagrams, which show clearly the data movements, the processes and
the data sources, and sinks, E-R diagrams which represent the overall
logical design of the database, and high-level process structure of the
system.
The process of design involves “conceiving and planning out in the
mind” and making a drawing pattern, or sketch of the system. In
software design there are two types of major activities, Conceptual
Design and Detailed Design.
Conceptual or logical or external design of software involves
conceiving, planning out, and specifying the externally observable
characteristics of a software product. These characteristics include user
displays, external data sources, functional characteristics and high-level
process structure for the product.

Details or internal design involves conceiving, planning out, and


specifying the internal structure and processing details of the software
product. The goal of internal design is to specify internal structure,
processing details, blueprint of implementation, testing, and
maintenance activities.
One of the important fundamental concepts of software design is
modularity. A modularity system consists interfaces among the units.
Modularity enhances design clarity, which in turn eases implementation,
debugging, testing, documentation, and maintenance of the software
product.
The other fundamental concepts of software design include
abstraction, structure, information hiding, concurrency and verification.
24 | P a g e
INVENTORY MANAGEMENT SYSTEM
The use of structuring permits decomposition of a large system into
smaller, more manageable units with well-defined relationships to the
other units. The system design is verifiable if it can be demonstrated
that the design will result in an implementation that satisfies the
customer’s requirements.

Preliminary Design:
Preliminary design is basically concerned with deriving an overall
picture of the system. Deriving entire system into modules and sub-
modules while keeping Cohesion and Coupling factors in mind. Tools,
which assist in preliminary design process, are Data Flow Diagrams.

Code design:

The purpose of code is to facilitate the identification and retrieval


for items of information. A code is an ordered collection of symbols
designed to provide unique identification of an entity or attribute. To
achieve unique identification there must be only one place where the
identified entity or the attribute can be entered in the code; conversely
there must be a place in the code for every thing that is to be identified.
This mutually exclusive feature must be built into any coding system.

The codes for this system are designed with two features in mind.
Optimum human oriented use and machine efficiency. Length of the
code range from length of one to length of five characteristics:
 The code structure is unique; ensuring that only one value of
the code with a single meaning may be correctly applied to a
given entity or attributes.
 The code structure is expansible allowing for growth of its set
of entities and attributes.

25 | P a g e
INVENTORY MANAGEMENT SYSTEM
 The code is concise and brief for recording, communication,
transmission and storage efficiencies.
 They have a uniform size and format.
 The codes are simple so that the user can easily understand
it.
 The codes are also versatile i.e., it is easy to modify to reflect
necessary changers in condition, chart eristic and
relationships of the encode entities.
 The codes are also easily storable for producing reports in a
predetermined order of format.
 The codes are also stable and do not require being frequently
updated thereby promoting user efficiency.
 The codes are also meaningful.

Input Design:

Input design is a part of overall system design, which requires very


careful attention. The main objectives of input design are:

 To produce a cost-effective method of input.


 To achieve the highest possible level of accuracy.
 To ensure that the input is acceptable to and understood by
the user staff.
In this system input screens are designed very carefully so that
no inaccurate data will enter the database. The data is made as easy
as possible. For simplifying the data entry many facilities are given.

Each and every screen in this system is facilitated by many


pushbuttons so that the user can easily work with this system.

Output Design:

Outputs from computer systems are required primarily to


communicate the results of processing to users. They are also to
provide a permanent hard copy of these results for later consultation.

26 | P a g e
INVENTORY MANAGEMENT SYSTEM
 The various types of outputs are required by this system are
given below: External outputs, whose destination is outside the concern
and which require special attention because they, project the image of
the concern.

 Internal outputs, whose destination is within the concern and


which require careful design because they are the user’s main interface
within the computer.
 Operation outputs, whose use is purely within the computer
department, E.g., program listings, usage statistics etc,
 Interactive outputs, which involves the user in
communicating directly with the computers.

27 | P a g e
INVENTORY MANAGEMENT SYSTEM

3.1.Data Flow Diagram(DFD):-

A Data Flow Diagram (DFD) is a graphical


representation of the "flow" of data through an Information System. A
data flow diagram can also be used for the visualization of Data
Processing. It is common practice for a designer to raw a context-level
DFD first which shows the interaction between the system and outside
entities. This context-level DFD is then "exploded" to show more detail of
the system being model.
A DFD represents flow of data through a system. Data flow
diagrams are commonly used during problem analysis. It views a system
as a function that transforms the input into desired output. A DFD shows
movement of data through the different transformations or processes in
the system. Dataflow diagrams can be used to provide the end user with
a physical idea of where the data they input ultimately has an effect
upon the structure of the whole system from order to dispatch to restock
how any system is developed can be determined through a dataflow
diagram. The appropriate register saved in database and maintained
by appropriate authorities.

28 | P a g e
INVENTORY MANAGEMENT SYSTEM

Data Flow Diagram

Level 0 :

29 | P a g e
INVENTORY MANAGEMENT SYSTEM

Level 1 :

30 | P a g e
INVENTORY MANAGEMENT SYSTEM

3.2.Entity Relationship Diagrams (ER-Diagrams):-

An entity-relationship (ER) diagram is a


specialized graphic that illustrates the interrelationships between entities
in a database. ER diagrams often use symbols to represent three
different types of information. Boxes are commonly used to represent
entities. Diamonds are normally used to represent relationships and
ovals are used to represent attributes

*Entity-relationship model:-

(ERM) in software engineering is an abstract and


conceptual representation of data. Entity-relationship modeling is a
relational schema database modeling method, used to produce a type of
conceptual schemer semantic data model of a system, often a relational
database, and its requirements in a top-down fashion.

*Symbols used in this E-R Diagram:-

a)Entity:-

Entity is a “thing” in the real world with an independent existence. An


entity may be an object with a physical existence such as person, car or
employee. Entity symbol is as follows

Attribute:

Attribute is a particular property that describes the entity. Attribute symbol is

Relationship:

31 | P a g e
INVENTORY MANAGEMENT SYSTEM
Relationship will be several implicit relationships among various entity types
whenever an attribute of one entity refers to another entity type some
relationship exits. Relationship symbol is:

Key attributes:

An entity type usually has an attribute whose values are distinct for each
individual entity in the collection. Such an attribute is called key attribute. Key
attribute symbol is as follows

32 | P a g e
INVENTORY MANAGEMENT SYSTEM

ER DIAGRAM

33 | P a g e
INVENTORY MANAGEMENT SYSTEM

3.3.Database Model:-

A database model is a type of data model that determines the


logical structure of a database and fundamentally determines in which
manner data can be stored, organized and manipulated. The most
popular example of a database model is the relational model, which
uses a table-based format.

34 | P a g e
INVENTORY MANAGEMENT SYSTEM

3.4 USECASE DIAGRAM

In the Unified Modeling Language (UML), a use case diagram can


summarize the details of your system's users (also known as actors) and
their interactions with the system. To build one, you'll use a set of
specialized symbols and connectors. An effective use case diagram can
help your team discuss and represent:

 Scenarios in which your system or application interacts with

people, organizations, or external systems

 Goals that your system or application helps those entities (known

as actors) achieve

 The scope of your system

The purpose of a use case diagram in UML is to demonstrate the


different ways that a user might interact with a system. Create a
professional diagram for nearly any use case using our UML diagram tool

35 | P a g e
INVENTORY MANAGEMENT SYSTEM

When To Use Usecase Diagram :-

A use case diagram doesn't go into a lot of detail—for example, don't


expect it to model the order in which steps are performed. Instead, a
proper use case diagram depicts a high-level overview of the relationship
between use cases, actors, and systems. Experts recommend that use
case diagrams be used to supplement a more descriptive textual use
case.

UML is the modeling toolkit that you can use to build your diagrams. Use
cases are represented with a labeled oval shape. Stick figures represent
actors in the process, and the actor's participation in the system is
modeled with a line between the actor and use case. To depict the
system boundary, draw a box around the use case itself.

UML use case diagrams are ideal for:

 Representing the goals of system-user interactions

 Defining and organizing functional requirements in a system

 Specifying the context and requirements of a system

 Modeling the basic flow of events in a use case

36 | P a g e
INVENTORY MANAGEMENT SYSTEM

Use Case Diagram

37 | P a g e
INVENTORY MANAGEMENT SYSTEM

38 | P a g e
INVENTORY MANAGEMENT SYSTEM

3.5 CLASS DIAGRAM


39 | P a g e
INVENTORY MANAGEMENT SYSTEM
The class diagram is the main building block of object-
oriented modelling. It is used for general conceptual modelling of the
systematic of the application, and for detailed modelling translating the
models into programming code. Class diagrams can also be used for data
modelling. The classes in a class diagram represent both the main
elements, interactions in the application, and the classes to be
programmed.
In the diagram, classes are represented with boxes that contain three
compartments:

 The top compartment contains the name of the class. It is printed


in bold and centered, and the first letter is capitalized.

 The middle compartment contains the attributes of the class. They


are left-aligned and the first letter is lowercase.

 The bottom compartment contains the operations the class can


execute. They are also left-aligned and the first letter is lowercase.

40 | P a g e
INVENTORY MANAGEMENT SYSTEM
Class Diagram

41 | P a g e
INVENTORY MANAGEMENT SYSTEM

4. DATABASE DESIGN

42 | P a g e
INVENTORY MANAGEMENT SYSTEM
DATABASE DESIGN

Database is an integrated collection of data and provides a


centralized access to the data and makes possible to treat data as a
separate resource. Usually centralized data managing software is called
a Relational Database Management System (RDBMS). The most
significant different between RDBMS and other type of Data Management
is the separation of data as seen by the program and data as store of on
the direct access storage device. This is the difference between logical
and physical data.

Data Dictionary:

The efficiency of an application developed using RDBMS mainly


depend upon the database tables, the fields in each table and the way
the tables are opened using the contents in them to retrieve the
necessary information. Hence a careful selection of tables and their
fields are imperative.

The database tables used in this system are created keeping the
above points in mind. The tables used are given below.

43 | P a g e
INVENTORY MANAGEMENT SYSTEM
Login Table :

Employee table :

44 | P a g e
INVENTORY MANAGEMENT SYSTEM
Customer Table :

45 | P a g e
INVENTORY MANAGEMENT SYSTEM
Supplier Table :

Company Table :

Product table :

46 | P a g e
INVENTORY MANAGEMENT SYSTEM

Transaction In Table :

Transaction Out Table :

47 | P a g e
INVENTORY MANAGEMENT SYSTEM

48 | P a g e
INVENTORY MANAGEMENT SYSTEM

5. SYSTEM TESTING

5.1 TESTING OF DATA

49 | P a g e
INVENTORY MANAGEMENT SYSTEM
System testing is the stage before system implementation where
the system is made error free and all the needed modifications are
made. The system was tested with test data and necessary corrections to
the system were carried out. All the reports were checked by the user
and approved. The system was very user friendly with online help to
assist the user wherever necessary.

Test Plan:
A test plan is a general document for the entire project, which
defines the scope, approach to be taken, and schedule of testing, as well
as identifying the test item for the entire testing process, and the
personal responsible for the different activities of testing. This document
describes the plan for testing, the knowledge management tool.
Major testing activities are:

 Test units

 Features to be tested

 Approach for testing

 Test deliverables

 Schedule

 Personal allocation

50 | P a g e
INVENTORY MANAGEMENT SYSTEM
Test units:

Test Case specification is major activity in the testing process. In


this project, I have performed two levels of testing.
 Unit testing

 System testing

The basic units in Unit testing are:

 Validating the user request

 Validating the input given by the user

 Exception handling

The basic units in System testing are:

 Integration of all programs is correct or not

o Checking whether the entire system after integrating is


working as expected.

 The system is tested as whole after the unit testing.

Other Testing Strategies:

Alpha Testing:

This was done at the developer’s site by a customer. The software


is used in a natural setting with the developer “looking over the
shoulder” of the user and recording errors and usage problems. Alpha
tests are conducted in a controlled environment.

51 | P a g e
INVENTORY MANAGEMENT SYSTEM
Beta Testing:

This was conducted at one or more customer sites by the end-user


of the software. Unlike alpha testing, the developer is generally not
present. Therefore, the beta test is a “live” application of the software in
an environment that cannot be controlled by the developer. The
customer records all problems that are encountered during beta testing
and reports these to the developer at regular intervals. As a result of
problems reported during beta tests, software engineers make
modifications and then prepare for release of the software
product to the entire customer base.

Test deliverables:

The following documents are required besides the test plan

 Unit test report for each unit

 Test case specification for system testing

 The report for system testing

 Error report

The test case specification for system testing has to be submitted for
review before the system testing commences.

5.2 SCREENSHOTS

52 | P a g e
INVENTORY MANAGEMENT SYSTEM
LOGIN PAGE

ADMIN MASTERPAGE

Customer Page :

53 | P a g e
INVENTORY MANAGEMENT SYSTEM

Supplier Page :

Product Page :

54 | P a g e
INVENTORY MANAGEMENT SYSTEM

Transaction IN Page :

Transaction Out Page :

55 | P a g e
INVENTORY MANAGEMENT SYSTEM

Transaction IN Report :

Transaction OUT Report :

56 | P a g e
INVENTORY MANAGEMENT SYSTEM

Stock Report :

Add Company Page :

57 | P a g e
INVENTORY MANAGEMENT SYSTEM

Add employee Page :

5.3 Coding
58 | P a g e
INVENTORY MANAGEMENT SYSTEM

Clientmaster.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Inventory.ClientForms;
using Inventory.MasterForms;

namespace Inventory.Forms
{
public partial class Clientmaster : Form
{

public Clientmaster()
{
InitializeComponent();
}

private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)


{
this.Close();
}

private void Clientmaster_FormClosing(object sender, FormClosingEventArgs e)


{
Application.Exit();
}

private void productsToolStripMenuItem_Click(object sender, EventArgs e)


{
Product pro = new Product();
pro.MdiParent = this;
pro.Show();
}

private void customerToolStripMenuItem_Click(object sender, EventArgs e)


{
Customeraccount cacct = new Customeraccount();
cacct.MdiParent = this;
cacct.Show();
}

private void supplierToolStripMenuItem_Click(object sender, EventArgs e)


59 | P a g e
INVENTORY MANAGEMENT SYSTEM
{
Supplieraccount supacct = new Supplieraccount();
supacct.MdiParent = this;
supacct.Show();
}

private void stocksToolStripMenuItem_Click(object sender, EventArgs e)


{
Stock st = new Stock();
st.MdiParent = this;
st.Show();
}

private void logoutToolStripMenuItem_Click(object sender, EventArgs e)


{
Form1 form = new Form1();
form.Show();
}

private void exitToolStripMenuItem_Click(object sender, EventArgs e)


{
this.Close();
}

private void insideToolStripMenuItem_Click(object sender, EventArgs e)


{
Intrans intras = new Intrans();
intras.MdiParent = this;
intras.Show();
}

private void outsideToolStripMenuItem_Click(object sender, EventArgs e)


{
Outtrans outtras = new Outtrans();
outtras.MdiParent = this;
outtras.Show();
}

private void transictionToolStripMenuItem_Click(object sender, EventArgs e)


{
TransINreport tin = new TransINreport();
tin.MdiParent = this;
tin.Show();

private void stockToolStripMenuItem_Click(object sender, EventArgs e)


{
Stock st = new Stock();
st.MdiParent = this;
st.Show();

60 | P a g e
INVENTORY MANAGEMENT SYSTEM
}
}
}

Customeracc.cs :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;

namespace Inventory.ClientForms
{
public partial class Customeraccount : Form
{
SqlCommand com = new SqlCommand();
SqlConnection con = new SqlConnection();
SqlDataAdapter sda = new SqlDataAdapter();
DataSet ds = new DataSet();
string pids;

public Customeraccount()
{
con.ConnectionString = "Data Source=.\\SQLEXPRESS;Initial
Catalog=inventorylogin;Integrated Security=True;";
InitializeComponent();
}

private void cinsert_Click(object sender, EventArgs e)


{
try
{
String che = @"(Select count(*) from Customer where Cfname='" +
cfname.Text + "')";
SqlCommand cmd = new SqlCommand("insert into Customer
(Cfname,Clname,Caddress,Ccontact1,Ccontact2,Ccountry,Cstate,Ccity,Cpincode
,Cemail) Values('" + cfname.Text + "','" + clname.Text + "','" + caddress.Text
+ "','" + ccontact1.Text + "','" + ccontact2.Text + "','" + ccountry.Text + "','" +

61 | P a g e
INVENTORY MANAGEMENT SYSTEM
cstate.Text + "','" + ccity.Text + "','" + cpincode.Text + "','" + cemail.Text +
"')", con);
con.Open();
SqlCommand cmda = new SqlCommand(che, con);
int count = (int)cmda.ExecuteScalar();
if (count > 0)
{
MessageBox.Show("PRODUCT ALREADY EXIST");
}

else
{
cmd.ExecuteNonQuery();
MessageBox.Show("Record Saved In DataBase");
}
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(" Please Enter The Required Field ", ex.Message);
}
finally
{
if (con.State == ConnectionState.Open)
con.Close();
}
cfname.Clear();
clname.Clear();
caddress.Clear();
ccountry.Clear();
cstate.Clear();
ccity.Clear();
cpincode.Clear();
ccontact1.Clear();
ccontact2.Clear();
cemail.Clear();
cfname.Focus();

RetriveID();

private void cupdate_Click(object sender, EventArgs e)


{
con.Open();
com = new SqlCommand("update Customer set Cfname='" + cfname.Text +
"',Clname='" + clname.Text + "',Caddress='" + caddress.Text + "',Ccontact1='"
+ ccontact1.Text + "',Ccontact2='" + ccontact2.Text + "',Ccountry='" +
ccountry.Text + "',Cstate='" + cstate.Text + "',Ccity='" + ccity.Text +
"',Cpincode='" + cpincode.Text + "',Cemail='" + cemail.Text + "' where
CId='"+cid.Text+"'", con);

62 | P a g e
INVENTORY MANAGEMENT SYSTEM
com.ExecuteNonQuery();
con.Close();
MessageBox.Show("Data Updted Successfully");
}

private void crefresh_Click(object sender, EventArgs e)


{
cfname.Clear();
clname.Clear();
caddress.Clear();
ccountry.Clear();
cstate.Clear();
ccity.Clear();
cpincode.Clear();
ccontact1.Clear();
ccontact2.Clear();
cemail.Clear();
cfname.Focus();

RetriveID();
}

private void cshow_Click(object sender, EventArgs e)


{
String query = "Select * from Customer";
SqlDataAdapter sda = new SqlDataAdapter(query, con);
DataTable dt = new DataTable();
sda.Fill(dt);
cdatagridview.DataSource = dt;
con.Close();
}

private void RetriveID()


{
try
{
String query = "select CId from Customer";
if (con.State == ConnectionState.Closed)
{
con.Open();
}
com = new SqlCommand(query, con);
SqlDataReader rd = com.ExecuteReader();
while (rd.Read())
{
int value = int.Parse(rd[0].ToString()) + 1;
cid.Text = value.ToString();
}
}
catch (Exception ex)
{

63 | P a g e
INVENTORY MANAGEMENT SYSTEM
throw;
}
finally
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
}
}

private void Customeraccount_Load(object sender, EventArgs e)


{
RetriveID();
}

private void cdatagridview_MouseDown(object sender, MouseEventArgs e)


{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
var hti = cdatagridview.HitTest(e.X, e.Y);
cdatagridview.Rows[hti.RowIndex].Selected = true;
contextMenuStrip1.Show(cdatagridview, e.X, e.Y);
pids = cdatagridview.SelectedRows[0].Cells[0].Value.ToString();
}
}

private void contextMenuStrip1_Click(object sender, EventArgs e)


{
con.Open();
com = new SqlCommand("delete from Customer where CId = '" + pids + "'",
con);
com.ExecuteNonQuery();
con.Close();
}

private void cdatagridview_DoubleClick(object sender, EventArgs e)


{
cid.Text = cdatagridview.SelectedRows[0].Cells[0].Value.ToString();
cfname.Text = cdatagridview.SelectedRows[0].Cells[1].Value.ToString();
clname.Text = cdatagridview.SelectedRows[0].Cells[2].Value.ToString();
caddress.Text = cdatagridview.SelectedRows[0].Cells[3].Value.ToString();
ccontact1.Text = cdatagridview.SelectedRows[0].Cells[4].Value.ToString();
ccontact2.Text = cdatagridview.SelectedRows[0].Cells[5].Value.ToString();
ccountry.Text = cdatagridview.SelectedRows[0].Cells[6].Value.ToString();
cstate.Text = cdatagridview.SelectedRows[0].Cells[7].Value.ToString();
ccity.Text = cdatagridview.SelectedRows[0].Cells[8].Value.ToString();
cpincode.Text = cdatagridview.SelectedRows[0].Cells[9].Value.ToString();
cemail.Text = cdatagridview.SelectedRows[0].Cells[10].Value.ToString();
}
}

64 | P a g e
INVENTORY MANAGEMENT SYSTEM
}

Intrans.cs :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Data.SqlClient;
using Inventory.Models;
using Inventory.Properties;

namespace Inventory.ClientForms
{
public partial class Intrans : Form
{
SqlCommand com = new SqlCommand();
SqlConnection con = new SqlConnection();
SqlDataAdapter sda = new SqlDataAdapter();
DataSet ds = new DataSet();
DataTable dt = new DataTable();

public Intrans()
{
con.ConnectionString = "Data Source=.\\SQLEXPRESS;Initial
Catalog=inventorylogin;Integrated
Security=True;MultipleActiveResultSets=true;";
InitializeComponent();
}

//VARIABLE DECLARATION
decimal totsalestax;
decimal taxtotalamount;
decimal totamount;

//LIST OBJECT CREATED HEAR TO USE FOR BINDING DATA WITH GRIDVIEW
private List<pgriditem> pgit = new List<pgriditem>();
//FOR PRINTING VARIABLES
private int numberOfItemsPerPage = 0;
private int numberOfItemsPrintedSoFar = 0;

private void pdelete_Click(object sender, EventArgs e)


{
//CLEAR OPERATION FOR PAYGROUPBOX TEXTBOXES
proamount.Clear();

65 | P a g e
INVENTORY MANAGEMENT SYSTEM
protax.SelectedIndex = -1;
propaid.Clear();
prototalamt.Clear();
pgridview.DataSource = null;
pgit.Clear();
probalance.Clear();
pname.SelectedIndex = -1;
pstock.Clear();
punit.Clear();
pamount.Clear();

//ENABLE DISABLE OPERATION


pdelete.Enabled = false;
pneworder.Enabled = true;
pgroupbox.Enabled = false;
psubmit.Enabled = false;
pdelete.Enabled = false;
paygroupbox.Enabled = false;
pprint.Enabled = false;
}

private void pneworder_Click(object sender, EventArgs e)


{
//ENABLE DISABLE OPERATION
pneworder.Enabled = false;
pgroupbox.Enabled = true;
psubmit.Enabled = true;
pdelete.Enabled = true;
pprint.Enabled = true;
tcomboBox.Focus();
pstock.Text = "0";
pamount.Text = "0";
punit.Text = "0";
}

private void pdone_Click(object sender, EventArgs e)


{
totamount = pgit.Sum(x => x.Totalamount);
proamount.Text = totamount.ToString();

//VALADATION FOR PGOUUPBOX


if (tcomboBox.SelectedIndex == -1)
{
MessageBox.Show("SELECT REQUIRED FIELD", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
tcomboBox.Focus();
}

if (pname.SelectedIndex == -1)
{

66 | P a g e
INVENTORY MANAGEMENT SYSTEM
MessageBox.Show("SELECT REQUIRED FIELD", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
pname.Focus();
}

else
{
//CLEAR OPERATION FOR TEXTBOX IN PGROUPBOX
pname.SelectedIndex = -1;
pstock.Clear();
punit.Clear();
pamount.Clear();

//ENABLE DISABLE OPERATION FOR GROUPBOX


pgroupbox.Enabled = false;
paygroupbox.Enabled = true;
proamount.Focus();
prototalamt.Text = "0";
propaid.Text = "0";
probalance.Text = "0";

private void padd_Click(object sender, EventArgs e)


{
//VALADATION FOR PGOUUPBOX
if (tcomboBox.SelectedIndex == -1)
{
MessageBox.Show("SELECT REQUIRED FIELD", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
tcomboBox.Focus();
}

if (pname.SelectedIndex == -1)
{
MessageBox.Show("SELECT REQUIRED FIELD", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
pname.Focus();
}

else
{
con.Open();
int newstcok = Convert.ToInt32(pstock.Text) + Convert.ToInt32(punit.Text);
com = new SqlCommand("update Product set PQuantity = '" + newstcok + "'
where PName = '" + pname.SelectedValue + "'", con);
int n = com.ExecuteNonQuery();
if (n == 1)
{

67 | P a g e
INVENTORY MANAGEMENT SYSTEM
pgriditem item = new pgriditem()
{
ProductName = pname.Text,
Stock = Convert.ToInt16(pstock.Text.Trim()),
Unit = Convert.ToInt16(punit.Text.Trim()),
Amount = Convert.ToDecimal(pamount.Text.Trim()),
Totalamount = Convert.ToInt16(punit.Text.Trim()) *
Convert.ToDecimal(pamount.Text.Trim()),
Date = Convert.ToDateTime(pdate.Value)
};
//USING LIST TO BIND DATA WITH GRIDVIEW
pgit.Add(item);
pgridview.DataSource = null;
pgridview.DataSource = pgit;

pstock.Clear();
punit.Clear();
pamount.Clear();
pname.Focus();

}
con.Close();

}
}

private void psubmit_Click(object sender, EventArgs e)


{
//VALADATION FOR PAYGOUUPBOX
if (protax.SelectedIndex == -1)
{
MessageBox.Show("SELECT REQUIRED FIELD", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
protax.Focus();
}

if (prototalamt.Text.Trim() == String.Empty)
{
MessageBox.Show("Enter The Paid Amount", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
prototalamt.Focus();
}

else
{
con.ConnectionString = "Data Source=.\\SQLEXPRESS;Initial
Catalog=inventorylogin;Integrated Security=True;";

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


{

68 | P a g e
INVENTORY MANAGEMENT SYSTEM
SqlCommand cmd = new SqlCommand("insert into TransIN" +
"(Productname,Stock,Unit,Amount,Totalamount,Date)Values('" +
pgridview.Rows[i].Cells[0].Value + "','" + pgridview.Rows[i].Cells[1].Value +
"','" + pgridview.Rows[i].Cells[2].Value + "','" +
pgridview.Rows[i].Cells[3].Value + "','" + pgridview.Rows[i].Cells[4].Value +
"',@Date)",con);
con.Open();
cmd.Parameters.AddWithValue("@Date", pdate.Value);
cmd.ExecuteNonQuery();
con.Close();
}
//pgridview.Rows.Clear();
Intrans ins = new Intrans();
//ins.MdiParent = this;
this.Hide();
ins.Show();
//this.Hide();

//CLEAR OPERATION FOR PAYGROUPBOX TEXTBOXES


proamount.Clear();
protax.SelectedIndex = -1;
propaid.Clear();
prototalamt.Clear();
proamount.Clear();
probalance.Clear();
pgit.Clear();

//ENABLE DISABLE OPERATION


pdelete.Enabled = false;
pneworder.Enabled = true;
pgroupbox.Enabled = false;
psubmit.Enabled = false;
pdelete.Enabled = false;
paygroupbox.Enabled = false;

MessageBox.Show("Data Stored Successfully");


}
}

private void protax_SelectedIndexChanged(object sender, EventArgs e)


{
if (protax.SelectedIndex == 0)
{
totsalestax = totamount;
prototalamt.Text = totsalestax.ToString();
}

if (protax.SelectedIndex == 1)
{
totsalestax = (8 * totamount) / 100;

69 | P a g e
INVENTORY MANAGEMENT SYSTEM
taxtotalamount = totamount + totsalestax;
prototalamt.Text = taxtotalamount.ToString();
}

if (protax.SelectedIndex == 2)
{
totsalestax = (10 * totamount) / 100;
taxtotalamount = totamount + totsalestax;
prototalamt.Text = taxtotalamount.ToString();

if (protax.SelectedIndex == 3)
{
totsalestax = (12 * totamount) / 100;
taxtotalamount = totamount + totsalestax;
prototalamt.Text = taxtotalamount.ToString();

if (protax.SelectedIndex == 4)
{
totsalestax = (16 * totamount) / 100;
taxtotalamount = totamount + totsalestax;
prototalamt.Text = taxtotalamount.ToString();

}
else
{

string itemname, unitchange;


private void pgridview_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
var hti = pgridview.HitTest(e.X, e.Y);
pgridview.Rows[hti.RowIndex].Selected = true;
contextMenuStrip1.Show(pgridview, e.X, e.Y);
itemname = pgridview.SelectedRows[0].Cells[0].Value.ToString();
unitchange = pgridview.SelectedRows[0].Cells[2].Value.ToString();
}
}

//DELETE OPERATION FOR GRIDVIEW


private void dELETEToolStripMenuItem_Click(object sender, EventArgs e)
{
con.Open();

70 | P a g e
INVENTORY MANAGEMENT SYSTEM
com = new SqlCommand("select PQuantity from Product where PName = '" +
itemname + "'", con);
using (SqlDataReader rd = com.ExecuteReader())
{
if (rd.Read())
{
int oldQ = Convert.ToInt32(rd["PQuantity"].ToString());
int changequan = oldQ - Convert.ToInt32(unitchange);
com = new SqlCommand("update Product set PQuantity = '" + changequan + "'
where PName = '" + itemname + "'", con);
com.ExecuteNonQuery();
}
}
con.Close();
int index = pgridview.CurrentCell.RowIndex;
pgit.RemoveAt(index);
pgridview.DataSource = null;
pgridview.DataSource = pgit;

totamount = pgit.Sum(x => x.Totalamount);


proamount.Text = totamount.ToString();

{
if (protax.SelectedIndex == 0)
{
totsalestax = totamount;
prototalamt.Text = totsalestax.ToString();
}

if (protax.SelectedIndex == 1)
{
totsalestax = (8 * totamount) / 100;
taxtotalamount = totamount + totsalestax;
prototalamt.Text = taxtotalamount.ToString();
}

if (protax.SelectedIndex == 2)
{
totsalestax = (10 * totamount) / 100;
taxtotalamount = totamount + totsalestax;
prototalamt.Text = taxtotalamount.ToString();

if (protax.SelectedIndex == 3)
{
totsalestax = (12 * totamount) / 100;
taxtotalamount = totamount + totsalestax;
prototalamt.Text = taxtotalamount.ToString();

71 | P a g e
INVENTORY MANAGEMENT SYSTEM
if (protax.SelectedIndex == 4)
{
totsalestax = (16 * totamount) / 100;
taxtotalamount = totamount + totsalestax;
prototalamt.Text = taxtotalamount.ToString();

}
else
{

}
}
}

private void probalance_Click(object sender, EventArgs e)


{
//FOR PAID AND BALANCE AMOUNT DETAILS
decimal p = Convert.ToDecimal(prototalamt.Text.ToString());
decimal q = Convert.ToDecimal(propaid.Text.ToString());
{
if (q > p)
{
MessageBox.Show("Please enter the valid Amount", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
decimal probal = Convert.ToDecimal(prototalamt.Text.ToString()) -
Convert.ToDecimal(propaid.Text.ToString());
probalance.Text = probal.ToString();
}
}

private void printDocument1_PrintPage(object sender,


System.Drawing.Printing.PrintPageEventArgs e)
{
Image image = Resources.shoesabhi;
e.Graphics.DrawImage(image, 100, 0, image.Width, image.Height);
e.Graphics.DrawString("Date : " + DateTime.Now.ToShortDateString(), new
Font("Arial", 15, FontStyle.Regular),
Brushes.Black, new Point(25, 180));
//
String nam = tcomboBox.SelectedItem.ToString();
//
e.Graphics.DrawString("Supplier Name : "+nam , new Font("Arial", 15,
FontStyle.Regular),
Brushes.Black, new Point(25, 205));
//e.Graphics.DrawString("" + nam, new Font("Arial", 15, FontStyle.Regular),

72 | P a g e
INVENTORY MANAGEMENT SYSTEM
// Brushes.Black, new Point(25, 215));

e.Graphics.DrawString
("---------------------------------------------------------------------------------------
-------------------------",
new Font("Arial", 15, FontStyle.Regular), Brushes.Blue, new Point(22, 230));
e.Graphics.DrawString("Product Name", new Font("Arial", 15,
FontStyle.Regular), Brushes.Black, new Point(30, 248));
e.Graphics.DrawString("Quantity", new Font("Arial", 15, FontStyle.Regular),
Brushes.Black, new Point(378, 245));
e.Graphics.DrawString("Unit Price", new Font("Arial", 15, FontStyle.Regular),
Brushes.Black, new Point(548, 245));
e.Graphics.DrawString("Total Price", new Font("Arial", 15, FontStyle.Regular),
Brushes.Black, new Point(696, 245));
e.Graphics.DrawString
("---------------------------------------------------------------------------------------
-------------------------",
new Font("Arial", 15, FontStyle.Regular), Brushes.Blue, new Point(22, 259));

int ypos = 280;

for (int i = numberOfItemsPrintedSoFar; i < pgit.Count; i++)


{
numberOfItemsPerPage++;
//PRINT ONLY 20 ITEMS ON ONE PAGE
if (numberOfItemsPerPage <= 15)
{
numberOfItemsPrintedSoFar++;

if (numberOfItemsPrintedSoFar <= pgit.Count)


{

e.Graphics.DrawString(pgit[i].ProductName, new Font("Arial", 15,


FontStyle.Regular), Brushes.Black, new Point(30, ypos));
e.Graphics.DrawString(pgit[i].Unit.ToString(), new Font("Arial", 15,
FontStyle.Regular), Brushes.Black, new Point(398, ypos));
e.Graphics.DrawString(pgit[i].Amount.ToString(), new Font("Arial", 15,
FontStyle.Regular), Brushes.Black, new Point(568, ypos));
e.Graphics.DrawString(pgit[i].Totalamount.ToString(), new Font("Arial", 15,
FontStyle.Regular), Brushes.Black, new Point(708, ypos));

ypos += 30;
}
else
{
//TO STOP PRINTING
e.HasMorePages = false;
}
}
else
{

73 | P a g e
INVENTORY MANAGEMENT SYSTEM
//Reset page so not to print unlimited pages
numberOfItemsPerPage = 0;
//It adds more page
e.HasMorePages = true;
//STOP HEAR ONLY AND GO UP AND NOT GO DOWN
return;
}

e.Graphics.DrawString
("---------------------------------------------------------------------------------------
-------------------------",
new Font("Arial", 15, FontStyle.Regular), Brushes.Blue, new Point(22, ypos));
e.Graphics.DrawString("Total Amount : Rs. " + proamount.Text.Trim(),
new Font("Arial", 15, FontStyle.Regular),
Brushes.Black, new Point(500, ypos + 30));

//FOR GST CALCULATE


decimal ttot = Convert.ToDecimal(totsalestax.ToString());
String b=Convert.ToString(ttot);
//

e.Graphics.DrawString("GST "+protax.SelectedItem+ "% : Rs. ",


new Font("Arial", 15, FontStyle.Regular),
Brushes.Red, new Point(500, ypos + 60));
e.Graphics.DrawString(" " +b.ToString(), new Font("Arial", 15,
FontStyle.Regular),
Brushes.Red, new Point(710, ypos + 60));
e.Graphics.DrawString("Total Pay : Rs. " + prototalamt.Text.Trim(),
new Font("Arial", 15, FontStyle.Regular),
Brushes.Black, new Point(500, ypos + 90));
e.Graphics.DrawString
("---------------------------------------------------------------------------------------
-------------------------",
new Font("Arial", 15, FontStyle.Regular), Brushes.Blue, new Point(22, ypos +
120));
e.Graphics.DrawString("Paid Amount : Rs. " + propaid.Text.Trim(), new
Font("Arial", 15, FontStyle.Regular),
Brushes.Blue, new Point(22, ypos + 170));
e.Graphics.DrawString("Total Pay : Rs. " + probalance.Text.Trim(),
new Font("Arial", 15, FontStyle.Regular),
Brushes.Blue, new Point(22, ypos + 200));
e.Graphics.DrawString("Authorized Signature", new Font("Arial", 15,
FontStyle.Regular),
Brushes.Black, new Point(600, ypos + 200));
e.Graphics.DrawString
("---------------------------------------------------------------------------------------
-------------------------",

74 | P a g e
INVENTORY MANAGEMENT SYSTEM
new Font("Arial", 15, FontStyle.Regular), Brushes.Blue, new Point(22, ypos +
230));

//RESET THE TWO VARIABLES TO SHOW CORRECT OUTPUT RATHER THEN


SHOWING ONLY 5 OUTPUTS
numberOfItemsPerPage = 0;
numberOfItemsPrintedSoFar = 0;
}

private void printreviewbutton_Click(object sender, EventArgs e)


{
printPreviewDialog1.Document = printDocument1;
printPreviewDialog1.ShowDialog();
}

public Pen Blue { get; set; }

private void pprint_Click(object sender, EventArgs e)


{
printDocument1.Print();
}

private void pname_SelectedIndexChanged(object sender, EventArgs e)


{

SqlCommand cmd=new SqlCommand("select PQuantity, PSaleprice from


[Product] where pname='"+pname.Text+"'",con);
con.Open();
//cmd.Connection = con;

cmd.ExecuteNonQuery();
SqlDataReader rd = cmd.ExecuteReader();
while(rd.Read())
{
String unit =(string) rd["PQuantity"].ToString();
pstock.Text = unit;
String amt = rd["PSaleprice"].ToString();
pamount.Text = amt;
punit.Text = "1";
}
con.Close();
}

private void Intrans_Load(object sender, EventArgs e)


{
// TODO: This line of code loads data into the 'inventoryloginDataSet2.Supplier'
table. You can move, or remove it, as needed.
this.supplierTableAdapter.Fill(this.inventoryloginDataSet2.Supplier);

75 | P a g e
INVENTORY MANAGEMENT SYSTEM
// TODO: This line of code loads data into the 'inventoryloginDataSet.Product'
table. You can move, or remove it, as needed.
this.productTableAdapter.Fill(this.inventoryloginDataSet.Product);
// IT DISPLAY EMPTY COMBOBOX
pname.SelectedIndex = -1;
tcomboBox.SelectedIndex = -1;
}

private void probalance_Enter(object sender, EventArgs e)


{
//FOR PAID AND BALANCE AMOUNT DETAILS
decimal p = Convert.ToDecimal(prototalamt.Text.ToString());
decimal q = Convert.ToDecimal(propaid.Text.ToString());
{
if (q > p)
{
MessageBox.Show("Please enter the valid Amount", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
ppaid.Focus();
}
else
{
decimal probal = Convert.ToDecimal(prototalamt.Text.ToString()) -
Convert.ToDecimal(propaid.Text.ToString());
probalance.Text = probal.ToString();
}
}
}
}
}

Outtrans.cs :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Inventory.Models;
using System.Data.SqlClient;
using Inventory.Properties;

namespace Inventory.ClientForms
{
public partial class Outtrans : Form

76 | P a g e
INVENTORY MANAGEMENT SYSTEM
{
SqlCommand com = new SqlCommand();
SqlConnection con = new SqlConnection();
SqlDataAdapter sda = new SqlDataAdapter();
DataSet ds = new DataSet();
DataTable dt = new DataTable();

public Outtrans()
{
con.ConnectionString = "Data Source=.\\SQLEXPRESS;Initial
Catalog=inventorylogin;Integrated
Security=True;MultipleActiveResultSets=true;";
InitializeComponent();
}

//VARIABLE DECLARATION
decimal totsalestax;
decimal taxtotalamount;
decimal totamount;

//LIST OBJECT CREATED HEAR TO USE FOR BINDING DATA WITH GRIDVIEW
private List<ogriditem> ogit = new List<ogriditem>();
//FOR PRINTING VARIABLES
private int numberOfItemsPerPage = 0;
private int numberOfItemsPrintedSoFar = 0;

private void opadd_Click(object sender, EventArgs e)


{
try
{
//VALADATION FOR PGOUUPBOX
if (ocustomer.SelectedIndex == -1)
{
MessageBox.Show("SELECT REQUIRED FIELD", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
ocustomer.Focus();
}

if (opname.SelectedIndex == -1)
{
MessageBox.Show("SELECT REQUIRED FIELD", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
opname.Focus();
}

else
{
con.Open();
int newstcok = Convert.ToInt32(opstock.Text) - Convert.ToInt32(opunit.Text);
com = new SqlCommand("update Product set PQuantity = '" + newstcok + "'
where PName = '" + opname.SelectedValue + "'", con);

77 | P a g e
INVENTORY MANAGEMENT SYSTEM
int n = com.ExecuteNonQuery();
if (n == 1)
{

ogriditem item = new ogriditem()


{
Productname = opname.Text,
stock = Convert.ToInt16(opstock.Text.Trim()),
unit = Convert.ToInt16(opunit.Text.Trim()),
amount = Convert.ToDecimal(opamount.Text.Trim()),
totalamount = Convert.ToInt16(opunit.Text.Trim()) *
Convert.ToDecimal(opamount.Text.Trim()),
date = Convert.ToDateTime(odate.Value)
};

//USING LIST TO BIND DATA WITH GRIDVIEW


ogit.Add(item);
ogridview.DataSource = null;
ogridview.DataSource = ogit;

opstock.Clear();
opunit.Clear();
opamount.Clear();
opname.Focus();
}
else
{
MessageBox.Show("Enter Valid Unit");
}
con.Close();
}
}
catch (Exception ex)
{
MessageBox.Show("Please Enter Required Field", ex.Message);
}

private void opdone_Click(object sender, EventArgs e)


{
totamount = ogit.Sum(x => x.totalamount);
oamount.Text = totamount.ToString();

//VALADATION FOR PGOUUPBOX


if (ocustomer.SelectedIndex == -1)
{
MessageBox.Show("SELECT REQUIRED FIELD", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
ocustomer.Focus();

78 | P a g e
INVENTORY MANAGEMENT SYSTEM
}

if (opname.SelectedIndex == -1)
{
MessageBox.Show("SELECT REQUIRED FIELD", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
opname.Focus();
}

else
{
//CLEAR OPERATION FOR TEXTBOX IN PGROUPBOX
opname.SelectedIndex = -1;
opstock.Clear();
opunit.Clear();
opamount.Clear();

//ENABLE DISABLE OPERATION FOR GROUPBOX


pgroupbox.Enabled = false;
paygroupbox.Enabled = true;
oamount.Focus();
ototalamt.Text = "0";
opaid.Text = "0";
obalance.Text = "0";

}
}

private void opneworder_Click(object sender, EventArgs e)


{
//ENABLE DISABLE OPERATION
oneworder.Enabled = false;
pgroupbox.Enabled = true;
osubmit.Enabled = true;
ocancel.Enabled = true;
oprint.Enabled = true;
ocustomer.Focus();
opstock.Text = "0";
opamount.Text = "0";
opunit.Text = "0";
}

private void ocancel_Click(object sender, EventArgs e)


{
//CLEAR OPERATION FOR PAYGROUPBOX TEXTBOXES
oamount.Clear();
otax.SelectedIndex = -1;
opaid.Clear();
ototalamt.Clear();
ogridview.DataSource = null;
ogit.Clear();

79 | P a g e
INVENTORY MANAGEMENT SYSTEM
obalance.Clear();
opname.SelectedIndex = -1;
opstock.Clear();
opunit.Clear();
opamount.Clear();

//ENABLE DISABLE OPERATION


ocancel.Enabled = false;
oneworder.Enabled = true;
pgroupbox.Enabled = false;
osubmit.Enabled = false;
ocancel.Enabled = false;
paygroupbox.Enabled = false;
oprint.Enabled = false;
}

private void osubmit_Click(object sender, EventArgs e)


{
//VALADATION FOR PAYGOUUPBOX
if (otax.SelectedIndex == -1)
{
MessageBox.Show("SELECT REQUIRED FIELD", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
otax.Focus();
}

if (ototalamt.Text.Trim() == String.Empty)
{
MessageBox.Show("Enter The Paid Amount", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
ototalamt.Focus();
}

else
{
con.ConnectionString = "Data Source=.\\SQLEXPRESS;Initial
Catalog=inventorylogin;Integrated Security=True;";

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


{
SqlCommand cmd = new SqlCommand("insert into TransOUT" +
"(Customername,Productname,Stock,Unit,Amount,Totalamount,Date)Values(@
Customername,'" + ogridview.Rows[i].Cells[0].Value + "','" +
ogridview.Rows[i].Cells[1].Value + "','" + ogridview.Rows[i].Cells[2].Value +
"','" + ogridview.Rows[i].Cells[3].Value + "','" +
ogridview.Rows[i].Cells[4].Value + "',@Date)", con);
con.Open();
cmd.Parameters.AddWithValue("@Customername", ocustomer.SelectedItem);
cmd.Parameters.AddWithValue("@Date", odate.Value);
cmd.ExecuteNonQuery();

80 | P a g e
INVENTORY MANAGEMENT SYSTEM
con.Close();
}
//pgridview.Rows.Clear();
Intrans ins = new Intrans();
//ins.MdiParent = this;
this.Hide();
ins.Show();
//this.Hide();

//CLEAR OPERATION FOR PAYGROUPBOX TEXTBOXES


oamount.Clear();
otax.SelectedIndex = -1;
opaid.Clear();
ototalamt.Clear();
oamount.Clear();
obalance.Clear();
ogit.Clear();

//ENABLE DISABLE OPERATION


ocancel.Enabled = false;
oneworder.Enabled = true;
pgroupbox.Enabled = false;
osubmit.Enabled = false;
ocancel.Enabled = false;
paygroupbox.Enabled = false;

MessageBox.Show("Data Stored Successfully");


}
}

private void otax_SelectedIndexChanged(object sender, EventArgs e)


{
if (otax.SelectedIndex == 0)
{
totsalestax = totamount;
ototalamt.Text = totsalestax.ToString();
}

if (otax.SelectedIndex == 1)
{
totsalestax = (8 * totamount) / 100;
taxtotalamount = totamount + totsalestax;
ototalamt.Text = taxtotalamount.ToString();
}

if (otax.SelectedIndex == 2)
{
totsalestax = (10 * totamount) / 100;
taxtotalamount = totamount + totsalestax;
ototalamt.Text = taxtotalamount.ToString();

81 | P a g e
INVENTORY MANAGEMENT SYSTEM
}

if (otax.SelectedIndex == 3)
{
totsalestax = (12 * totamount) / 100;
taxtotalamount = totamount + totsalestax;
ototalamt.Text = taxtotalamount.ToString();

if (otax.SelectedIndex == 4)
{
totsalestax = (16 * totamount) / 100;
taxtotalamount = totamount + totsalestax;
ototalamt.Text = taxtotalamount.ToString();

}
else
{

string itemname, unitchange;


private void ogridview_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
var hti = ogridview.HitTest(e.X, e.Y);
ogridview.Rows[hti.RowIndex].Selected = true;
contextMenuStrip1.Show(ogridview, e.X, e.Y);
itemname = ogridview.SelectedRows[0].Cells[0].Value.ToString();
unitchange = ogridview.SelectedRows[0].Cells[2].Value.ToString();
}
}

private void printDocument1_PrintPage(object sender,


System.Drawing.Printing.PrintPageEventArgs e)
{
Image image = Resources.shoesabhi;
e.Graphics.DrawImage(image, 100, 0, image.Width, image.Height);
e.Graphics.DrawString("Date : " + DateTime.Now.ToShortDateString(), new
Font("Arial", 15, FontStyle.Regular),
Brushes.Black, new Point(25, 180));
//
String nam = ocustomer.SelectedItem.ToString();
//
e.Graphics.DrawString("Customer Name : " + nam, new Font("Arial", 15,
FontStyle.Regular),

82 | P a g e
INVENTORY MANAGEMENT SYSTEM
Brushes.Black, new Point(25, 205));
//e.Graphics.DrawString("" + nam, new Font("Arial", 15, FontStyle.Regular),
// Brushes.Black, new Point(25, 215));

e.Graphics.DrawString
("---------------------------------------------------------------------------------------
-------------------------",
new Font("Arial", 15, FontStyle.Regular), Brushes.Blue, new Point(22, 230));
e.Graphics.DrawString("Product Name", new Font("Arial", 15,
FontStyle.Regular), Brushes.Black, new Point(30, 248));
e.Graphics.DrawString("Quantity", new Font("Arial", 15, FontStyle.Regular),
Brushes.Black, new Point(378, 245));
e.Graphics.DrawString("Unit Price", new Font("Arial", 15, FontStyle.Regular),
Brushes.Black, new Point(548, 245));
e.Graphics.DrawString("Total Price", new Font("Arial", 15, FontStyle.Regular),
Brushes.Black, new Point(696, 245));
e.Graphics.DrawString
("---------------------------------------------------------------------------------------
-------------------------",
new Font("Arial", 15, FontStyle.Regular), Brushes.Blue, new Point(22, 259));

int ypos = 280;

for (int i = numberOfItemsPrintedSoFar; i < ogit.Count; i++)


{
numberOfItemsPerPage++;
//PRINT ONLY 20 ITEMS ON ONE PAGE
if (numberOfItemsPerPage <= 15)
{
numberOfItemsPrintedSoFar++;

if (numberOfItemsPrintedSoFar <= ogit.Count)


{

e.Graphics.DrawString(ogit[i].Productname, new Font("Arial", 15,


FontStyle.Regular), Brushes.Black, new Point(30, ypos));
e.Graphics.DrawString(ogit[i].unit.ToString(), new Font("Arial", 15,
FontStyle.Regular), Brushes.Black, new Point(398, ypos));
e.Graphics.DrawString(ogit[i].amount.ToString(), new Font("Arial", 15,
FontStyle.Regular), Brushes.Black, new Point(568, ypos));
e.Graphics.DrawString(ogit[i].totalamount.ToString(), new Font("Arial", 15,
FontStyle.Regular), Brushes.Black, new Point(708, ypos));

ypos += 30;
}
else
{
//TO STOP PRINTING
e.HasMorePages = false;
}
}

83 | P a g e
INVENTORY MANAGEMENT SYSTEM
else
{
//Reset page so not to print unlimited pages
numberOfItemsPerPage = 0;
//It adds more page
e.HasMorePages = true;
//STOP HEAR ONLY AND GO UP AND NOT GO DOWN
return;
}

e.Graphics.DrawString
("---------------------------------------------------------------------------------------
-------------------------",
new Font("Arial", 15, FontStyle.Regular), Brushes.Blue, new Point(22, ypos));
e.Graphics.DrawString("Total Amount : Rs. " + oamount.Text.Trim(), new
Font("Arial", 15, FontStyle.Regular),
Brushes.Black, new Point(500, ypos + 30));

//FOR GST CALCULATE


decimal ttot = Convert.ToDecimal(totsalestax.ToString());
String b = Convert.ToString(ttot);
//

e.Graphics.DrawString("GST " + otax.SelectedItem + "% : Rs. ",


new Font("Arial", 15, FontStyle.Regular),
Brushes.Red, new Point(500, ypos + 60));
e.Graphics.DrawString(" " + b.ToString(), new Font("Arial", 15,
FontStyle.Regular),
Brushes.Red, new Point(710, ypos + 60));
e.Graphics.DrawString("Total Pay : Rs. " + ototalamt.Text.Trim(),
new Font("Arial", 15, FontStyle.Regular),
Brushes.Black, new Point(500, ypos + 90));
e.Graphics.DrawString
("---------------------------------------------------------------------------------------
-------------------------",
new Font("Arial", 15, FontStyle.Regular), Brushes.Blue, new Point(22, ypos +
120));
e.Graphics.DrawString("Paid Amount : Rs. " + opaid.Text.Trim(), new
Font("Arial", 15, FontStyle.Regular),
Brushes.Blue, new Point(22, ypos + 170));
e.Graphics.DrawString("Total Pay : Rs. " + obalance.Text.Trim(), new
Font("Arial", 15, FontStyle.Regular),
Brushes.Blue, new Point(22, ypos + 200));
e.Graphics.DrawString("Authorized Signature", new Font("Arial", 15,
FontStyle.Regular),
Brushes.Black, new Point(600, ypos + 200));
e.Graphics.DrawString

84 | P a g e
INVENTORY MANAGEMENT SYSTEM
("---------------------------------------------------------------------------------------
-------------------------",
new Font("Arial", 15, FontStyle.Regular), Brushes.Blue, new Point(22, ypos +
230));

//RESET THE TWO VARIABLES TO SHOW CORRECT OUTPUT RATHER THEN


SHOWING ONLY 5 OUTPUTS
numberOfItemsPerPage = 0;
numberOfItemsPrintedSoFar = 0;

private void oprint_Click(object sender, EventArgs e)


{
printDocument1.Print();
}

private void printreviewbutton_Click(object sender, EventArgs e)


{
printPreviewDialog1.Document = printDocument1;
printPreviewDialog1.ShowDialog();
}

private void opname_SelectedIndexChanged(object sender, EventArgs e)


{
SqlCommand cmd = new SqlCommand("select PQuantity, PSaleprice from
[Product] where pname='" + opname.Text + "'", con);
con.Open();
//cmd.Connection = con;

cmd.ExecuteNonQuery();
SqlDataReader rd = cmd.ExecuteReader();
while (rd.Read())
{
String unit = (string)rd["PQuantity"].ToString();
opstock.Text = unit;
String amt = rd["PSaleprice"].ToString();
opamount.Text = amt;
opunit.Text = "1";
}
con.Close();
}

private void Outtrans_Load(object sender, EventArgs e)


{
// TODO: This line of code loads data into the
'inventoryloginDataSet3.Customer' table. You can move, or remove it, as
needed.
this.customerTableAdapter.Fill(this.inventoryloginDataSet3.Customer);

85 | P a g e
INVENTORY MANAGEMENT SYSTEM
// TODO: This line of code loads data into the 'inventoryloginDataSet1.Product'
table. You can move, or remove it, as needed.
this.productTableAdapter.Fill(this.inventoryloginDataSet1.Product);
opname.SelectedIndex = -1;
ocustomer.SelectedIndex = -1;
}

private void obalance_Enter(object sender, EventArgs e)


{
//FOR PAID AND BALANCE AMOUNT DETAILS
decimal p = Convert.ToDecimal(ototalamt.Text.ToString());
decimal q = Convert.ToDecimal(opaid.Text.ToString());
{
if (q > p)
{
MessageBox.Show("Please enter the valid Amount", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
opaid.Focus();
}
else
{
decimal probal = Convert.ToDecimal(ototalamt.Text.ToString()) -
Convert.ToDecimal(opaid.Text.ToString());
obalance.Text = probal.ToString();
}
}
}

private void dToolStripMenuItem_Click(object sender, EventArgs e)


{
con.Open();
com = new SqlCommand("select PQuantity from Product where PName = '" +
itemname + "'", con);
using (SqlDataReader rd = com.ExecuteReader())
{
if (rd.Read())
{
int oldQ = Convert.ToInt32(rd["PQuantity"].ToString());
int changequan = oldQ + Convert.ToInt32(unitchange);
com = new SqlCommand("update Product set PQuantity = '" + changequan + "'
where PName = '" + itemname + "'", con);
com.ExecuteNonQuery();
}
}
con.Close();
int index = ogridview.CurrentCell.RowIndex;
ogit.RemoveAt(index);
ogridview.DataSource = null;
ogridview.DataSource = ogit;

totamount = ogit.Sum(x => x.totalamount);

86 | P a g e
INVENTORY MANAGEMENT SYSTEM
oamount.Text = totamount.ToString();

{
if (otax.SelectedIndex == 0)
{
totsalestax = totamount;
ototalamt.Text = totsalestax.ToString();
}

if (otax.SelectedIndex == 1)
{
totsalestax = (8 * totamount) / 100;
taxtotalamount = totamount + totsalestax;
ototalamt.Text = taxtotalamount.ToString();
}

if (otax.SelectedIndex == 2)
{
totsalestax = (10 * totamount) / 100;
taxtotalamount = totamount + totsalestax;
ototalamt.Text = taxtotalamount.ToString();

if (otax.SelectedIndex == 3)
{
totsalestax = (12 * totamount) / 100;
taxtotalamount = totamount + totsalestax;
ototalamt.Text = taxtotalamount.ToString();

if (otax.SelectedIndex == 4)
{
totsalestax = (16 * totamount) / 100;
taxtotalamount = totamount + totsalestax;
ototalamt.Text = taxtotalamount.ToString();

}
else
{

}
}
}
}
}

Product.cs :

87 | P a g e
INVENTORY MANAGEMENT SYSTEM
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;

namespace Inventory.Forms
{
public partial class Product : Form
{
SqlCommand com = new SqlCommand();
SqlConnection con = new SqlConnection();
SqlDataAdapter sda = new SqlDataAdapter();
DataSet ds = new DataSet();
string pids;
public Product()
{
con.ConnectionString = "Data Source=.\\SQLEXPRESS;Initial
Catalog=inventorylogin;Integrated Security=True;";
InitializeComponent();
}

private void pinsert_Click(object sender, EventArgs e)


{
try
{
String che = @"(Select count(*) from Product where PName='" + pname.Text
+ "')";
SqlCommand cmd = new SqlCommand("insert into Product
(PName,PDescription,PSaleprice,PPurchaseprice,PQuantity,PDate,PReorderlevel)
Values('" + pname.Text + "','" + pdescription.Text + "','" + psellprice.Text +
"','" + ppurchaseprice.Text + "','" + pquantity.Text + "','" + pdate.Text + "','" +
preorderlevel.Text + "')", con);
con.Open();
SqlCommand cmda = new SqlCommand(che, con);
int count = (int)cmda.ExecuteScalar();
if (count > 0)
{
MessageBox.Show("PRODUCT ALREADY EXIST");
}

else
{
cmd.ExecuteNonQuery();
MessageBox.Show("Record Saved In DataBase");
}

88 | P a g e
INVENTORY MANAGEMENT SYSTEM
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(" Please Enter The Required Field ", ex.Message);
}
finally
{
if (con.State == ConnectionState.Open)
con.Close();
}
pname.Clear();
pdescription.Clear();
psellprice.Clear();
ppurchaseprice.Clear();
pquantity.Clear();
preorderlevel.Clear();
// Ptax.Clear();
pname.Focus();

RetriveID();
}

private void prefresh_Click(object sender, EventArgs e)


{
// pid.Clear();
pname.Clear();
pdescription.Clear();
psellprice.Clear();
ppurchaseprice.Clear();
pquantity.Clear();
preorderlevel.Clear();
// Ptax.Clear();
pid.Focus();
RetriveID();
}

private void pdatagridview_MouseDoubleClick(object sender, MouseEventArgs


e)
{
pid.Text = pdatagridview.SelectedRows[0].Cells[0].Value.ToString();
pname.Text = pdatagridview.SelectedRows[0].Cells[1].Value.ToString();
pdescription.Text = pdatagridview.SelectedRows[0].Cells[2].Value.ToString();
psellprice.Text = pdatagridview.SelectedRows[0].Cells[3].Value.ToString();
ppurchaseprice.Text =
pdatagridview.SelectedRows[0].Cells[4].Value.ToString();
pquantity.Text = pdatagridview.SelectedRows[0].Cells[5].Value.ToString();
pdate.Text = pdatagridview.SelectedRows[0].Cells[6].Value.ToString();
preorderlevel.Text = pdatagridview.SelectedRows[0].Cells[7].Value.ToString();
}

89 | P a g e
INVENTORY MANAGEMENT SYSTEM
private void pshow_Click(object sender, EventArgs e)
{
String query = "Select * from Product";
SqlDataAdapter sda = new SqlDataAdapter(query, con);
DataTable dt = new DataTable();
sda.Fill(dt);
pdatagridview.DataSource = dt;
con.Close();
}

private void pdatagridview_MouseDown(object sender, MouseEventArgs e)


{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
var hti = pdatagridview.HitTest(e.X, e.Y);
pdatagridview.Rows[hti.RowIndex].Selected = true;
contextMenuStrip1.Show(pdatagridview, e.X, e.Y);
pids = pdatagridview.SelectedRows[0].Cells[0].Value.ToString();
}
}

//AUTOINCREMENT TEXTBOX
private void Product_Load(object sender, EventArgs e)
{
RetriveID();
}

private void RetriveID()


{
try
{
String query = "select PId from Product";
if (con.State == ConnectionState.Closed)
{
con.Open();
}
com = new SqlCommand(query, con);
SqlDataReader rd = com.ExecuteReader();
while (rd.Read())
{
int value = int.Parse(rd[0].ToString()) + 1;
pid.Text = value.ToString();
}
}
catch (Exception ex)
{
throw;
}
finally
{
if (con.State == ConnectionState.Open)

90 | P a g e
INVENTORY MANAGEMENT SYSTEM
{
con.Close();
}
}
}

private void contextMenuStrip1_Click(object sender, EventArgs e)


{
con.Open();
com = new SqlCommand("delete from Product where PId = '" + pids + "'",
con);
com.ExecuteNonQuery();
con.Close();
}

private void pupdate_Click(object sender, EventArgs e)


{
con.Open();
com = new SqlCommand("update Product set PName='" + pname.Text +
"',PDescription='" + pdescription.Text + "',PSaleprice='" + psellprice.Text +
"',PPurchaseprice='" + ppurchaseprice.Text + "',PQuantity='" + pquantity.Text
+ "',PDate='" + pdate.Text + "',PReorderlevel='" + preorderlevel.Text + "'
where PId='"+pid.Text+"'", con);
com.ExecuteNonQuery();
con.Close();
}
}
}

Stock.cs :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;

namespace Inventory.Forms
{
public partial class Stock : Form
{
SqlCommand cmd = new SqlCommand();
SqlConnection con = new SqlConnection();
SqlDataAdapter sda = new SqlDataAdapter();
DataSet ds = new DataSet();

91 | P a g e
INVENTORY MANAGEMENT SYSTEM
SqlDataReader mdr;

public Stock()
{
con.ConnectionString = "Data Source=.\\SQLEXPRESS;Initial
Catalog=inventorylogin;Integrated
Security=True;MultipleActiveResultSets=true";
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
String query = "select * from Product where PDate between'" +
dateTimePicker1.Text + "' AND '" + dateTimePicker2.Text + "'";
sda = new SqlDataAdapter(query, con);
DataTable dt = new DataTable();
sda.Fill(dt);
dataGridView1.DataSource = dt;
con.Close();
}

private void textBox1_TextChanged(object sender, EventArgs e)


{
con.Open();
if (comboBox1.Text == "Product ID")
{
sda = new SqlDataAdapter("select * from Product where PId like '" +
textBox1.Text + "%'", con);
DataTable dt = new DataTable();
sda.Fill(dt);
dataGridView1.DataSource = dt;
}

else if (comboBox1.Text == "Product Name")


{
sda = new SqlDataAdapter("select * from Product where PName like '" +
textBox1.Text + "%'", con);
DataTable dt = new DataTable();
sda.Fill(dt);
dataGridView1.DataSource = dt;
}
con.Close();
}

private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)


{
try
{
if (comboBox2.SelectedIndex == 0)
{

92 | P a g e
INVENTORY MANAGEMENT SYSTEM
sda = new SqlDataAdapter("select * from Product where PQuantity <
PReorderlevel", con);
DataTable dt = new DataTable();
sda.Fill(dt);
dataGridView1.DataSource = dt;
dataGridView1.Columns["PReorderlevel"].DefaultCellStyle.BackColor =
Color.Green;
dataGridView1.Columns["PQuantity"].DefaultCellStyle.BackColor = Color.Red;
}
else if (comboBox2.SelectedIndex == 1)
{
sda = new SqlDataAdapter("select * from Product where PQuantity > 500",
con);
DataTable dt = new DataTable();
sda.Fill(dt);
dataGridView1.DataSource = dt;
dataGridView1.Columns["PReorderlevel"].DefaultCellStyle.BackColor =
Color.Green;
dataGridView1.Columns["PQuantity"].DefaultCellStyle.BackColor = Color.Red;
}
else
{
comboBox2.SelectedIndex=-1;
}
comboBox2.SelectedIndex = -1;
}
catch (Exception ex)
{
MessageBox.Show("", ex.Message);

}
}
}
}

Supplieracc.cs :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;

namespace Inventory.Forms
{

93 | P a g e
INVENTORY MANAGEMENT SYSTEM
public partial class Supplieraccount : Form
{
SqlCommand com = new SqlCommand();
SqlConnection con = new SqlConnection();
SqlDataAdapter sda = new SqlDataAdapter();
DataSet ds = new DataSet();
string pids;

public Supplieraccount()
{
con.ConnectionString = "Data Source=.\\SQLEXPRESS;Initial
Catalog=inventorylogin;Integrated Security=True;";
InitializeComponent();
}

private void sinsert_Click(object sender, EventArgs e)


{
try
{
String che = @"(Select count(*) from Supplier where Sfname='" + sfname.Text
+ "')";
SqlCommand cmd = new SqlCommand("insert into Supplier
(Sfname,Slname,Saddress,Scontact1,Scontact2,Scountry,Sstate,Scity,Spincode
,Semail) Values('" + sfname.Text + "','" + slname.Text + "','" + saddress.Text
+ "','" + scontact1.Text + "','" + scontact2.Text + "','" + scountry.Text + "','" +
sstate.Text + "','" + scity.Text + "','" + spincode.Text + "','" + semail.Text +
"')", con);
con.Open();
SqlCommand cmda = new SqlCommand(che, con);
int count = (int)cmda.ExecuteScalar();
if (count > 0)
{
MessageBox.Show("PRODUCT ALREADY EXIST");
}

else
{
cmd.ExecuteNonQuery();
MessageBox.Show("Record Saved In DataBase");
}
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(" Please Enter The Required Field ", ex.Message);
}
finally
{
if (con.State == ConnectionState.Open)
con.Close();
}

94 | P a g e
INVENTORY MANAGEMENT SYSTEM
sfname.Clear();
slname.Clear();
saddress.Clear();
scountry.Clear();
sstate.Clear();
scity.Clear();
spincode.Clear();
scontact1.Clear();
scontact2.Clear();
semail.Clear();
sfname.Focus();

RetriveID();
}

private void supdate_Click(object sender, EventArgs e)


{
con.Open();
com = new SqlCommand("update Supplier set Sfname='" + sfname.Text +
"',Slname='" + slname.Text + "',Saddress='" + saddress.Text + "',Scontact1='"
+ scontact1.Text + "',Scontact2='" + scontact2.Text + "',Scountry='" +
scountry.Text + "',Sstate='" + sstate.Text + "',Scity='" + scity.Text +
"',Spincode='" + spincode.Text + "',Semail='" + semail.Text + "' where SId='"
+ sid.Text + "'", con);
com.ExecuteNonQuery();
con.Close();
MessageBox.Show("Data Updted Successfully");
}

private void srefresh_Click(object sender, EventArgs e)


{
sfname.Clear();
slname.Clear();
saddress.Clear();
scountry.Clear();
sstate.Clear();
scity.Clear();
spincode.Clear();
scontact1.Clear();
scontact2.Clear();
semail.Clear();
sfname.Focus();

RetriveID();
}

private void sshow_Click(object sender, EventArgs e)


{
String query = "Select * from Supplier";
SqlDataAdapter sda = new SqlDataAdapter(query, con);
DataTable dt = new DataTable();

95 | P a g e
INVENTORY MANAGEMENT SYSTEM
sda.Fill(dt);
sgridview.DataSource = dt;
con.Close();
}

private void RetriveID()


{
try
{
String query = "select SId from Supplier";
if (con.State == ConnectionState.Closed)
{
con.Open();
}
com = new SqlCommand(query, con);
SqlDataReader rd = com.ExecuteReader();
while (rd.Read())
{
int value = int.Parse(rd[0].ToString()) + 1;
sid.Text = value.ToString();
}
}
catch (Exception ex)
{
throw;
}
finally
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
}
}

private void Supplieraccount_Load(object sender, EventArgs e)


{
RetriveID();
}

private void sgridview_MouseDown(object sender, MouseEventArgs e)


{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
var hti = sgridview.HitTest(e.X, e.Y);
sgridview.Rows[hti.RowIndex].Selected = true;
contextMenuStrip1.Show(sgridview, e.X, e.Y);
pids = sgridview.SelectedRows[0].Cells[0].Value.ToString();
}
}

96 | P a g e
INVENTORY MANAGEMENT SYSTEM
private void contextMenuStrip1_Click(object sender, EventArgs e)
{
con.Open();
com = new SqlCommand("delete from Supplier where SId = '" + pids + "'",
con);
com.ExecuteNonQuery();
con.Close();
}

private void sgridview_MouseDoubleClick(object sender, MouseEventArgs e)


{
sid.Text = sgridview.SelectedRows[0].Cells[0].Value.ToString();
sfname.Text = sgridview.SelectedRows[0].Cells[1].Value.ToString();
slname.Text = sgridview.SelectedRows[0].Cells[2].Value.ToString();
saddress.Text = sgridview.SelectedRows[0].Cells[3].Value.ToString();
scontact1.Text = sgridview.SelectedRows[0].Cells[4].Value.ToString();
scontact2.Text = sgridview.SelectedRows[0].Cells[5].Value.ToString();
scountry.Text = sgridview.SelectedRows[0].Cells[6].Value.ToString();
sstate.Text = sgridview.SelectedRows[0].Cells[7].Value.ToString();
scity.Text = sgridview.SelectedRows[0].Cells[8].Value.ToString();
spincode.Text = sgridview.SelectedRows[0].Cells[9].Value.ToString();
semail.Text = sgridview.SelectedRows[0].Cells[10].Value.ToString();
}
}
}

Company.cs :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;

namespace Inventory.MasterForms
{
public partial class Company : Form
{
SqlCommand com = new SqlCommand();
SqlConnection con = new SqlConnection();
SqlDataAdapter sda = new SqlDataAdapter();
DataSet ds = new DataSet();
string pids;

public Company()

97 | P a g e
INVENTORY MANAGEMENT SYSTEM
{
con.ConnectionString = "Data Source=.\\SQLEXPRESS;Initial
Catalog=inventorylogin;Integrated Security=True;";
InitializeComponent();
}

private void cominsert_Click(object sender, EventArgs e)


{
try
{
String che = @"(Select count(*) from Company where Comname='" +
comname.Text + "')";
SqlCommand cmd = new SqlCommand("insert into Company
(Comname,Comaddress,Comcontactper,Comcontact1,Comcontact2,Comcountry
,Comstate,Comcity,Compincode,Comemail,Comwebsite) Values('" +
comname.Text + "','" + comaddress.Text + "','" + comcontactper.Text + "','" +
comcontact1.Text + "','" + comcontact2.Text + "','" + comcountry.Text + "','"
+ comstate.Text + "','" + comcity.Text + "','" + compincode.Text + "','" +
comemail.Text + "','" + comwebsite.Text + "')", con);
con.Open();
SqlCommand cmda = new SqlCommand(che, con);
int count = (int)cmda.ExecuteScalar();
if (count > 0)
{
MessageBox.Show("Employee ALREADY EXIST");
}

else
{
cmd.ExecuteNonQuery();
MessageBox.Show("Record Saved In DataBase");
//new Emailsend(comemail.Text, password.Text);
}
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(" Please Enter The Required Field ", ex.Message);
}
finally
{
if (con.State == ConnectionState.Open)
con.Close();
}
comname.Clear();
comcontactper.Clear();
comaddress.Clear();
comcountry.Clear();
comcontact1.Clear();
comcontact2.Clear();
comstate.Clear();

98 | P a g e
INVENTORY MANAGEMENT SYSTEM
comcity.Clear();
compincode.Clear();
comemail.Clear();
comwebsite.Clear();
comname.Focus();

RetriveID();

private void Company_Load(object sender, EventArgs e)


{
RetriveID();
}

private void RetriveID()


{
try
{
String query = "select ComId from Company";
if (con.State == ConnectionState.Closed)
{
con.Open();
}
com = new SqlCommand(query, con);
SqlDataReader rd = com.ExecuteReader();
while (rd.Read())
{
int value = int.Parse(rd[0].ToString()) + 1;
comid.Text = value.ToString();
}
}
catch (Exception ex)
{
throw;
}
finally
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
}
}

private void comgridview_MouseDown(object sender, MouseEventArgs e)


{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
var hti = comgridview.HitTest(e.X, e.Y);
comgridview.Rows[hti.RowIndex].Selected = true;

99 | P a g e
INVENTORY MANAGEMENT SYSTEM
contextMenuStrip1.Show(comgridview, e.X, e.Y);
pids = comgridview.SelectedRows[0].Cells[0].Value.ToString();
}
}

private void comshow_Click(object sender, EventArgs e)


{
String query = "Select * from Company";
SqlDataAdapter sda = new SqlDataAdapter(query, con);
DataTable dt = new DataTable();
sda.Fill(dt);
comgridview.DataSource = dt;
con.Close();
}

private void comgridview_MouseDoubleClick(object sender, MouseEventArgs e)


{
comid.Text = comgridview.SelectedRows[0].Cells[0].Value.ToString();
comname.Text = comgridview.SelectedRows[0].Cells[1].Value.ToString();
comaddress.Text = comgridview.SelectedRows[0].Cells[2].Value.ToString();
comcontactper.Text = comgridview.SelectedRows[0].Cells[3].Value.ToString();
comcontact1.Text = comgridview.SelectedRows[0].Cells[4].Value.ToString();
comcontact2.Text = comgridview.SelectedRows[0].Cells[5].Value.ToString();
comcountry.Text = comgridview.SelectedRows[0].Cells[6].Value.ToString();
comstate.Text = comgridview.SelectedRows[0].Cells[7].Value.ToString();
comcity.Text = comgridview.SelectedRows[0].Cells[8].Value.ToString();
compincode.Text = comgridview.SelectedRows[0].Cells[9].Value.ToString();
comemail.Text = comgridview.SelectedRows[0].Cells[10].Value.ToString();
comwebsite.Text = comgridview.SelectedRows[0].Cells[11].Value.ToString();
}

private void comrefresh_Click(object sender, EventArgs e)


{
comname.Clear();
comcontactper.Clear();
comaddress.Clear();
comcountry.Clear();
comcontact1.Clear();
comcontact2.Clear();
comstate.Clear();
comcity.Clear();
compincode.Clear();
comemail.Clear();
comwebsite.Clear();
comname.Focus();
comname.Focus();
RetriveID();

private void contextMenuStrip1_Click(object sender, EventArgs e)

100 | P a g e
INVENTORY MANAGEMENT SYSTEM
{
con.Open();
com = new SqlCommand("delete from Company where ComId = '" + pids + "'",
con);
com.ExecuteNonQuery();
con.Close();
}

private void comupdate_Click(object sender, EventArgs e)


{
con.Open();
com = new SqlCommand("update Company set Comname='" + comname.Text
+ "',Comaddress='" + comaddress.Text + "',Comcontactper='" +
comcontactper.Text + "',Comcontact1='" + comcontact1.Text +
"',Comcontact2='" + comcontact2.Text + "',Comcountry='" + comcountry.Text
+ "',Comstate='" + comstate.Text + "',Comcity='" + comcity.Text +
"',Compincode='" + compincode.Text + "',Comemail='" + comemail.Text +
"',Comwebsite='" + comwebsite.Text + "' where ComId='"+comid.Text+"'",
con);
com.ExecuteNonQuery();
con.Close();
MessageBox.Show("Data Updated Successfull");
}
}
}

Employee.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;

namespace Inventory.MasterForms
{
public partial class Employee : Form
{
SqlCommand com = new SqlCommand();
SqlConnection con = new SqlConnection();
SqlDataAdapter sda = new SqlDataAdapter();
DataSet ds = new DataSet();
String pids;

101 | P a g e
INVENTORY MANAGEMENT SYSTEM
public Employee()
{
con.ConnectionString = "Data Source=.\\SQLEXPRESS;Initial
Catalog=inventorylogin;Integrated Security=True;";
InitializeComponent();
}

private void einsert_Click(object sender, EventArgs e)


{
try
{
String che = @"(Select count(*) from Employee where Efname='" +
efname.Text + "')";
SqlCommand cmd = new SqlCommand("insert into Employee
(Efname,Elname,Epassword,Eaddress,Econtact1,Econtact2,Ecountry,Estate,Ecit
y,Epincode,Eemail) Values('" + efname.Text + "','" + elname.Text + "','" +
epassword.Text + "','" + eaddress.Text + "','" + econtact1.Text + "','" +
econtact2.Text + "','" + ecountry.Text + "','" + estate.Text + "','" + ecity.Text
+ "','" + epincode.Text + "','" + eemail.Text + "')", con);
con.Open();
SqlCommand cmda = new SqlCommand(che, con);
int count = (int)cmda.ExecuteScalar();
if (count > 0)
{
MessageBox.Show("Employee ALREADY EXIST");
}

else
{
cmd.ExecuteNonQuery();
MessageBox.Show("Record Saved In DataBase");
}
Emailsend es = new Emailsend(eemail.Text, "Employee Registration
successfull", "<html> <head><title>Employee Registration</title><body>" +
"<h4> Your UserName is </h4> <h3>" + efname.Text + "</h3> <h5> " +
"Your Password Is </h5> <h3>" + epassword.Text +
"</h3></body></html>", Password.Text, true);
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(" Please Enter The Required Field ", ex.Message);
}
finally
{
if (con.State == ConnectionState.Open)
con.Close();
}
efname.Clear();
elname.Clear();
epassword.Clear();

102 | P a g e
INVENTORY MANAGEMENT SYSTEM
eaddress.Clear();
ecountry.Clear();
econtact1.Clear();
econtact2.Clear();
estate.Clear();
ecity.Clear();
epincode.Clear();
eemail.Clear();
efname.Focus();

RetriveID();
}

private void eshow_Click(object sender, EventArgs e)


{
String query = "Select * from Employee";
SqlDataAdapter sda = new SqlDataAdapter(query, con);
DataTable dt = new DataTable();
sda.Fill(dt);
egridview.DataSource = dt;
con.Close();
}

private void RetriveID()


{
try
{
String query = "select EId from Employee";
if (con.State == ConnectionState.Closed)
{
con.Open();
}
com = new SqlCommand(query, con);
SqlDataReader rd = com.ExecuteReader();
while (rd.Read())
{
int value = int.Parse(rd[0].ToString()) + 1;
eid.Text = value.ToString();
}
}
catch (Exception ex)
{
throw;
}
finally
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
}

103 | P a g e
INVENTORY MANAGEMENT SYSTEM
}

private void egridview_MouseDown(object sender, MouseEventArgs e)


{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
var hti = egridview.HitTest(e.X, e.Y);
egridview.Rows[hti.RowIndex].Selected = true;
contextMenuStrip1.Show(egridview, e.X, e.Y);
pids = egridview.SelectedRows[0].Cells[0].Value.ToString();
}
}

private void egridview_MouseDoubleClick_1(object sender, MouseEventArgs e)


{
eid.Text = egridview.SelectedRows[0].Cells[0].Value.ToString();
efname.Text = egridview.SelectedRows[0].Cells[1].Value.ToString();
elname.Text = egridview.SelectedRows[0].Cells[2].Value.ToString();
epassword.Text = egridview.SelectedRows[0].Cells[3].Value.ToString();
eaddress.Text = egridview.SelectedRows[0].Cells[4].Value.ToString();
econtact1.Text = egridview.SelectedRows[0].Cells[5].Value.ToString();
econtact2.Text = egridview.SelectedRows[0].Cells[6].Value.ToString();
ecountry.Text = egridview.SelectedRows[0].Cells[7].Value.ToString();
estate.Text = egridview.SelectedRows[0].Cells[8].Value.ToString();
ecity.Text = egridview.SelectedRows[0].Cells[9].Value.ToString();
epincode.Text = egridview.SelectedRows[0].Cells[10].Value.ToString();
eemail.Text = egridview.SelectedRows[0].Cells[11].Value.ToString();
}

private void Employee_Load(object sender, EventArgs e)


{
RetriveID();
}

private void contextMenuStrip1_Click(object sender, EventArgs e)


{
con.Open();
com = new SqlCommand("delete from Employee where EId = '" + pids + "'",
con);
com.ExecuteNonQuery();
con.Close();
}

private void eupdate_Click(object sender, EventArgs e)


{
con.Open();
com = new SqlCommand("update Employee set Efname='" + efname.Text +
"',Elname='" + elname.Text + "',Epassword='" + epassword.Text +
"',Eaddress='" + eaddress.Text + "',Econtact1='" + econtact1.Text +
"',Econtact2='" + econtact2.Text + "',Ecountry='" + ecountry.Text +
"',Estate='" + estate.Text + "',Ecity='" + ecity.Text + "',Epincode='" +

104 | P a g e
INVENTORY MANAGEMENT SYSTEM
epincode.Text + "',Eemail='" + eemail.Text + "' where EId='" + eid.Text + "'",
con);
com.ExecuteNonQuery();
con.Close();
MessageBox.Show("Data Updated Successfull");
}

private void epassword_Enter(object sender, EventArgs e)


{
PasswordGenerate();
epassword.Text = PasswordGenerate();
}

public string PasswordGenerate()


{
string password = "";
Random rnd = new Random();

int rndnumber = rnd.Next(10000, 99999);


password = rndnumber.ToString();

return password;
}

private void erefresh_Click(object sender, EventArgs e)


{
efname.Clear();
elname.Clear();
epassword.Clear();
eaddress.Clear();
ecountry.Clear();
econtact1.Clear();
econtact2.Clear();
estate.Clear();
ecity.Clear();
epincode.Clear();
eemail.Clear();
efname.Focus();

}
}
}

105 | P a g e
INVENTORY MANAGEMENT SYSTEM
Login.cs :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Inventory.Forms;
using System.Threading;
using System.Data.SqlClient;

namespace Inventory
{
public partial class Form1 : Form
{
SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial
Catalog=inventorylogin;Integrated Security=True;Pooling=False");

public Form1()
{
Thread t = new Thread(new ThreadStart(SplashStart));
t.Start();
Thread.Sleep(5000);
InitializeComponent();
t.Abort();
}

public void SplashStart()


{
Application.Run(new Progressbar());
}

private void button1_Click(object sender, EventArgs e)


{
if (radioButton1.Checked)
{
SqlCommand cmd = new SqlCommand("SELECT * FROM LOGIN WHERE
USERNAME='" + textBox1.Text + "' and PASSWORD='" + textBox2.Text + "'",
con);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
con.Open();
sda.Fill(dt);
con.Close();

if (dt.Rows.Count > 0)
{
Masterpage master = new Masterpage();

106 | P a g e
INVENTORY MANAGEMENT SYSTEM
this.Hide();
master.Show();
}
else
{
MessageBox.Show("Invalid username or password", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

else if (radioButton2.Checked)
{
SqlCommand cmd = new SqlCommand("SELECT Efname,Epassword FROM
Employee WHERE Efname='" + textBox1.Text + "' and Epassword='" +
textBox2.Text + "'", con);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
con.Open();
sda.Fill(dt);
con.Close();

if (dt.Rows.Count > 0)
{
Clientmaster cmast = new Clientmaster();
this.Hide();
cmast.Show();
}
else
{
MessageBox.Show("Invalid username or password", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
{
MessageBox.Show("Select Required User", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}

private void button2_Click(object sender, EventArgs e)


{
textBox1.Text = "";
textBox2.Clear();
textBox1.Focus();
}

private void exitToolStripMenuItem_Click(object sender, EventArgs e)


{
this.Close();
}

107 | P a g e
INVENTORY MANAGEMENT SYSTEM
private void button3_Click(object sender, EventArgs e)
{
Application.Exit();
this.Close();
}
}
}

Masterpage.cs :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Inventory.ClientForms;
using Inventory.MasterForms;

namespace Inventory.Forms
{
public partial class Masterpage : Form
{
// private int childFormNumber = 0;

public Masterpage()
{
InitializeComponent();
}

private void customerToolStripMenuItem_Click(object sender, EventArgs e)


{
Customeraccount cacct = new Customeraccount();
cacct.MdiParent = this;
cacct.Show();
}

private void supplierToolStripMenuItem_Click(object sender, EventArgs e)


{
Supplieraccount supacct = new Supplieraccount();
supacct.MdiParent = this;
supacct.Show();
}

private void productToolStripMenuItem_Click(object sender, EventArgs e)


{
Product pro = new Product();

108 | P a g e
INVENTORY MANAGEMENT SYSTEM
pro.MdiParent = this;
pro.Show();
}

private void exitToolStripMenuItem_Click(object sender, EventArgs e)


{
this.Close();
}

private void Masterpage_FormClosing(object sender, FormClosingEventArgs e)


{
Application.Exit();
}

private void logoutToolStripMenuItem_Click(object sender, EventArgs e)


{
Form1 f1 = new Form1();
f1.Show();
}

private void addCompanyToolStripMenuItem_Click(object sender, EventArgs e)


{
Company com = new Company();
com.MdiParent = this;
com.Show();
}

private void addEmployeeToolStripMenuItem_Click(object sender, EventArgs e)


{
Employee emp = new Employee();
emp.MdiParent = this;
emp.Show();
}

private void iNSIDEToolStripMenuItem_Click(object sender, EventArgs e)


{
Intrans intras = new Intrans();
intras.MdiParent = this;
intras.Show();
}

private void oUTSIDEToolStripMenuItem_Click(object sender, EventArgs e)


{
Outtrans outtras = new Outtrans();
outtras.MdiParent = this;
outtras.Show();
}

private void stockToolStripMenuItem_Click(object sender, EventArgs e)


{
Stock st = new Stock();

109 | P a g e
INVENTORY MANAGEMENT SYSTEM
st.MdiParent = this;
st.Show();
}

private void transactionToolStripMenuItem_Click(object sender, EventArgs e)


{
TransINreport tin = new TransINreport();
tin.MdiParent = this;
tin.Show();
}
}
}

Progressbar.cs :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Inventory.Forms
{
public partial class Progressbar : Form
{
public Progressbar()
{
InitializeComponent();
}

private void timer1_Tick(object sender, EventArgs e)


{
progressBar1.Increment(1);
if (progressBar1.Value == 100)
timer1.Stop();
}
}
}

110 | P a g e
INVENTORY MANAGEMENT SYSTEM
Transreport.cs :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;

namespace Inventory.MasterForms
{
public partial class TransINreport : Form
{
SqlCommand cmd = new SqlCommand();
SqlConnection con = new SqlConnection();
SqlDataAdapter sda = new SqlDataAdapter();
DataSet ds = new DataSet();
SqlDataReader mdr;

public TransINreport()
{
con.ConnectionString = "Data Source=.\\SQLEXPRESS;Initial
Catalog=inventorylogin;Integrated Security=True;";
InitializeComponent();
}

private void TransINreport_Load(object sender, EventArgs e)


{
// TODO: This line of code loads data into the 'inventoryloginDataSet.Product'
table. You can move, or remove it, as needed.
this.productTableAdapter.Fill(this.inventoryloginDataSet.Product);
comboBox1.SelectedIndex = -1;
comboBox2.SelectedIndex = -1;

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)


{
try
{
if (comboBox1.SelectedIndex == 0)
{
sda = new SqlDataAdapter("select * from TransIN where Date between'" +
dateTimePicker1.Text + "' AND '" + dateTimePicker2.Text + "'", con);
DataTable dt = new DataTable();
sda.Fill(dt);

111 | P a g e
INVENTORY MANAGEMENT SYSTEM
dataGridView1.DataSource = dt;
}

else if (comboBox1.SelectedIndex == 1)
{
sda = new SqlDataAdapter("select * from TransOUT where Date between'" +
dateTimePicker1.Text + "' AND '" + dateTimePicker2.Text + "'", con);
DataTable dt = new DataTable();
sda.Fill(dt);
dataGridView1.DataSource = dt;
}
}
catch (Exception ex)
{
MessageBox.Show("",ex.Message);
}
}

private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)


{
if (comboBox1.SelectedIndex == 0)
{
sda = new SqlDataAdapter("select * from TransIN where Date between'" +
dateTimePicker1.Text + "' AND '" + dateTimePicker2.Text + "' AND
Productname='" + comboBox2.Text + "'", con);
DataTable dt = new DataTable();
sda.Fill(dt);
dataGridView1.DataSource = dt;
}
else if (comboBox1.SelectedIndex == 1)
{
sda = new SqlDataAdapter("select * from TransOUT where Date between'" +
dateTimePicker1.Text + "' AND '" + dateTimePicker2.Text + "' AND
Productname='" + comboBox2.Text + "'", con);
DataTable dt = new DataTable();
sda.Fill(dt);
dataGridView1.DataSource = dt;
}
}
}
}

112 | P a g e
INVENTORY MANAGEMENT SYSTEM

6. FUTURE ENHANCEMENT

FUTURE ENHANCEMENT:
113 | P a g e
INVENTORY MANAGEMENT SYSTEM
The future scope of the project includes:

 We can give more advances software for student


management desktop based application.
 We can add printer in future.
 We can give more advances for these desktop based
application as it is easy to understand and we can save our
time.
 Implement the backup mechanism for taking backup of
codebase and database on regular basis on different
servers.
 Integrate multiple load balancers to distribute the loads of
the system.
The above mentioned points are the enhancements which can be
done to increase the applicability and usage of this project. Here we
can maintain the records of student and fees. We hope that the
project will serve its purpose for which it is develop there by
underlying success of process.

114 | P a g e
INVENTORY MANAGEMENT SYSTEM

7. CONCLUSION

CONCLUSION:

The project was designed in such a way that future


modifications can be done easily.
115 | P a g e
INVENTORY MANAGEMENT SYSTEM
 Automation of the entire desktop based application can
improve efficiency of the project.
 The System has adequate scope for modification in future
if it is necessary.
 Updating of information becomes so easier.
 It effectively overcomes the delays in communication.
 It gives appropriate access to the authorized users
depending on their permissions.
 It provides a friendly graphical user interface which
proves to be better when compared to the existing
system.

116 | P a g e
INVENTORY MANAGEMENT SYSTEM

8. REFERENCE & BIBLIOGRAPHY

REFERENCE & BIBLIOGRAPH:

117 | P a g e
INVENTORY MANAGEMENT SYSTEM
The following books were referred during the analysis and execution
phase of the project.

WEBSITES:
 www.google.com
 www.youtube.com
 www.wikipedia.com
 www.microsoft.com

 www.slideshare.com

118 | P a g e

Potrebbero piacerti anche