You are on page 1of 144

Product details Checks

Allocate Employee details points Customer details Places nventory For Retailer Shop order Supplier details details Login Keep details Relogin Given Access Pays Have Modifyy Generates Given Places Given Pays Given

product_id:varchar Quantity:numeric s-price:numeric Add sales Details record() Employee Admin delete sales record() Admin Employee + Employee Admin << Employee includes>> Loginof join Creates a Date new + Admin Supplier Customer Place an Unit_Price Search and Add << << includes>> includes>> new customer Employee Firstname record record order << includes>> Purchase_product Sales_product Product supp_address cust_address Product Details Full fill the - Add << Add includes>> new new product supplier emp_address Sales Lastname Purchase record record look-up-for Class Name << includes>> product_id product_id product_size Image Image purchase_prodcut order display Add Update new customer existing Employee emp_id cust_id Username supp_id supplier record Record available quantity p_id:varchar Pay aproduct billproduct_id Update p_id order_id supp_id cust_id record attribute:data Process Data Data Entity Flow store type Genrate a emp_contact display Update details supplier employee order_id Password p_id record product_id:varchar Check stock Looks s_price -up-for Quantity supp_contact cust_contact product Functions/operations bill p_price Maintain Quantity:numeric details Looks Delete -up-for supplier emp_name s_date Type employee p_date record availiblity p-price:numeric Enquiry details p_quantity s_quantity product_name supp-email cust-email Genrate a display details Look-up-supplier product Salary Security_Question details Add purchase record() Buys aproduct product Delete supp_id supp_name cust_name record bill record() delete purchase details Delete display employee supplier Image Answer record Customer Genrate Bill Supplier + + details Modify Customer Details Admin/Login username:varchar Reloginpassword:varchar type:varchar security:varchar answer:varchar place order() cancle order() Generates Add customer() Delete customer() + Customer cust_id:varchar cust_name:varchar cust_address:varchar cust_email:varchar cust_contact:varchar cust_image:image

Admin details Login Manages


Purchase

SALES & INVENTORY FOR RETAILER SHOP


Salary
1.. * 1.. * 1.. * 1.. * 1.. * 1.. * 1.. * 1.. * 1.. * 1.. * 1.. * 1.. * 1.. * 1.. * 1.. * 1..
order purchase

1.. * 1.. *

A Project Report On

SALES & INVENTORY FOR RETAILER SHOP


Submitted By:Rakesh P. Salvi Akshay S. Suryavanshi Rajesh Kumar H. Yadav Academic Year: 2012-2013
Under The guidance of:

Prof. Preeti Basantani


Submitted in partial fulfillment of the requirements for qualifying B.Sc.-(I.T.), Semester VI Examination Smt. CHANDIBAI HIMATHMAL MANSUKHANI COLLEGE ULHASNAGAR- 3
2

UNIVERSITY OF MUMBAI Smt. CHANDIBAI HIMATHMAL MANSUKHANI COLLEGE OF ARTS, COMMERCE AND SCIENCE ULHASNAGAR- 3

Project certificate for B.Sc.-IT students

This is to certify that the project entitled Sales and Inventory For Retailer Shop Undertaken at the

SMT. C.H.M. COLLEGE ,ULHASANAGAR -3

by

Mr./Ms._____________________________ Seat no. __________________ in partial fulfillment of B.Sc. IT degree (Semester- VI) Examination 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 phases of the project.

Signature of Internal Guide

Signature HOD / In-charge / Coordinator

College seal C

INDEX
SR NO. Topic PAGE NO.

Abstract

Objective and Scope

Theoretical background and history

10

Problem definition

11

System analysis and design

13

System Planning

16

Gantt Chart

17

E-R Diagram

18

Use-Case Diagram

26

10

Class Diagram

32

11

Context Diagram

35

12

Data Flow Diagram

36

13

Screen layouts

40

14

Process Involved

46

15

Methodology Adopted

48

16

System Implementation

50

17

Details of Hardware and Software Used

52

18

System Maintenance and evaluation

57

19

Cost and Benefit analysis

59

20

Methodology used for testing

61

21

Test report, Reports

66

22

Coding

70

23

Data Dictionary

129

24

Acknowledgement

133

25

Bibliography

134

PREFACE
The major objective of this report is to define this scope and domain of the subject concern. The text in this report was carefully noted and scripted in a very semantic and a flowing manner. The text in this report has capacity to go beyond the more mechanics of project buildings. It serves as guide to develop deeper into the subject and to understand the exact goal of the project. It lays stress on graphical representations of the project parts, as it is very much clear that graphical representation is sure to have a larger impact on mind than a black and white text. The text, ranging from first to the last topic, is in simple language which should create no problem in understanding the finger point of the subject under consideration. We hope that this project report is well received and should be able to quench the thirst of knowledge of anybody, who wishes to understand the subject under study.

ABSTRACT
BALAJI TRADERS shop is an Retailer shop located in Vangani and has been providing service to customer since 7 years. It does not have any branches. This shop contains the products which are used for construction sites. These products are like cements, tor steel products, plastic products, etc. The main feature of this software is for optimal sales and inventory management processes. This software also provides Support for inventory management which helps you to record and track materials on the basis of both quantity and value. Using this software we can reduce costs for transportation, order fulfillment, and material handling while improving customer service. This software is user friendly and hence easy to use. This is a user friendly application and will help the owner to keep all the records and product details, in an efficient and easy way. The system used by BALAJI TRADERS has been using manual system. The basic details were stored in file format. The file management system had many disadvantages due to which maintaining the system was pretty difficult job. We have used Spiral methodology to develop this software project.

OBJECTIVE AND SCOPE OF THE PROJECT


The main objective of our project is to computerized the supplier and customer service system. The other objective of this system is to keep records of the complete inventory. It support for inventory management helps you record and track materials on the basis of both quantity and value. It improves cash flow, visibility, and decision making. We can track quantity and value of all our materials, perform physical inventory, and optimize our warehouse resources. The scope of this system is to provide user efficient working environment and more output can be generated through this. This system provides user friendly interface resulting in knowing each and every usability features of the system. This system helps in tracking records so that past records can be verified through them and one can make decisions based on the past records. This system completes the work in a very less time resulting in less time consumption and high level of efficiency. This system provides high level of security for data leaking as only admin people can access the database no changes can be made in it until it verifies the user login id and password.

10

THEORETICAL BACKGROUND AND HISTORY


The existing system which used in the BALAJI TRADERS shop is manual system. All the work is done manually. Because of this system the owner of the shop as well as employees get some difficulties to store the records about customers, suppliers, etc. The current manual system which is used in this shop is quite tedious, time consuming and less efficient and accurate in comparison to the computerized system. The system which is used in this shop has some disadvantages which are as follows:
1. 2. 3. 4. 5. 6.

Time consuming Less accurate Less efficient Lot of paper work Slow data processing Difficult to keep old records

11

PROBLEM DEFINITION
As we know manual system are quite tedious, time consuming and less efficient and accurate in comparison to the computerized system. So following are some disadvantages of the old system:

1.

Time consuming : As the records are to be manually maintained it consumes a lot of

time. Since old

data is store in files , lot of time is wasted in searching for

records as this is done manually.

2.

Less accurate: In manual system there are many chances of occurrence of human

errors.

3.

Less efficient: Due to lot of manual work updating and modification of data is very

difficult. So the system is less efficient.


12

4.

Lot of paper work : There is redundancy in data as most of the data are to be written in

most of the places. Due to which there is lots of paper work.

5.

Slow data processing : Due to huge amount of records and lots of writing work, the

processing of these records is very slow.

6.

Difficult to keep old records: As all the records written in files manually, there may be chance of loss

of important documents due to misplacement.

13

SYSTEM ANALYSIS AND DESIGN


Systems are created to solve problems. One can think of the systems approach as an organized way of dealing with a problem. In this dynamic world, the subject System Analysis and Design mainly deals with the software development activities.

OBJECTIVES:

Understand a system Understand the different phases of system developments life cycle Know the components of system analysis Know the components of system designing

DEFINING A SYSTEM:
14

A collection of components that work together to realize some objective forms a system. Basically there are three major components in every system, namely input, processing and output.

In a system the different components are connected with each other and they are interdependent. The objective of the system demands that some output is produced as a result of processing the suitable inputs. REQUIREMENT ANALYSIS STRUCTURE: The process of establishing the system to be developed and the constraints under which it must operate is called Requirements and capture an analysis.

SYSTEM ENGINEERING AND ANALYSIS: As software is always a part of a larger system, work begins by establishing requirements for all system elements and then allocating some subset of these requirements to software. In our project database management system, we mainly carried out this step by keeping in mind the
15

various things needed in a shop and understanding the need for such a system.

SOFTWARE REQUIREMENT ANALYSIS: The requirement gathering process is intensified and focused specifically on software. To understand the nature of the programs to be built, the software engineer must understand the information domain for software, as well as required functions, behavior, performance and interface. Here, I generated all the requirements of our system by calculating the needs of the software and then the output. FACT FINDING TECHNIQUES: In system analysis we have found number of fact finding techniques about the system, which is under study. These facts helped us to understand what the existing system is, the flow of the existing system and what the problems are in the existing system.

Fact finding by observation:

By observing the activities of the Retailer Shop, the system flow of the shop is examined. All the details of the shop process are given to the administrator. This report has to be maintained properly.

16

Fact finding by document analysis:


This method involves the collecting of desired documents. These documents were analyzed. This method was use to calculate the actual data element required in the system.

SYSTEM PLANNING

The planning of this system started way back in December 2012. I started with gathering all the basic requirements of the system, according to what the Shops requirements. We went down to the system design. After designing what the system layout would look like, we came to the creation of the database, following which we came down to the actual coding of the project. Later we tried various levels in the implementation and debugged the entire code. After coding, we provided the necessary security to the system. Then finally the system goes live.

17

When creating a software schedule, the planner begins with a set of tasks. Effort, duration and start date are then input for each task. In addition task may be assigned to specific individuals.

GANTT CHART
A Gantt chart is constructed with a horizontal axis representing the total time span of the project, broken down into increments (for example days, weeks months) and a vertical axis representing the tasks that make up the project. Horizontal bars are varying in lengths represents the sequences, timing and time span for the each task. This is graphically represented in the Gantt chart below: Dec-08 Requirement Gathering Planning Dec-20 Jan-8 Jan-20 Feb-28 March-28

18

Modelling Construction Testing Deployment

Planned Time

Actual Time

E-R Diagram

An Entity is a thing or object in real world that is distinguishable from

all set of objects. An entity set of same type that share same properties or attributes. An entity is represented by a set of attributes.

E-R diagram is a relationship between two entity sets. E-R diagram can express the overall structure of a database E-R diagram consists of the following major components: logically.

E-R diagrams are simple & clear.

19

Entity: An entity is an object or concept about which you want to store

information.

Relationships:

Relationships

illustrate

how

two

entities

share

information in the database structure.

Key attribute: A key attribute is the unique, distinguishing characteristic

of the entity. For example, an employee's social security number might be the employee's key attribute

Components of ER Diagram:Sr No. 1 Rectangle Represents entity set. 2 Ellipse Represents attribute. 3 Diamond Represents relationship. Shape Diagrams Description

Flow lines

Represents link b/n 2 entity set.

20

Double ellipse

Represents multivalued attributes.

Dashed ellipse

Denotes derived attributes. Represents weak entity set.

Double rectangle

Double diamond

Represents relationship set for weak entity set.

Line

Lines, which link attributes to entity set &entity setsto r relationship sets.

21

Entities & their attributes: Login:

Customer:

22

Supplier: Employee:

Product:

Purchase:

Sales:

23

Purchase_product:

Sales_product:

24

ER-Diagram

25

UseCase Diagrams
A use case diagram is a set of scenarios that describing an interaction between user and system. A use case diagram displays the relationship among actors & use cases. The 2 main components of use case diagram are use case and actor.

Diagrams:-

Actor

Use case

An actor represents a user or another system will interact with the system that you are modeling. A use case is an external view of the system that represents some action that might perform in order to complete a task.

Admin subsystem :

When new employee turns for job, admin add his details. Admin update the existing employee record look up- employee details.

26

Admin delete the employee record as well as product record. Admin update the product record look-up-product details. Admin display the employee & product details.

Supplier subsystem:

When admin purchases products from a new supplier, then admin adds If an existing supplier has made changes in his contact details, then If a supplier no longer exist nor admin has purchased any products from

his details.

admin updates in existing record.

him, admin deletes his record.

27

If admin wants to check for the details of a supplier, he can do so by

selecting the ID or Name of the supplier.

Employee subsystem:

Employee add new product record. When the customer place order,employee add his details. Employee display the customer & supplier record ,if required. If employee wants to check for the details of a supplier & customer as

well as product,he can do so by selecting the ID or name of the particuler entities.

Product subsystem:
28

Admin checks the stock whether the product is available or not,if it is

not, Available the he place order & creates a new record of product.

Supplier full fills the order & generates the proper bill. Admin pay the bill.

29

Customer Employee subsystem:

CLASS DIAGRAM
Class diagram are widely used to describe the types of objects in a system and their relationships. Class. Class diagrams model, class structure and contents using design elements such as classes, packages and objects. Class diagram describes three different perspectives when designing. These perspectives become evident as the diagram is created and help solidity the design.

Components of Class Diagram:


30

The class diagram is composed of three things:


1.

Name: It stores the name of class which is one of the components of the system.

It always starts with an uppercase letters.


2.

Attribute: These are nothing but the member variables of a particular class that

holds. It always begins with lowercase


3.

Operations: There are nothing but the member functions for methods of class that is

what functions are needed for the working of operations.

Components Symbol Class Name

Attributes list

Operations/Method list

31

Link lines representing association

Solid triangle representing direction of association

Plus operator for public items + Minus o perator for private members Hash operator for protected items # Cardinality *..1,1..1,*..*

32

Class Diagram:

Context diagram
A static model that describes other systems in the environment. Use a subsystem model to show other systems.

33

DATA FLOW DIAGRAMS


34

A data flow diagram is graphical tool used to describe and analyze movement of data through a system. These are the central tool and the basis from which the other components are developed. The transformation of data from input to output, through processed, may be described logically and independently of physical components associated with the system. These are known as the logical data flow diagrams. The physical data flow diagrams show the actual implements and movement of data between people, departments and workstations. A full description of a system actually consists of a set of data flow diagrams. Using two familiar notations Yourdon, Gane and Sarson notation develops the data flow diagrams. Each component in a DFD is labeled with a descriptive name. Process is further identified with a number that will be used for identification purpose. The development of DFDs is done in several levels. Each process in lower level diagrams can be broken down into a more detailed DFD in the next level. The lop-level diagram is often called context diagram. It consists a single process bit, which plays vital role in studying the current system. The process in the context level diagram is exploded into other process at the first level DFD.

DFD SYMBOLS:

In the DFD, there are four symbols


35

1. 2.

A square defines a source(originator) or destination of system data An arrow identifies data flow. It is the pipeline through which the

information flows
3.

A circle or a bubble represents a process that transforms incoming data An open rectangle is a data store, data at rest or a temporary repository of

flow into outgoing data flows.


4.

data.

DFD 1 For Employee:

36

verify

Failure success

DFD 1 For Admin:

37

verify
Success Failure

SCREEN LAYOUT:
SplashScreen.cs
38

39

Login.cs:

40

Home.cs:

41

Customer.cs:

42

Search customer.cs:

43

Edit product.cs:

44

Purchase.cs:

45

Type supplier.cs:

46

PurchaseDetails.cs:

47

purchaseReportByDate.cs:

48

Bill.cs:

PROCESS INVOLVED
Software project management is all about turning basic technology concepts into workable solutions. It involves taking a simple concept or idea

49

and overseeing its development until the product is ready to launch as a fully functioning and workable system. There are some key duties that are involved in softwadevelopment process that are:

Defining the project :


It defines the project scope, budget and time frame and determines the

project goals and requirements.

Planning the project :


Plotting each stage of the process assists in the smooth running of

the project and gives project directors clear goals for each project stage.

Allocating resources :
Various resources such as software tools, equipment and staff are

allocated to the project.

Scheduling the project :

50

Dates and deadlines are determined to meet the needs of the client but with realistic expectations of what is achievable within those time frames also considered.

Controlling, tracking and reporting :


These project management processes in place to ensure whether the

software is meeting the needs of the client and keeps the client informed on project developments.

Completion of the project :

The final report is submitted or a release order is signed once work is completed. It ensures that all systems are operating effectively.

METHODOLOGY ADOPTED
51

We have adopted spiral methodology for developing this software. The spiral model is similar to the incremental model, with more emphases placed on risk analysis. The spiral model has four phases: Planning, Risk Analysis, Engineering and Evaluation. A software project repeatedly passes through these phases in iterations (called Spirals in this model). The baseline spiral, starting in the planning phase, requirements is gathered and risk is assessed. Each subsequent spiral builds on the baseline spiral. Requirements are gathered during the planning phase. 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. Software is produced in the engineering phase, along with testing at the end of the phase. The evaluation phase allows the customer to evaluate the output of the project to date before the project continues to the next spiral. In the spiral model, the angular component represents progress, and the radius of the spiral represents cost.

52

ADVANTAGES:

High amount of risk analysis Good for large and mission-critical projects. Software is produced early in the software life cycle.

DISADVANTAGES:

Can be a costly model to use. Risk analysis requires highly specific expertise. Projects success is highly dependent on the risk analysis phase.

53

Doesnt work well for smaller projects.

SYSTEM IMPLEMENTATION
Implementation means to take into practice. A crucial phase in the system life cycle is the successful implementation of the new system design. Implementation includes all those activities that take place to convert from the old system to the new one. The new system may be completely new, replacing an existing manual or automated system. The proposed system is completely new system i.e. the existing system is manual. The Main Aspects of Implementation are as follows: -

Training Personnel: Even well designed system can succeed or fail because of the way they are operated and used. Therefore the quality of training received by the person involved with the system in various capacities helps in successful implementation of Proposed System.

Conversion Procedure: Conversion is the process of changing from the old system to the new one. It must be properly planned and executed. Four methods are common in use, they are
54

Parallel System Direct Conversion Pilot System Systems Phase-in For the proposed system Parallel System will be beneficial. Under this

approach, users continue to operate the old system in usual manner but they will also start using the new system this method is safest one because it ensures that in case of any problems in using the new system, the organization can still fall back to the old system without loss of time and money.

Demonstration: After the system is implemented and conversion is complete, demonstration of the system is given to persons directly or indirectly related with the system.

55

DETAILS OF HARDWARE AND SOFTWARE USED

Introduction to Database Language


SQL Server 2008
Microsoft SQL Server 2008 is a full-featured relational database

management system (RDBMS) that offers a variety of administrative tools to ease the burdens of database development, maintenance and administration. In this article, we'll cover six of the more frequently used tools: Enterprise Manager, Query Analyzer, SQL Profiler, Service Manager, Data Transformation Services and Books Online. Let's take a brief look at each: Enterprise Manager is the main administrative console for SQL Server installations. It provides you with a graphical "birds-eye" view of all of the SQL Server installations on your network. You can perform high-level administrative functions that affect one or more servers, schedule common maintenance tasks or create and modify the structure of individual databases. Query Analyzer offers a quick and dirty method for performing queries

56

against any of your SQL Server databases. It's a great way to quickly pull information out of a database in response to a user request, test queries before implementing them in other applications, create/modify stored Procedures.

SQL Profiler provides a window into the inner workings of your database. You can monitor many different event types and observe database performance in real time. SQL Profiler allows you to capture and replay system "traces" that log various activities. It's a great tool for optimizing databases with performance issues or troubleshooting particular problems. Service Manager is used to control the SQLServer (the main SQL Server process), MSDTC (Microsoft Distributed Transaction Coordinator) and SQLServer Agent processes. An icon for this service normally resides in the system tray of machines running SQL Server. You can use Service Manager Procedure.

INTRODUCTION TO ROGRAMMING

LANGUAGE:

Microsoft Visual Studio:


Microsoft Visual Studio is an integrated development environment (IDE)

from Microsoft. It is used to develop console and graphical user interface applications along with Windows Forms applications, web sites, web applications, and web services in both native code together with managed
57

code for all platforms supported by Microsoft Windows, Windows Mobile, Windows CE, .NET Framework, .NET Compact Framework and Microsoft Silverlight it can also develop windows presentation foundation(WPF) application.

Visual Studio includes a code editor supporting IntelliSense as well as code refactoring. The integrated debugger works both as a source-level debugger and a machine-level debugger. Other built-in tools include a forms designer for building GUI applications, web designer, class designer, and database schema designer. It accepts plug-ins that enhance the functionality at almost every levelincluding adding support for source-control systems (like Subversion and Visual SourceSafe) and adding new toolsets like editors and visual designers for domain-specific languages or toolsets for other aspects of the software development lifecycle . Visual Studio supports different programming languages by means of language services, which allow the code editor and debugger to support (to varying degrees) nearly any programming language, provided a languagespecific service exists. Built-in languages include C/C++[5] (via Visual C+ +), VB.NET (via Visual Basic .NET), C# (via Visual C#), and F# (as of Visual Studio 2010[6]). Support for other languages such as M, Python, and Ruby among others is available via language services installed separately. It
58

also supports XML/XSLT, HTML/XHTML, JavaScript and CSS. Individual language-specific versions of Visual Studio also exist which provide more limited language services to the user: Microsoft Visual Basic, Visual J#, Visual C#, and Visual C++. Microsoft provides "Express" editions of its Visual Studio 2010 components Visual Basic, Visual C#, Visual C++, and Visual Web Developer at no cost. Visual Studio 2012, 2010, 2008 and 2005 Professional

Editions, along with language-specific versions (Visual Basic, C++, C#, J#) of Visual Studio Express 2010 are available for free to students as downloads via Microsoft's DreamSpark program.

Features of Microsoft Visual Studio:

Code editor

The Visual Studio code editor also supports setting bookmarks in code for quick navigation. Other navigational aids include collapsing code blocks and incremental search, in addition to normal text search and regex search. The code editor also includes a multi-item clipboard and a task list.

Debugger

Visual Studio includes a debugger that works both as a source-level debugger and as a machine-level debugger. It works with both managed
59

code as well as native code and can be used for debugging applications written in any language supported by Visual Studio. In addition, it can also attach to running processes and monitor and debug those processes . The Visual Studio debugger can also create memory dumps as well as load them

later for debugging. The debugger can be configured to be launched when an application running outside the Visual Studio environment crashes.

Extensibility
Visual Studio allows developers to write extensions for Visual Studio to extend its capabilities. These extensions "plug into" Visual Studio and extend its functionality. Extensions come in the form of macros, add-ins, and packages. Macros represent repeatable tasks and actions that developers can record programmatically for saving, replaying, and distributing. Packages are created using the Visual Studio SDK and provide the highest level of extensibility.

HARDWARE REQUIREMENTS:

Processor: Pentium 4 or more for optimum performance RAM: Recommended 256MB Hard Disk: Minimum 20GB

60

SOFTWARE REQUIREMENTS:

Operating System - Certified Distribution of WINDOWS Visual Studio 2008(.NET with c#) Database(Backend) - SQL Server 8

SYSTEM MAINTENANCE AND EVALUATION


MAINTENANCE :
It has been estimated that maintenance of any software product usually requires much more effort than the effort necessary to develop the product. Many studies indicate that the relative effort of development of a typical system to its maintenance effort is roughly in the 40:60 ratios. Maintenance involves performing any one or more of the following three kinds of activities:

Correcting errors that were not discovered during the product Improving the implementation of the system and enhancing the

development phase. This is called Corrective maintenance.

Functionality of the system according to the customers requirements. This is called Perfective maintenance.
61

Porting the software to a new environment, e.g. to a new computer or to a

new operating system. This is called Adaptive maintenance.

EVALUATION:
Evaluation refers to a particular phase in the staged model where Substantial changes are made to the software. The proposals for change are the driver for system evaluation. Change identification and evaluation continues throughout the system lifetime. The process of evaluation is driven by requests for changes from different stakeholders. Software re-engineering is concerned with re-structuring and redocumenting software to make it easier to change. The business value of a system and its quality should determine the evaluation strategy that is used. The various goals of evaluation are: The evaluation adapts the application to the ever-changing user 2. The evaluation corrects the faults in the application. 3. Evaluation responds to both developer and user learning. The process in the evaluation depends on:

1.

and operating environment.

62

1. 2. 3.

The type of the software being maintained. The development processes used. The skills and the experience of the people involved.

COST AND BENEFIT ANALYSIS


Cost benefit analysis (CBA), sometimes called benefitcost analysis, is a systematic process for calculating and comparing benefits and costs of a project. Cost and Benefit Analysis is typically used by governments to evaluate the desirability of a given system in markets. Costbenefit analysis attempts to put all relevant costs and benefits on a common temporal footing. Cost-benefit analysis imposes an accounting framework that prescribes classes of benefits and costs to consider, means to measure them, and approaches for aggregating them. Cost-benefit calculations typically involve using time value of money formula. This is usually done by converting the future expected streams of costs and benefits to a present value amount. Cost-Benefit Analysis (CBA) estimates and totals up the equivalent money value of the benefits and costs to the community of projects to establish whether they are worthwhile.

63

A cost benefit analysis finds, quantifies, and adds all the positive factors. These are the benefits. Then it identifies, quantifies, and subtracts all the negatives, the costs. Cost-benefit analysis compares the expected financial gain derived from a particular set of actions with the expected cost of providing each

action to determine the most profitable option. The projected benefits of a plan or program are divided by its estimated total long-term cost. Cost-benefit analysis can break a multifaceted scenario down into discrete factors and then assist personnel in quantifying those factors and comparing their relative significance in numerical terms. Cost-benefit analysis is a term that refers both to: - a formal discipline used to help appraise, or assess, the case for a project or proposal, which itself is a process known as project appraisal; and - an informal approach to making decisions of any kind. PRINCIPLES OF THE COST-BENEFIT ANALYSIS:

There Must Be a Common Unit of Measurement. CBA Valuations Should Represent Consumers or Producers Valuations Benefits Are Usually Measured by Market Choices Gross Benefits of an Increase in Consumption is an Area under the

As Revealed by Their Actual Behaviour.


Demand
64

Curve

Some Measurements of Benefits Require the Valuation of Human Life The Analysis of a Project Should Involve a With Versus Without

Comparison

Cost Benefit Analysis Involves a Particular Study Area Double Counting of Benefits or Costs Must be avoided Decision Criteria for Projects

METHODOLOGY USED FOR TESTING


Software testing is a critical element of software quality assurance and represents the ultimate review of specification, design and code generation.

TEST CASE DESIGN:


The Software was tested using Black Box Testing. The Black Box Tests were performed to check whether the software functions are operational, that input is properly accepted and the output is correctly
65

produced. It was also used to check that the integrity of the external information is maintained.

TEST CASE FOR RETAILER SHOP:

If the user initially executes the software , the system should respond by

requesting the password.

If the password is incorrect, the system must display an error message

and asks the user to try again.


After the login is successful , the system should show the main menu The details of the employees, supplier, and customers are displayed when

appropriate buttons are pressed.

During deletion of any entry its information should be deleted from all

relations to avoid inconsistency.

After every updating of the records in the system ,the database is

refreshed with the updated values.

If the user enters number in place of name then error message is

displayed.

UNIT TESTING:

66

The Unit Testing focuses verification effort on the smallest unit of software design- the software component or the module. All the interface modules were checked to see whether information flows in and out as desired .The relations in the database are examined to ensure that data stored maintains its integrity during all steps in an algorithms execution.

INTEGRATION TESTING:
Integration Testing is a systematic technique for constructing the program structure while at the same time conducting tests to uncover errors associated with interfacing. For Integration Testing the Top-Down method

was used. Beginning with the main control module (main menu) modules (user interface forms) is integrated by moving downward through the control

hierarchy.

The

Top-Down

Integration

Testing

method

allowed

verification of decision points early in the test process. The decision making occurs at upper-level and hence made it possible for early recognition of major control problems.

VALIDATION TESTING:

67

The Validation Testing is used to check if the software functions in a manner that is expected by the user. However a reasonable amount of beta testing was done by making some people use the software and their feedback were taken into account. Thus beta testing helped to uncover those problems which could only be found out by the end-users. Software Testing is the process of executing a program or system with the intent of finding errors. Or, it involves any activity aimed at evaluating an attribute or capability of a program or system and determining that it meets its required results. Software is not unlike other physical processes where inputs are received and outputs are produced. Where software differs is in the manner in which it fails. Most physical systems fail in a fixed (and reasonably small) set of ways. By contrast, software can fail in many bizarre ways. Detecting all of the different failure modes for software is generally infeasible.

Typically, more than 50% percent of the development time is spent in testing. Testing is usually performed for the following purposes:

To improve quality.

68

As

computers

and

software

are

used

in

critical

applications, the outcome of a bug can be severe. Bugs can cause huge losses. Bugs in critical systems have caused airplane crashes, allowed space shuttle missions to go awry, halted trading on the stock market, and worse. Bugs can kill. Bugs can cause disasters. The so-called year 2000 (Y2K) bug has given birth to a cottage industry of consultants and programming tools dedicated to making sure the modern world doesn't come to a screeching halt on the first day of the next century. In a computerized embedded world, the quality and reliability of software is a matter of life and death. Quality means the conformance to the specified design requirement. Being correct, the minimum requirement of quality, means performing as required under specified circumstances. Debugging, a narrow view of software testing, is performed heavily to find out design defects by the programmer. The imperfection of human nature makes it almost impossible to make a moderately complex program correct the first time. Finding the problems and get them fixed ,is the purpose of debugging in programming phase.

69

For Verification & Validation (V&V)

Another important purpose of testing is verification and validation (V&V). Testing can serve as metrics. It is heavily used as a tool in the V&V process. Testers can make claims based on interpretations of the testing results, which either the product works under certain situations, or it does not work. We can also compare the quality among different products under the same specification, based on results from the same test. We cannot test quality directly, but we can test related factors to make quality visible. Quality has three sets of factors -functionality, engineering, and adaptability. These three sets of factors can be thought of as dimensions in the software quality space. Each dimension may be broken down into its component factors and considerations at successively lower levels of detail.

70

TESTREPORT
Editcustomer.cs

71

Searchsupplier.cs:

72

Editsupplier.cs:

73

Editproduct.cs:

REPORTS

74

purchaseReport.cs:

75

SalesReport.cs:

billReport.cs:

76

77

CODING
Login.cs
public partial class login : Form { public static String type; SqlCommand cmd; DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(); SqlDataReader dr; public login() { Thread t = new Thread(new ThreadStart(splashscreen)); t.Start(); Thread.Sleep(5000); InitializeComponent(); t.Abort(); } private void button1_Click(object sender, EventArgs e) { try
78

{ con.Open(); cmd = new SqlCommand("select * from login where username='" + textBox1.Text + "'AND password='" + textBox2.Text + "'AND type='"+comboBox1.Text+"'", con); dr = cmd.ExecuteReader(); if (dr.Read()) { type = dr.GetString(4); Home h = new Home(); h.ShowDialog(); textBox1.Text = ""; textBox2.Text = ""; comboBox1.Text = ""; } else { MessageBox.Show("Invalid Username Or Password"); } } catch (Exception E) {

79

MessageBox.Show(E.Message); } con.Close(); }

private void button2_Click(object sender, EventArgs e) { textBox1.Text = ""; textBox2.Text = ""; comboBox1.Items.Clear() ; }

Customer.cs
public partial class customer : Form { SqlConnection con = new SqlConnection("Data Source=RAJYADAV\\RAJYADAV;Initial Security=True"); SqlCommand cmd; DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter();
80

Catalog=retailerdb;Integrated

BindingSource bs = new BindingSource(); SqlDataReader dr;

private void button11_Click(object sender, EventArgs e) { try { Regex reg1 = new Regex(@"^[a-zA-Z1-9]+$"); Match m1 = reg1.Match(textBox1.Text); if (!(m1.Success)) { errorProvider1.SetError(textBox1, "Enter the correct id"); textBox1.Focus(); MessageBox.Show("Enter the correct id"); } else { Regex reg2 = new Regex(@"^[a-zA-Z ]+$"); Match m2 = reg2.Match(textBox2.Text); if (!(m2.Success)) { errorProvider1.SetError(textBox2, "Please Enter Ur name");

81

textBox2.Focus(); MessageBox.Show("Please Enter Ur name!"); } else { Regex reg3 = new Regex(@"^[a-zA-Z0-9 ,.()\n]+$"); Match m3 = reg3.Match(richTextBox1.Text); if (!(m3.Success)) { errorProvider1.SetError(richTextBox1, "Please Enter Address"); richTextBox1.Focus(); MessageBox.Show("Please Enter Address!"); } else { Regex reg4 = new Regex(@"^[_a-z0-9-]+(\.[_a-z0-9-] +)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$"); Match m4 = reg4.Match(textBox4.Text); if (!(m4.Success)) { errorProvider1.SetError(textBox4, "Enter the correct email id");

82

textBox4.Focus(); MessageBox.Show("Enter the correct email id"); } else { Regex reg5 = new Regex(@"^\b\d\d\d\d\d\d\d\d\d\d$"); Match m5 = reg5.Match(textBox5.Text); if (!(m5.Success)) { errorProvider1.SetError(textBox5, "Enter the correct 10 digit number"); textBox5.Focus(); MessageBox.Show("Enter the correct 10 digit number"); } else { con.Close(); con.Open(); String path = textBox3.Text; byte[] c_image2 = ReadFile2(path);//read image bytes into byte array

83

cmd = new SqlCommand("insert into customer values(@c_id,@c_name,@c_add,@c_email,@c_no,@c_image,@path)", con); cmd.CommandType = CommandType.Text; cmd.Parameters.AddWithValue("@c_id", textBox1.Text); cmd.Parameters.AddWithValue("@c_name", textBox2.Text); cmd.Parameters.AddWithValue("@c_add", richTextBox1.Text); cmd.Parameters.AddWithValue("@c_email", textBox4.Text); cmd.Parameters.AddWithValue("@c_no", textBox5.Text); cmd.Parameters.AddWithValue("@c_image", (object)c_image2); cmd.Parameters.AddWithValue("@path", path); cmd.ExecuteNonQuery(); MessageBox.Show("Data Inserted Successfully"); textBox2.Clear(); richTextBox1.Clear(); textBox4.Clear();

84

textBox5.Clear(); AutoIncrementID(); } }

} } }

con.Close(); }

catch (Exception E) { MessageBox.Show(E.Message); } finally { con.Close(); } }

85

private void customer_Load(object sender, EventArgs e) { con.Close(); AutoIncrementID(); textBox3.Text "D:\\RetailerShop(recent).old\\splashscreen\\Resources\\User-blueicon.png"; pictureBox1.Enabled = false; button10.Enabled = false; } private byte[] ReadFile2(string p)//open file into a filestream and read data in byte array { byte[] data = null;//intialize byte array with null value FileInfo f = new FileInfo(p);//get file size long num = f.Length; FileStream fs = new FileStream(p, FileMode.Open, FileAccess.Read);//read file BinaryReader br = new BinaryReader(fs);//read filestream into byte array data = br.ReadBytes((int)num);//read entire file so supply total no of bytes return data; } =

86

private void button12_Click(object sender, EventArgs e) { try { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Image File(*.jpg; *.jpeg; *.gif; *.bmp; *.png| *.jpg; *.jpeg; *.gif; *.bmp; *.png"; if (ofd.ShowDialog() == DialogResult.OK) { pictureBox1.Image = new Bitmap(ofd.FileName); textBox3.Text = ofd.FileName; }

} catch (Exception E) { MessageBox.Show(E.Message); } } private void button10_Click(object sender, EventArgs e) {

87

pictureBox1.Image = Image.FromFile("D:\\Retailer Shop(recent).old\\splashscreen\\Resources\\User-blue-icon.png"); textBox3.Text } = "D:\\Retailer Shop(recent).old\\splashscreen\\Resources\\User-blue-icon.png";

public void AutoIncrementID() { try { con.Close(); con.Open(); SqlCommand cmd = new SqlCommand("Select Max(cust_id) from customer", con); SqlDataReader dr = null; dr = cmd.ExecuteReader(); if (dr.Read()) { string s = dr[0].ToString(); if (s != "") { string[] ss = s.Split('C'); int r = Convert.ToInt32(ss[1]); textBox1.Text = "C" + (r + 1).ToString();

88

} else { textBox1.Text = "C1"; } }

con.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { con.Close(); } } private void textBox1_TextChanged(object sender, EventArgs e) { errorProvider1.Clear(); }

89

private void textBox2_TextChanged(object sender, EventArgs e) { errorProvider1.Clear(); } private void textBox4_TextChanged(object sender, EventArgs e) { errorProvider1.Clear(); } private void textBox5_TextChanged(object sender, EventArgs e) { errorProvider1.Clear(); } private void button2_Click(object sender, EventArgs e) { try { con.Close(); con.Open(); DialogResult dr; dr=MessageBox.Show("Once Record is Deleted there is no Undo\n Do you want to Continue??","Confirm Deletion",MessageBoxButtons.YesNo);

90

if (dr == DialogResult.Yes) { da.DeleteCommand = new SqlCommand("delete from customer where cust_id=@custid", con); da.DeleteCommand.Parameters.Add("@custid", SqlDbType.VarChar).Value = ds.Tables[0].Rows[bs.Position][0]; da.DeleteCommand.ExecuteNonQuery(); ds.Clear(); da.Fill(ds); } else { MessageBox.Show("Deletion Canceled"); } con.Close(); } catch (Exception E) { MessageBox.Show(E.Message); } con.Close(); }

91

private void button9_Click(object sender, EventArgs e) { try { Regex reg1 = new Regex(@"^[a-zA-Z1-9]+$"); Match m1 = reg1.Match(textBox1.Text); if (!(m1.Success)) { errorProvider1.SetError(textBox1, "Enter the correct id"); textBox1.Focus(); MessageBox.Show("Enter the correct id"); } else { Regex reg2 = new Regex(@"^[a-zA-Z ]+$"); Match m2 = reg2.Match(textBox2.Text); if (!(m2.Success)) { errorProvider1.SetError(textBox2, "Please Enter Ur name"); textBox2.Focus(); MessageBox.Show("Please Enter Ur name!"); } else

92

{ Regex reg3 = new Regex(@"^[a-zA-Z1-9 ,]+$"); Match m3 = reg3.Match(richTextBox1.Text); if (!(m3.Success)) { errorProvider1.SetError(richTextBox1, "Please Enter Address"); richTextBox1.Focus(); MessageBox.Show("Please Enter Address!"); }

else { Regex reg4 = new Regex(@"^[_a-z0-9-]+(\.[_a-z0-9-] +)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$"); Match m4 = reg4.Match(textBox4.Text); if (!(m4.Success)) { errorProvider1.SetError(textBox4, "Enter the correct email id"); textBox4.Focus(); MessageBox.Show("Enter the correct email id"); }

93

else { Regex reg5 = new Regex(@"^\b\d\d\d\d\d\d\d\d\d\d$"); Match m5 = reg5.Match(textBox5.Text); if (!(m5.Success)) { errorProvider1.SetError(textBox5, "Enter the correct 10 digit number"); textBox5.Focus(); MessageBox.Show("Enter the correct 10 digit number"); } else { con.Close(); con.Open(); String path = textBox3.Text; byte[] c_image1 = ReadFile1(textBox3.Text); da.UpdateCommand = new SqlCommand("update customer t_contact=@custcontact,c_image=@cimage,path=@path cust_id=@custid", con); set where cust_name=@custname,cust_add=@custadd,cust_email=@custemail,cus

94

da.UpdateCommand.Parameters.Add("@custname ", SqlDbType.VarChar).Value = textBox2.Text; da.UpdateCommand.Parameters.Add("@custadd", SqlDbType.VarChar).Value = richTextBox1.Text; da.UpdateCommand.Parameters.Add("@custemail ", SqlDbType.VarChar).Value = textBox4.Text; da.UpdateCommand.Parameters.Add("@custconta ct", SqlDbType.VarChar).Value = textBox5.Text; da.UpdateCommand.Parameters.Add("@cimage", SqlDbType.Image).Value = (Object)c_image1; da.UpdateCommand.Parameters.Add("@path", SqlDbType.NVarChar).Value = textBox3.Text; da.UpdateCommand.Parameters.Add("@custid", SqlDbType.VarChar).Value = ds.Tables[0].Rows[bs.Position][0]; da.UpdateCommand.ExecuteNonQuery(); ds.Clear(); da.Fill(ds);

button9.Visible = false; textBox2.ReadOnly = true; richTextBox1.ReadOnly = true; textBox4.ReadOnly = true; textBox5.ReadOnly = true;

95

button1.Visible = true; button2.Visible = true; button3.Visible = true; label3.Visible = false; pictureBox1.Enabled = false; button10.Enabled = false; button11.Visible = true; con.Close(); } } } } } } catch (Exception E) { MessageBox.Show(E.Message); } } private void button3_Click(object sender, EventArgs e) { button9.Visible = true;

96

textBox2.ReadOnly = false; richTextBox1.ReadOnly = false; textBox4.ReadOnly = false; textBox5.ReadOnly = false; button1.Visible = false; button2.Visible = false; label3.Visible = true; pictureBox1.Enabled = true; button10.Enabled = true; button11.Visible = false; button3.Visible = false; } private void button4_Click(object sender, EventArgs e) { bs.MoveFirst(); dgupdate(); con.Close(); con.Open(); String query = "select * from customer where cust_id='" + textBox1.Text + "'"; SqlCommand cmd = new SqlCommand(query, con); dr = cmd.ExecuteReader(); dr.Read(); String path = dr.GetString(6);

97

pictureBox1.ImageLocation = path; con.Close(); } private void dgupdate() { dataGridView1.ClearSelection(); dataGridView1.Rows[bs.Position].Selected = true; } private void button1_Click(object sender, EventArgs e) { button2.Enabled = true; button3.Enabled = true; groupBox2.Enabled = true; button9.Visible = false; textBox2.ReadOnly = true; richTextBox1.ReadOnly = true; textBox4.ReadOnly = true; textBox5.ReadOnly = true; button1.Visible = true; button2.Visible = true; button3.Visible = true; label3.Visible = false; pictureBox1.Enabled = false; button10.Enabled = false;

98

button11.Enabled = false; try { con.Close(); con.Open(); da.SelectCommand = new SqlCommand("SELECT cust_id,cust_name,cust_add,cust_email,cust_contact FROM customer", con); ds.Clear(); da.Fill(ds); dataGridView1.DataSource = ds.Tables[0]; bs.DataSource = ds.Tables[0]; textBox1.DataBindings.Add(new Binding("Text", bs, "cust_id")); textBox2.DataBindings.Add(new Binding("Text", bs, "cust_name")); richTextBox1.DataBindings.Add(new Binding("Text", bs, "cust_add")); textBox4.DataBindings.Add(new Binding("Text", bs, "cust_email"));

99

textBox5.DataBindings.Add(new Binding("Text", bs, "cust_contact")); textBox3.DataBindings.Add(new Binding("text", bs, "path")); String query = "select * from customer where cust_id='" + textBox1.Text + "'"; SqlCommand cmd = new SqlCommand(query, con); dr = cmd.ExecuteReader(); dr.Read(); String path = dr.GetString(6); pictureBox1.ImageLocation = path; con.Close(); } catch (Exception E) {

} button1.Enabled = false; } private void button6_Click(object sender, EventArgs e) { bs.MoveNext(); dgupdate();

100

con.Close(); con.Open(); String query = "select * from customer where cust_id='" + textBox1.Text + "'"; SqlCommand cmd = new SqlCommand(query, con); dr = cmd.ExecuteReader(); dr.Read(); String path = dr.GetString(6); pictureBox1.ImageLocation = path; con.Close(); } private void button5_Click(object sender, EventArgs e) { bs.MovePrevious(); dgupdate(); con.Close(); con.Open(); String query = "select * from customer where cust_id='" + textBox1.Text + "'"; SqlCommand cmd = new SqlCommand(query, con); dr = cmd.ExecuteReader(); dr.Read(); String path = dr.GetString(6);

101

pictureBox1.ImageLocation = path; con.Close(); } private void button7_Click(object sender, EventArgs e) { bs.MoveLast(); dgupdate(); con.Close(); con.Open(); String query = "select * from customer where cust_id='" + textBox1.Text + "'"; SqlCommand cmd = new SqlCommand(query, con); dr = cmd.ExecuteReader(); dr.Read(); String path = dr.GetString(6); pictureBox1.ImageLocation = path; con.Close(); }

SearchCustomer.cs
public partial class custbyid : Form { SqlConnection con = new SqlConnection("Data Source=RAJYADAV\\RAJYADAV;Initial Catalog=retailerdb;Integrated Security=True");
102

DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(); BindingSource bs = new BindingSource(); SqlCommand cmd = new SqlCommand(); SqlDataReader dr; private void button1_Click(object sender, EventArgs e) { try { Regex reg1 = new Regex(@"^[a-zA-Z1-9]+$"); Match m1 = reg1.Match(textBox1.Text); if (!(m1.Success)) { errorProvider1.SetError(textBox1, "Enter the correct id"); textBox1.Focus(); MessageBox.Show("Enter the correct id"); } else { con.Open();

103

da.SelectCommand = new SqlCommand("SELECT * FROM customer where cust_id=@custid", con); da.SelectCommand.Parameters.Add("@custid", SqlDbType.VarChar).Value = textBox1.Text; ds.Clear(); da.Fill(ds); cmd = new SqlCommand("SELECT * FROM customer where cust_id='" + textBox1.Text + "'", con); dr = cmd.ExecuteReader(); if (dr.Read()) { dataGridView1.DataSource = ds.Tables[0]; } else { MessageBox.Show("record not found"); } } } catch (Exception E) { MessageBox.Show(""+E);

104

} con.Close(); } private void button2_Click_2(object sender, EventArgs e) { try { Regex reg2 = new Regex(@"^[a-zA-Z]+$"); Match m2 = reg2.Match(textBox7.Text); if (!(m2.Success)) { errorProvider1.SetError(textBox7, "Please Enter Ur name"); textBox7.Focus(); MessageBox.Show("Please Enter Ur name!"); } else { con.Open(); da.SelectCommand = new SqlCommand("SELECT * FROM customer where cust_name =@custname", con); da.SelectCommand.Parameters.Add("@custname", SqlDbType.VarChar).Value = textBox7.Text; ds.Clear();

105

da.Fill(ds); cmd = new SqlCommand("SELECT * FROM customer where cust_name='" + textBox7.Text + "'", con); dr = cmd.ExecuteReader(); if (dr.Read()) { dataGridView1.DataSource = ds.Tables[0]; } else { MessageBox.Show("record not found"); } } } catch (Exception E) { MessageBox.Show("" + E); } con.Close(); } private void textBox1_TextChanged(object sender, EventArgs e) { errorProvider1.Clear();

106

} private void textBox7_TextChanged(object sender, EventArgs e) { errorProvider1.Clear(); } } }

EditProduct.cs
public partial class editproduct : Form { SqlConnection con = new SqlConnection("Data Source=RAJYADAV\\RAJYADAV;Initial Catalog=retailerdb;Integrated Security=True"); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(); BindingSource bs = new BindingSource(); public editproduct() { InitializeComponent(); } private void button6_Click(object sender, EventArgs e)
107

{ button7.Enabled = true; button8.Enabled = true; groupBox3.Enabled = true; try { con.Open(); da.SelectCommand = new SqlCommand("SELECT * FROM Product", con); ds.Clear(); da.Fill(ds); dataGridView1.DataSource = ds.Tables[0]; bs.DataSource = ds.Tables[0]; textBox1.DataBindings.Add(new Binding("Text", bs, "Product_id")); textBox2.DataBindings.Add(new Binding("Text", bs, "supp_id")); textBox5.DataBindings.Add(new Binding("Text", bs, "Product_name")); textBox6.DataBindings.Add(new Binding("Text", bs, "Product_size")); textBox3.DataBindings.Add(new Binding("Text", bs, "Product_quantity")); textBox4.DataBindings.Add(new Binding("Text", bs, "Unit_price"));

108

catch (Exception E) { } } private void button7_Click(object sender, EventArgs e) { try { DialogResult dr; dr = MessageBox.Show("Once Record is Deleted there is no Undo\n Do you want to Continue??", "Confirm Deletion", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { da.DeleteCommand = new SqlCommand("delete from Product where Product_id=@pid", con); da.DeleteCommand.Parameters.Add("@pid", SqlDbType.VarChar).Value = ds.Tables[0].Rows[bs.Position][0]; da.DeleteCommand.ExecuteNonQuery(); ds.Clear(); da.Fill(ds); } else

109

{ MessageBox.Show("Deletion Canceled"); } } catch (Exception E) { MessageBox.Show(E.Message); } } private void button8_Click(object sender, EventArgs e) { button5.Visible = true; textBox1.ReadOnly = false; textBox2.ReadOnly = false; textBox5.ReadOnly = false;

110

textBox6.ReadOnly = false; textBox3.ReadOnly = false; textBox4.ReadOnly = false; button6.Visible = false; button7.Visible = false; button8.Visible = false; label8.Visible = true; } private void button5_Click(object sender, EventArgs e) { try { Regex reg1 = new Regex(@"^[a-zA-Z1-9]+$"); Match m1 = reg1.Match(textBox1.Text); if (!(m1.Success)) { errorProvider1.SetError(textBox1, "Enter the correct id"); textBox1.Focus(); MessageBox.Show("Enter the correct id"); }

111

else { Regex reg2 = new Regex(@"^[a-zA-Z1-9]+$"); Match m2 = reg2.Match(textBox2.Text); if (!(m2.Success)) { errorProvider1.SetError(textBox2, "Enter the correct id"); textBox2.Focus(); MessageBox.Show("Enter the correct id"); }

else { Regex reg3 = new Regex(@"^[0-9]+$"); Match m3 = reg3.Match(textBox3.Text); if (!(m3.Success)) { errorProvider1.SetError(textBox3, "Enter the numeric value"); textBox3.Focus(); MessageBox.Show("Enter the numeric value"); } else { Regex reg4 = new Regex(@"^[0-9]+$");

112

Match m4 = reg4.Match(textBox4.Text); if (!(m4.Success)) { errorProvider1.SetError(textBox4, "Enter the numeric value"); textBox4.Focus(); MessageBox.Show("Enter the numeric value"); } else { if (textBox3.Text == "0") { MessageBox.Show("please enter the valid value"); } else { if (textBox4.Text == "0") { MessageBox.Show("please enter the valid value"); } else { da.UpdateCommand = new SqlCommand("update Product ity=@Productquantity,Unit_price=@prdprice where Product_id=@prdid", con); set supp_id=@suppid,Product_name=@prdnm,Product_size=@prdsize,Product_quant

113

da.UpdateCommand.Parameters.Add("@suppid", SqlDbType.VarChar).Value = textBox2.Text;

da.UpdateCommand.Parameters.Add("@prdnm", SqlDbType.VarChar).Value = textBox5.Text; da.UpdateCommand.Parameters.Add("@prdsize", SqlDbType.VarChar).Value = textBox6.Text; da.UpdateCommand.Parameters.Add("@Productquantity" , SqlDbType.Int).Value = textBox3.Text; da.UpdateCommand.Parameters.Add("@prdprice", SqlDbType.Int).Value = textBox4.Text; da.UpdateCommand.Parameters.Add("@prdid", SqlDbType.VarChar).Value = ds.Tables[0].Rows[bs.Position][0];

da.UpdateCommand.ExecuteNonQuery(); label8.Visible = false; button5.Visible = false; textBox1.ReadOnly = true; textBox2.ReadOnly = true; textBox5.ReadOnly = true; textBox6.ReadOnly = true;

114

textBox3.ReadOnly = true; textBox4.ReadOnly = true; button6.Visible = true; button7.Visible = true; button8.Visible = true; } } } } } } } catch (Exception E) {} } private void button1_Click(object sender, EventArgs e) { bs.MoveFirst(); dgupdate(); } private void dgupdate() {

115

dataGridView1.ClearSelection(); dataGridView1.Rows[bs.Position].Selected = true; }

private void button2_Click(object sender, EventArgs e) { bs.MovePrevious(); dgupdate(); } private void button3_Click(object sender, EventArgs e) { bs.MoveNext(); dgupdate(); } private void button4_Click(object sender, EventArgs e) { bs.MoveLast(); dgupdate(); } private void button9_Click(object sender, EventArgs e)

116

{ this.Close(); } private void label8_Click(object sender, EventArgs e) { } private DataGridViewCellEventArgs e) { MessageBox.Show("Please Select the Buttons given Below\n select the information"); } private void editproduct_Load(object sender, EventArgs e) { } } } to void dataGridView1_CellClick(object sender,

117

Purchase.cs
public partial class Purchase : Form { SqlConnection con = new SqlConnection("Data Source=RAJYADAV\\RAJYADAV;Initial Catalog=retailerdb;Integrated Security=True"); SqlCommand cmd; SqlDataReader dr; SqlDataAdapter da = new SqlDataAdapter(); public Purchase() { InitializeComponent(); } private void label1_Click(object sender, EventArgs e) { } private void label3_Click(object sender, EventArgs e) {

118

} private void button6_Click(object sender, EventArgs e) { Application.Exit(); } private void button5_Click(object sender, EventArgs e) { } private void button4_Click(object sender, EventArgs e) { textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; } private void button1_Click(object sender, EventArgs e) { try { if (textBox4.Text == "0")

119

{ MessageBox.Show("please enter the valid value"); } else { if (textBox5.Text == "0") { MessageBox.Show("please enter the valid value"); } else { con.Open(); int i = Convert.ToInt32(textBox4.Text); cmd = new SqlCommand("select * from Product where Product_id='" + textBox3.Text + "'", con); dr = cmd.ExecuteReader(); if (dr.Read()) { con.Close(); con.Open(); da.UpdateCommand = new SqlCommand("update Product set Product_quantity=Product_quantity+" + i + "where Product_id=@Productid", con);

120

da.UpdateCommand.Parameters.Add("@Productid", SqlDbType.VarChar).Value = textBox3.Text; da.UpdateCommand.ExecuteNonQuery(); MessageBox.Show("Data Updated Successfully");

cmd = new SqlCommand("insert into Purchase values(@p_id,@s_id,@p_date)", con); cmd.Parameters.AddWithValue("@p_id", textBox1.Text); cmd.Parameters.AddWithValue("@s_id", textBox2.Text); cmd.Parameters.AddWithValue("@p_date", dateTimePicker1.Value); cmd.ExecuteNonQuery(); cmd = new SqlCommand("insert into Purchase_Product values(@p_id,@prod_id,@p_qty,@p_price)", con); cmd.Parameters.AddWithValue("@p_id", textBox1.Text); cmd.Parameters.AddWithValue("@prod_id", textBox3.Text); cmd.Parameters.AddWithValue("@p_qty", textBox4.Text);

121

cmd.Parameters.AddWithValue("@p_price", textBox5.Text); cmd.ExecuteNonQuery(); MessageBox.Show("record Inserted"); } } } }

catch (Exception E) { MessageBox.Show(E.Message); } con.Close(); } private void groupBox1_Enter(object sender, EventArgs e) { } private void button5_Click_1(object sender, EventArgs e) { this.Close();

122

} } }

PurchaseDetail.cs
public partial class purchasedetail : Form { SqlConnection con = new SqlConnection("Data Source=RAJYADAV\\RAJYADAV;Initial Catalog=retailerdb;Integrated Security=True"); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(); BindingSource bs = new BindingSource(); public purchasedetail() { InitializeComponent(); if (login.type == "Employee") { button2.Visible = false; } }

123

private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { } private void button5_Click(object sender, EventArgs e) { Application.Exit(); } private void button4_Click(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { try { con.Open(); da.SelectCommand = new SqlCommand("select Purchase_Product.p_id,Purchase.supp_id,Purchase_Product.Product_id,Purchase_

124

Product.p_qty,Purchase_Product.p_price,Purchase.p_date ds.Clear(); da.Fill(ds); dataGridView1.DataSource = ds.Tables[0]; bs.DataSource = ds.Tables[0];

from

Purchase_Product,Purchase where Purchase_Product.p_id=Purchase.p_id", con);

textBox1.DataBindings.Add(new Binding("Text", bs, "Product_id")); } catch (Exception E) { MessageBox.Show(E.Message); } } private void button3_Click(object sender, EventArgs e) { this.Close(); } private void button2_Click(object sender, EventArgs e) {

DialogResult dr;

125

dr = MessageBox.Show("Are You Sure Want To Delete Record ", "confirm deletion", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { da.DeleteCommand = new SqlCommand("delete from Purchase_Product where p_id=@pid", con); da.DeleteCommand.Parameters.Add("@pid", SqlDbType.VarChar).Value = ds.Tables[0].Rows[bs.Position][0]; da.DeleteCommand.ExecuteNonQuery();

da.DeleteCommand = new SqlCommand("delete from Purchase where p_id=@pid", con); da.DeleteCommand.Parameters.Add("@pid", SqlDbType.VarChar).Value = ds.Tables[0].Rows[bs.Position][0]; da.DeleteCommand.ExecuteNonQuery(); ds.Clear(); da.Fill(ds); } else { MessageBox.Show("Deletion Canceled"); } }

126

private void dataGridView1_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) { } private void button4_Click_1(object sender, EventArgs e) { bs.MoveFirst(); dgupdate(); }

private void button5_Click_1(object sender, EventArgs e) { bs.MovePrevious(); dgupdate(); } private void button6_Click(object sender, EventArgs e) { bs.MoveNext(); dgupdate();

127

} private void button7_Click(object sender, EventArgs e) { bs.MoveLast(); dgupdate(); } private void dgupdate() { dataGridView1.ClearSelection(); dataGridView1.Rows[bs.Position].Selected = true; }

private void button8_Click(object sender, EventArgs e) { purchasereport pr = new purchasereport(); pr.ShowDialog(); } private void groupBox1_Enter(object sender, EventArgs e) { } }

128

Billform.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.Deployment.Application; using System.Diagnostics; namespace splashscreen { public partial class biilform : Form { SqlConnection con = new SqlConnection("Data Source=RAJYADAV\\RAJYADAV;Initial Catalog=retailerdb;Integrated Security=True"); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter();
129

BindingSource bs = new BindingSource(); SqlDataReader dr; SqlCommand cmd = new SqlCommand(); public biilform() { InitializeComponent(); } private void biilform_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { try { con.Open(); cmd = new SqlCommand("insert into bill values(@bid,@pname,@psize,@price)", con); cmd.CommandType = CommandType.Text; cmd.Parameters.AddWithValue("@bid", textBox1.Text); cmd.Parameters.AddWithValue("@pname", comboBox1.Text); cmd.Parameters.AddWithValue("@psize", comboBox2.Text);

130

cmd.Parameters.AddWithValue("@price", comboBox3.Text); cmd.ExecuteNonQuery(); MessageBox.Show("data inserted successfully"); da.SelectCommand = new SqlCommand("SELECT prod_name,prod_size,u_price FROM Bill where bill_no=@billno", con); da.SelectCommand.Parameters.Add("@billno", SqlDbType.VarChar).Value = textBox1.Text; ds.Clear(); da.Fill(ds); dataGridView1.DataSource = ds.Tables[0]; con.Close(); } catch (Exception E) { MessageBox.Show(E.Message); } } private void comboBox1_SelectedValueChanged(object sender, EventArgs e) { if (comboBox1.SelectedItem == "Cement") { comboBox2.Items.Clear(); object o1 = new object();

131

o1 = "ambuja 50 kg"; object o2 = new object(); o2 = "birla 50 kg"; object o3 = new object(); o3 = "ACC 50 kg"; object o4 = new object(); o4 = "Altratech 50 kg"; object o5 = new object(); o5 = "Binani 50 kg"; object o6 = new object(); o6 = "ambuja 100 kg"; object o7 = new object(); o7 = "birla 100 kg"; object o8 = new object(); o8 = "ACC 100 kg"; object o9 = new object(); o9 = "Altratech 100 kg"; object o10 = new object(); o10 = "Binani 100 kg"; comboBox2.Items.Add(o1); comboBox2.Items.Add(o2); comboBox2.Items.Add(o3); comboBox2.Items.Add(o4); comboBox2.Items.Add(o5);

132

comboBox2.Items.Add(o6); comboBox2.Items.Add(o7); comboBox2.Items.Add(o8); comboBox2.Items.Add(o9); comboBox2.Items.Add(o10); } if (comboBox1.SelectedItem == "Tor Steel") { comboBox2.Items.Clear(); object o1 = new object(); o1 = "8.00 mmq"; object o2 = new object(); o2 = "10.00 mmq"; object o3 = new object(); o3 = "12.00 mmq"; object o4 = new object(); o4 = "16.00 mmq"; comboBox2.Items.Add(o1); comboBox2.Items.Add(o2); comboBox2.Items.Add(o3); comboBox2.Items.Add(o4); } if (comboBox1.SelectedItem == "Plastic") { comboBox2.Items.Clear();

133

object o1 = new object(); o1 = "m.s. pipe 1/2"; object o2 = new object(); o2 = "m.s. pipe 1"; object o3 = new object(); o3 = "m.s. pipe 1+1/2"; object o4 = new object(); o4 = "m.s. pipe 2"; comboBox2.Items.Add(o1); comboBox2.Items.Add(o2); comboBox2.Items.Add(o3); comboBox2.Items.Add(o4); } if (comboBox1.SelectedItem == "Flooring Tiles") { comboBox2.Items.Clear(); object o1 = new object(); o1 = "2''x 2''"; object o2 = new object(); o2 = "12''x 8''"; object o3 = new object(); o3 = "12''x 12''"; object o4 = new object(); o4 = "16''x 16''";

134

object o5 = new object(); o5 = "18''x 10''"; comboBox2.Items.Add(o1); comboBox2.Items.Add(o2); comboBox2.Items.Add(o3); comboBox2.Items.Add(o4); comboBox2.Items.Add(o5); } if (comboBox1.SelectedItem == "Plumbing Pipes") { comboBox2.Items.Clear(); object o1 = new object(); o1 = "1/2''"; object o2 = new object(); o2 = "3/4''"; object o3 = new object(); o3 = "1''"; object o4 = new object(); o4 = "1+1/2''"; object o5 = new object(); o5 = "2''"; comboBox2.Items.Add(o1); comboBox2.Items.Add(o2); comboBox2.Items.Add(o3);

135

comboBox2.Items.Add(o4); comboBox2.Items.Add(o5); } } private void button3_Click(object sender, EventArgs e) { } private void button2_Click(object sender, EventArgs e) {

// creating Excel Application Microsoft.Office.Interop.Excel._Application app Microsoft.Office.Interop.Excel.Application(); = new

// creating new WorkBook within Excel application Microsoft.Office.Interop.Excel._Workbook workbook = app.Workbooks.Add(Type.Missing);

// creating new Excelsheet in workbook

136

Microsoft.Office.Interop.Excel._Worksheet worksheet = null; // see the excel sheet behind the program app.Visible = true;

// get the reference of first sheet. By default its name is Sheet1. // store its reference to worksheet worksheet = workbook.Sheets["Sheet1"]; worksheet = workbook.ActiveSheet; // changing the name of active sheet worksheet.Name = "Exported from gridview";

// storing header part in Excel for(int i=1;i<dataGridView1.Columns.Count+1;i++) { worksheet.Cells[1, i] = dataGridView1.Columns[i-1].HeaderText; }

// storing Each row and column value to excel sheet for (int i=0; i < dataGridView1.Rows.Count-1 ; i++)

137

{ for(int j=0;j<dataGridView1.Columns.Count;j++) { worksheet.Cells[i + 2, j + 1] = dataGridView1.Rows[i].Cells[j].Value.ToString(); } } } private void button3_Click_1(object sender, EventArgs e) { comboBox1.Items.Clear(); comboBox2.Items.Clear(); } } }

Data Dictionary
It describes the entity relation diagram in the table format. It also describes the data types and the constrains applied on the attributes.

Table Fields and Data types :


138

Customer:
Column Name cust_id Cust_name Cust_add Cust_email Cust_contact C_image path Data Type Varchar(50) Varchar(50) Varchar(50) Varchar(50) Varchar(50) Image nvarchar(max) Constrains Not null Not null Not null Not null Not null Allow null Allow null

Supplier:
Column Name Supp_id Supp_name Supp_add Supp_email Supp_contact Supp_image path Data Type Varchar(50) Varchar(50) Varchar(50) Varchar(50) Varchar(50) Image nvarchar(max) Constrains Not null Not null Not null Not null Not null Allow null Allow null

Employee:
Column Name Emp_id Emp_name
139

Data Type Varchar(50) Varchar(50)

Constrains Not null Not null

Emp_add Emp_email Emp_contact Emp_doj Emp_sal Emp_image path

Varchar(50) Varchar(50) nVarchar(50) datetime Numeric(18,0) image nVarchar(50)

Not null Not null Not null Not null Not null Allow null Allow null

Login:
Column Name Firstname Lastname Username Password Type Security_question Answer Data Type Varchar(50) Varchar(50) Varchar(50) Varchar(50) Varchar(50) Varchar(50) Varchar(50) Constrains Not null Not null Not null Not null Not null Not null Not null

Product :
Column Name Product_id Supp_id
140

Data Type Varchar(50) Varchar(50)

Constrains Not null Not null

Product_name Product_size Product_quantity Unit_price

Varchar(50) Int Int Numeric(18,0)

Not Not Not Not

null null null null

Purchase:
Column Name P_id Supp_id P_Date Data Type Varchar(50) Varchar(50) datetime Constrains Not null Not null Not null

Purchase_Product:
Column Name P_id Product_id P_qty P_price Data Type Varchar(50) Varchar(50) Int Float Constrains Not null Not null Not null Not null

Sales:
141

Column Name Order_id Cust_id S_Date

Data Type Varchar(50) Varchar(50) datetime

Constrains Not null Not null Not null

Sales_Product:
Column Name Order_id Product_id S_qty S_price Data Type Varchar(50) Varchar(50) int Float Constrains Not null Not null Not null Not null

ACKNOWLEDGEMENT
142

It gives me great pleasure in presenting this project report. Its justification will never sound good if I do not express my vote of thanks to our C.H.M. College and respective Principal. I would also like to thank our H.O.D Mr. AJI THOMAS sir for his timely Support in this completion of this project. I thank our internal project guide Mrs. PREETI BASANTANI madam who has help us a lot to keep this project work systematically and to be submit it on schedule. I am thankful for their valuable guidance at every stage of the project. Finally, I would thank to all others, who give there extended support to complete this project.

BIBLOGRAPHY

Visual studio .Net programming

Programming in visual studio 10

143

Visual studio .Net and the .Net platform: An advanced Guide

Websites:1)

www.google.com www.codeguru.com www.wikipedia.com

2)

3)

144

You might also like