Вы находитесь на странице: 1из 98

Janata Shikshan Mandal’s

Smt. Indirabai G. Kulkarni Arts, J. B. Sawant Science College


& Sau. Jankibai Dhondo Kunte Commerce College,
Alibag – Raigad.

A
PROJECT REPORT
ON

Mango Enterprises

Designed & Developed


By

Mr. Hrushikesh Prakash Patil

Submitted to the University of Mumbai in partial fulfillment of


the requirements for the degree of

Bachelor of Science (Information Technology)

Academic Year 2016-17


Mango Enterprises

ACKNOWLEDGMENT

JSM College, Alibag Page 1


Mango Enterprises

Acknowledgement
The satisfaction that accompanies that the successful completion of any task
would be incomplete without the Mention of people whose ceaseless
cooperation made it possible, whose constant guidance and encouragement crown
all effort with success.
In particular, I like to thank for the blessing to our Principal
Dr. N. N. Shere who have always been source of inspiration. I wish to thanks Prof.
S. B. Datar (In-Charge of Computer Science and Information Technology
Department) for having faith in this project idea and granted support in all direction.

We are grateful to our Project Coordinator Mr. S. S. Bhostekar for the


internal guidance, inspiration and constructive suggestions that helpful us in the
preparation of this project.

I am grateful and thankful to all my teachers who share their years of


experience, excellent support and blossoms of suggestions with me.

We also thank our colleagues who have helped in successful completion of the
project.

- Mr. Hrushikesh Patil

JSM College, Alibag Page 2


Mango Enterprises

CERTIFICATE

JSM College, Alibag Page 3


Mango Enterprises

Statement By The Candidate

I wish to state that the work embodied in this Project “Mango


Enterprises” forms my own contribution to the project work carried out under
the guidance of Mr. S.S. Bhostekar at the department of Information
Technology. This Work has not been submitted for any other degree at this or
any other university. Whenever references have been made to previous work of
others, it has been clearly indicated as such as include in the bibliography.

Certified By

Signature of Guide Signature of candidate

Date:-

JSM College, Alibag Page 4


Mango Enterprises

SYNOPSIS

JSM College, Alibag Page 5


Mango Enterprises

MAIN
REPORT

JSM College, Alibag Page 6


Mango Enterprises

INDEX
Sr. No. Name of Topics
1 Introduction
1.1 Organizational Overview
1.2 Introduction to System

2 System Study & Analysis


2.1 Problem Definition
2.2 Feasibility Study
2.3 System Analysis
2.4 Current System
2.5 Proposed System

3 System Development
3.1 Gantt Chart
3.2 Event Table
3.3 Entity Relationship Diagram
3.4 Class Diagram
3.5 Use Case Diagram
3.6 Sequence Diagram
3.7 State Chart Diagram
3.8 Activity Diagram
3.9 Component Diagram
3.10 Package Diagram
3.11 Deployment Diagram
3.12 Menu Tree
4 Program List
5 Table List
6 Report List
7 System Testing And Convention
8 Data Entry Form
9 Coding Convention
10 Source Code
11 Screen Layout With Test Data & Test Result
12 Report Layout
13 References, Bibliography, Website

JSM College, Alibag Page 7


Mango Enterprises

INTRODUCTION

JSM College, Alibag Page 8


Mango Enterprises

1. Introduction
1.1 Organizational Profile
The Mango House is the fastest growing shop in the mango business.
The project Mango Enterprises is for Mango House shop which is situated in
Alibag. Mr. Nilesh Patil is the owner of Mango House shop. He started their
business in 2007.They are dealing with selling different types of mangoes such
as Alphanso, totapuri, keshar, pairi etc.

JSM College, Alibag Page 9


Mango Enterprises

1.2 Introduction To Project

Mango Enterprises is an advanced windows based management


software system for Mango House shop. It enables retailers to efficiently
manage their shops' daily operational needs. Our system designed for a single-
user or multiple users in a network environment.

Employee Record Management

 Employee History
 Fast Employee Search

Report Manager

 Over 6 reports
 Daily, weekly, yearly and year-to-date reports
 Daily sales and daily collection reports

Security Manager

 Create user accounts for different operators – manager, receptionist etc.


 Give or access to individual module and functions such as canceling a
bill.

JSM College, Alibag Page 10


Mango Enterprises

System Study and Analysis

JSM College, Alibag Page 11


Mango Enterprises

2. System Study and Analysis


2.1 Problem Definition
The main aim of the proposed project is to computerize the booking,
billing and report generating system of restaurant system. Considering the
shortcomings of the existing manual system, this takes lots of manual labor,
time and inconvenience to the restaurant management. This package will
provide a considerably convenient approach for both the parties in fulfilling
their needs with complete ease and fastness.

SCOPE OF THE PROJECT:


The proposed project Mango Enterprises is a computer based application,
which overcomes all the manual hurdles usually faced while purchasing and
selling Mango products. This application allows shop owner to find out the
details of the Products availability. It also allows cancelling the order if needed;
this information will be maintained by the database. The proposed project
overcomes all the existing drawbacks of the system and provides the following
benefits.

efforts.

JSM College, Alibag Page 12


Mango Enterprises

2.2 Feasibility Study


TECHINICAL FEASIBILITY
Evaluating the technical feasibility is the trickiest part of a feasibility
study. This is because, at this point in time, not too many-detailed design of the
system, making it difficult to access issues like performance, costs on (on
account of the kind of technology to be deployed) etc. A number of issues have
to be considered while doing a technical analysis.
1) Understand the different technologies involved in the proposed
system:
Before commencing the project, we have to be very clear about what are
the Technologies that are to be required for the development of the new
system.
2) Find out whether the organization currently possesses the required
technologies:
Is the required technology available with the organization?
If so is the capacity sufficient?
For instance –
“Will the current printer be able to handle the new reports and forms required
for the new system?”

OPERATIONAL FEASIBILITY
Proposed projects are beneficial only if they can be turned into
information systems that will meet the organizations operating requirements.
Simply stated, this test of feasibility asks if the system will work when it is
developed and installed. Are there major barriers to Implementation? Here are
questions that will help test the operational feasibility of a project:
 Is there sufficient support for the project from management from users? If
the current system is well liked and used to the extent that persons will not
be able to see reasons for change, there may be resistance.

JSM College, Alibag Page 13


Mango Enterprises

 Are the current business methods acceptable to the user? If they are not,
Users may welcome a change that will bring about a more operational and
useful systems.
 Have the user been involved in the planning and development of the
project?
Early involvement reduces the chances of resistance to the system and in
General and increases the likelihood of successful project.
Since the proposed system was to help reduce the hardships encountered in the
existing manual system, the new system was considered to be operational
feasible.

ECONOMIC FEASIBILITY
Economic feasibility attempts 2 weigh the costs of developing and
implementing a new system, against the benefits that would accrue from having
the new system in place. This feasibility study gives the top management the
economic justification for the new system.
A simple economic analysis which gives the actual comparison of costs
and benefits are much more meaningful in this case. In addition, this proves to
be a useful point of reference to compare actual costs as the project progresses.
There could be various types of intangible benefits on account of automation.
These could include increased patient satisfaction, improvement in product
quality better decision making timeliness of information, expediting activities,
improved accuracy of operations, better documentation and record keeping,
faster retrieval of information, better employee morale.

JSM College, Alibag Page 14


Mango Enterprises

2.3 System Analysis


System analysis will be performed to determine if it is feasible to design
an information based on policies and plans of the organization and on user
requirements and to eliminate the weaknesses of the present system.

General requirements are: -

1. The new system should be cost effective.


2. To augment management, improve productivity and services.
3. To enhance User/System interface.
4. To improve information qualify and usability.
5. To upgrade system’s reliability, availability, flexibility and growth
potential.

2.4 Current System


The manual system is currently maintaining all the details in records and
getting the table booking details for a particular date of booking is a very
time consuming process. It also maintains all the items’ details. There are
various discount offers for the customer. So it becomes a very tedious job
for the administrator to look after all these particulars to complete the task
at right time.

The following are the drawbacks of the existing manual System.

Time Delay: In the existing system, information related to all tasks is


stored in different registers. Since all the details are stored in different
registers it takes lot of time to prepare different reports.

Redundancy: As the information passes through different registers, each


register is consolidated and sent to next register. So the same information is
being tabulated at each register, which involves lot of complication and
duplication in work, thus it causes redundancy.

JSM College, Alibag Page 15


Mango Enterprises

Accuracy: Since the same data is compiled at different sections, the


possibility of tabulating data wrongly increases. Also if the data is more,
validations become difficult. This may result in loss of accuracy of data.

Information Retrieval: As the information is stored in the particular


format, it can only be retrieved in the same format. But if it is to be retrieve
in different format, it is not possible.

Storage Media: In the existing system, data transaction being stored on too
long registers it is very difficult to refer after some time.

Reports: At the various reports are tabulated manually. They are not such
attractive and require more time.

Enquiry: Enquiry for different level of information is much more difficult.


On line enquiry of data is not possible.

JSM College, Alibag Page 16


Mango Enterprises

2.5 Proposed System


This proposed system is very useful for Mango House shop to
keep their records in computerized manner as well as they can easily search
all the records as per requirement. In this system, records of selling, buying,
order, delivery, billing details, stock records, details of item, product and
employee etc. store in computerizes manner.

In Proposed System I used Incremental Model to complete SDLC


Phases. In incremental model the whole requirement is divided into various
builds. Multiple development cycles take place here, making the life cycle
a “multi-waterfall” cycle. Cycles are divided up into smaller, more easily
managed modules. Each module passes through the requirements, design,
implementation and testing phases. A working version of software is
produced during the first module, so you have working software early on
during the software life cycle. Each subsequent release of the module adds
function to the previous release. The process continues till the complete
system is achieved.

Diagram of Incremental model

JSM College, Alibag Page 17


Mango Enterprises

Advantages of Incremental model:


 Generates working software quickly and early during the software life
cycle.
 More flexible – less costly to change scope and requirements.
 Easier to test and debug during a smaller iteration.
 Customer can respond to each built.
 Lowers initial delivery cost.
 Easier to manage risk because risky pieces are identified and handled
during it’d iteration.

Disadvantages of Incremental model:


 Needs good planning and design.
 Needs a clear and complete definition of the whole system before it can be
broken down and built incrementally.
 Total cost is higher than waterfall.

JSM College, Alibag Page 18


Mango Enterprises

Software and Hardware Specification


Software Requirement:
 Platforms: Windows 7 or later
 Frontend: Visual Studio 2010 [C#.net]
 Backend: MS SQL 2008

Hardware Requirement:
 Processor: Core 2 Duo or later
 RAM: 2 GB Minimum
 HD Space: 40 GB Minimum free space
 Monitor Resolution: 1024 x 768
 DVD R/RW

Other Software and Tools:


 MS Office: for Document reading, Presentation
 Nero: for Burning CD/DVD
 Dot net frameworks 4

JSM College, Alibag Page 19


Mango Enterprises

System Development

JSM College, Alibag Page 20


Mango Enterprises

3. System Study and Analysis


3.1 Gantt Chart
A Gantt chart is a type of bar chart, developed by Henry Gantt in the
1910s, that illustrates a project schedule. Gantt charts illustrate the start and
finish dates of the terminal elements and summary elements of a project Gantt
chart is nowadays a common and widely used project management tool.

v Expected Date

v Actual Date

Preliminary
Study

System Analysis

System Design

System Design

System
Implementation

1st Dec 2016 15th Dec 2016 2nd Jan 2017 28th Jan 2017 23rd Feb 2017

JSM College, Alibag Page 21


Mango Enterprises

3.2 Event table


This is a table that list events in rows & key pieces of information about
each event in columns. Each row in the event table records information
about one event.

1. Event – Occurrences at a specific time & place that trigger system


processing.

2. Trigger – Data in flow or time that system detects.

3. Source – Ultimate creator of trigger. May be a person, department or


system. If event type is temporal, this is left blank.

4. Activity – System process that results from trigger.

5. Response – Data that system produces. If only internal effects are


made, then this is

6. Destination – Ultimate destination of data response.

JSM College, Alibag Page 22


Mango Enterprises

3.2 Event Table

Event Trigger Source Activity Response Destination

Login Input Login Verify and Logged Login


username and validate user
password user

Place Create order User Generate Fulfillment Order


order order of order

Checking Counting User Produce Displayed Product


Stock product stock status status

Generate Create Bill User Print Bill Paid Bill Customer


Bill

Generate Create Report User Produce Print System


Report Reports Reports

JSM College, Alibag Page 23


Mango Enterprises

3.3 Entity Relationship Diagram


Data storage requirements include data entities, their attributes and the
relationships among the data entities. The model used to define the data
storage requirements is called ERD.

On the entity relationship diagram, Rectangle represents data entities


and the line connecting the rectangles shows the relationships among the data
entities.

This rectangle represents data entities, and the lines


connecting to the rectangle shows the relationship among
the data entities.

Cardinalities are the symbols to show how one entity is related to the other.

One to One

One to Many

JSM College, Alibag Page 24


Mango Enterprises

Entity Relationship Diagram

JSM College, Alibag Page 25


Mango Enterprises

3.4 Class Diagram

Class diagram depicts the system object structure, and then shows
object classes that a system is composed of as well as the relationship
between those object classes. It is a graphical model that shows all the
classes of objects in the system in the object oriented approach. It
represents the static view of an application. Class diagram is not only
used for visualizing, describing and documenting different aspects of the
system but also for constructing executable code of the software
application.

The class symbol is a rectangle with three sections- the top


section contains the name of the class, middle section contains list of
attributes of the class and bottom section lists the important methods of
the class.

JSM College, Alibag Page 26


Mango Enterprises

Class Diagram:

JSM College, Alibag Page 27


Mango Enterprises

3.5 Use Case Diagram


A use case diagram at its simplest is a representation of a user's
interaction with the system and depicting the specifications of a use
case. A use case diagram can portray the different types of users of a
system and the various ways that they interact with the system. This type
of diagram is typically used in conjunction with the textual use case and
will often be accompanied by other types of diagrams as well.

Scenario

The use-case shows that an actor interacts with a computer


system to carry out business activity. A use-case is a high level
description and may include a whole sequence of individual to
accomplish the use. A scenario is a particular sequence of activities
within a use-case. A use-case may have several different scenarios.

This symbol represents the actor.

This symbol represents the automation boundary.

This symbol represents the connection of process.

JSM College, Alibag Page 28


Mango Enterprises

Use Case Diagram


Actor

1. User
a. Login
b. Maintained selling products
c. Generate bills
d. Generate Reports

2. Admin
a. Login
b. Maintain Price
c. Paid Supplier Bill
d. Maintained Inventory
e. Generate Purchase Order

JSM College, Alibag Page 29


Mango Enterprises

3.6 Sequence Diagram


Sequence diagram is an interaction diagram that details how operations
are carried out, what messages are sent and when. Sequence diagram are
organized according to time. It represents the logic of use case by showing the
interactions of message between objects.

Notations:

Name Representation Description

Each of the objects


that participate in the
Object Object
processing
represented in the
sequence diagram is
drawn across the top.

A dotted line is
Object2 dropped from each
Lifeline
object in the
sequence diagram

To indicate that an
object is executing,
Active the lifeline is drawn
as thin rectangle.

A horizontal arrow
Message represents a message
sent from one object

JSM College, Alibag Page 30


Mango Enterprises

Sequence Diagram
Sequence Diagram for sale product

JSM College, Alibag Page 31


Mango Enterprises

Sequence Diagram for Purchase product

JSM College, Alibag Page 32


Mango Enterprises

Sequence Diagram for placing purchase order:

JSM College, Alibag Page 33


Mango Enterprises

3.7 State Chart Diagram


The name of the diagram itself clarifies the purpose of the
diagram and other details. It describes different states of a component in
a system. The states are specific to a component/object of system. The
state chart diagram describes a state machine. Now to clarify it state
machine can be defined as a machine which defines different states of an
object and these states are controlled by external or internal event.

Notations:

Name Representation Description

State
State

This shows the


starting point or the
Activity
1st activity of the
,
flow. This shows the
ending of the
activity’s flow.
An arrow indicates the
Transition object’s transition
from one state to
other.

JSM College, Alibag Page 34


Mango Enterprises

State Diagram

JSM College, Alibag Page 35


Mango Enterprises

3.8 Activity Diagram:-


An Activity Diagram is a visual representation of any systems
activities and flow of data or decisions between activities. Activity
Diagrams provide a very broad view of a business process. They
represent the dynamics of a system. They are flow charts that are used
to show the work flow of a system. Also shows flow of control from
activity to activity in the system.
Notations:

Name Representation Description

Action states are atomic,


Action State meaning that events may
occur, but the work of action
state is not interrupted.

They are used to indicate


different possible transitions
Decision that depend on Boolean
conditions of the container
object.

When the action or activity of


a state completes, flow of
Transition control passes immediately to
the next action state or activity
state. This flow is specified by
using transitions.

It represents an operation.
Solid black dot represents the
Activity State beginning of the activity
, diagram and double circle
represents the ending of the
activity diagram.

JSM College, Alibag Page 36


Mango Enterprises

Activity Diagram for Login

JSM College, Alibag Page 37


Mango Enterprises

Activity Diagram for Adding Items

JSM College, Alibag Page 38


Mango Enterprises

Activity diagram

JSM College, Alibag Page 39


Mango Enterprises

Activity diagram for generating report

JSM College, Alibag Page 40


Mango Enterprises

3.9 Component Diagram:


Component diagrams are used to graphically depict the organization and
dependencies of the system software components. They can be used to show
how programming code is divided into modules or components.

They graphically depict the physical architecture of the software of the


system. A component is represented in the UML as a rectangle with two
smaller rectangles to the left.

JSM College, Alibag Page 41


Mango Enterprises

3.10 Package Diagram


It is a high level diagram similar in concept to the traditional
approach’s system flow chart. The objective of package diagram is to
identify the major components of a complete system.

Only two symbols are used in package diagram:

1. Tabbed rectangle
2. Dashed arrow

The tabbed rectangle identifies the major system and sub-system.


The arrow is a dependency arrow. The arrow tail is connected to the
package that is dependent and the arrow head is connected to the
independent package.

JSM College, Alibag Page 42


Mango Enterprises

Package Diagram

Mango Enterprises

Login Product

sale Reports

Bill
Customer

.NET 2010 Database SQL 2008

JSM College, Alibag Page 43


Mango Enterprises

3.11 Deployment Diagram


Deployment diagram is implementation type diagram that describes the
physical architecture of the hardware and software in the system. They depict
the software components, processors and devices that make up the system
architecture.

Each box in the diagram is the symbol for the node which in most cases
a piece of hardware. The hardware may be PC, mainframe printer or even a
sensor. Software that resides on the node is represented by the component
symbol. The lines connecting the node indicate a communication path between
two devices.

Local Machine SQL server 2008

JSM College, Alibag Page 44


Mango Enterprises

3.12 Menu Tree

 Master
 user
 client
 item
 customer
 Search
 Transaction
 Purchase
 Sale
 Reports
 Sales
 Item
 Purchase
 Stock
 About us
 Exit

JSM College, Alibag Page 45


Mango Enterprises

4 Program List
Sr. No From Name Function
1 Main It consist of menus for other form
opening
2 User It is Used to add the User, delete the user
and for changing password
3 Login It allow authenticated user to enter the
system
4 About US It is used to give the information about
the project developer
5 Customer It is used to give the information about
the customer
6 Supplier It is used to give the information about
the supplier
7 Search It is used to search product
8 Purchase It is used to give the information about
the purchase
9 Sale It is used to give the information about
the sales product

JSM College, Alibag Page 46


Mango Enterprises

5 Table List
Customer Table

Item Table

Login table

JSM College, Alibag Page 47


Mango Enterprises

Purchase Table

Sale Table

Supplier

JSM College, Alibag Page 48


Mango Enterprises

5. Report List
 Employee Report

 Bill Report

 Customer Report

 Booking Report

JSM College, Alibag Page 49


Mango Enterprises

6. System Testing and Conclusion


Test Cases:
“A test case has components that describe an input, action or event and an
expected response, to determine if a feature of an application is working
correctly.”

1. Login Test Case:-


Test Case Test Case Test Case Test Steps
Id Name Description
Login1 Validate To verify Expected Actual
Login That user name An error
& password message
are not left “Enter User
empty Name &
Password”
Login
Successful or
an error
message
“Enter
Correct User
Name &
Password”

Conclusion

The purpose of this Test Case is to specify and communicate the specific
conditions which need to be validated to enable an assessment of the system.

JSM College, Alibag Page 50


Mango Enterprises

Test Cases:
“A test case has components that describe an input, action or event and an
expected response, to determine if a feature of an application is working
correctly.”

2. Employee Test Case:-


Test Case Test Case Test Case Test Steps
Id Name Description
Emp1 Validate To verify Expected Actual
Data That all fields An error
are not left message
empty “Empty field
not allowed”

Emp2 Validate salary Press alphabets Cursor Not


field move and not
enter any
alphabets

Conclusion

The purpose of this Test Case is to specify and communicate the specific
conditions which need to be validated to enable an assessment of the system.

JSM College, Alibag Page 51


Mango Enterprises

Test Cases:
“A test case has components that describe an input, action or event and an
expected response, to determine if a feature of an application is working
correctly.”

3. Customer Test Case:-


Test Case Test Case Test Case Test Steps
Id Name Description
Cust1 Validate To verify Expected Actual
Data That all fields An error
are not left message
empty “Empty field
not allowed”

Cust2 Validate Press alphabets Cursor Not


mobile field move and not
enter any
alphabets

Conclusion

The purpose of this Test Case is to specify and communicate the specific
conditions which need to be validated to enable an assessment of the system.

JSM College, Alibag Page 52


Mango Enterprises

Test Cases:
“A test case has components that describe an input, action or event and an
expected response, to determine if a feature of an application is working
correctly.”

4 Bill Test Case:-


Test Case Test Case Test Case Test Steps
Id Name Description
Bill1 Validate To verify Expected Actual
Data That all fields An error
are not left message
empty “Empty field
not allowed”

Bill2 Validate Press alphabets Cursor Not


number field move and not
enter any
alphabets

Conclusion

The purpose of this Test Case is to specify and communicate the specific
conditions which need to be validated to enable an assessment of the system.

JSM College, Alibag Page 53


Mango Enterprises

Data Entry Form

JSM College, Alibag Page 54


Mango Enterprises

5. Data Entry Form

Authentication Form

Username:

Password:

Level:

Login Exit

Employee Form

Empid:

Employee name:

Address:

Designation

Salary

Contact No

Save Exit Delete

JSM College, Alibag Page 55


Mango Enterprises

Bill Form

Bill No:

Customer name:

Address:

Order Date

Bill date

Bill Amount

Save Exit Delete

JSM College, Alibag Page 56


Mango Enterprises

9. Coding Convention

Introduction

Microsoft develops samples and documentation that follow the guidelines in


this topic. If you follow the same coding conventions, you may gain the
following benefits:

 Your code will have a consistent look, so that readers can better focus
on content, not layout.

 Readers understand your code more quickly because they can make
assumptions based on previous experience.

 You can copy, change, and maintain the code more easily.

 You help ensure that your code demonstrates "best practices" for Visual
Basic.

b. Use appropriate prefix for each of the ui element. A brief list is given
below. Since .NET has given several controls, you may have to arrive at a
complete list of standard prefixes for each of the controls (including third
party controls) you are using.

Microsoft develops samples and documentation that follow the guidelines in


this topic. If you follow the same coding conventions, you may gain the
following benefits:

 Your code will have a consistent look, so that readers can better focus
on content, not layout.
 Readers understand your code more quickly because they can make
assumptions based on previous experience.
 You can copy, change, and maintain the code more easily.
 You help ensure that your code demonstrates "best practices" for Visual
Basic.

JSM College, Alibag Page 57


Mango Enterprises

use PascalCasing for class names and method names.

1. public class ClientActivity


2. {
3. public void ClearStatistics()
4. {
5. //...
6. }
7. public void CalculateStatistics()
8. {
9. //...
10. }
11. }

use camelCasing for method arguments and local variables.

1. public class UserLog


2. {
3. public void Add(LogEvent logEvent)
4. {
5. int itemCount = logEvent.Items.Count;
6. // ...
7. }
8. }

Do not use Hungarian notation or any other type identification in identifiers

1. // Correct
2. int counter;
3. string name;
4.
5. // Avoid
6. int iCounter;
7. string strName;

Do not use Screaming Caps for constants or readonly variables

1. // Correct
2. public static const string ShippingType = "DropShip";
3.
4. // Avoid
5. public static const string SHIPPINGTYPE = "DropShip";

avoid using Abbreviations. Exceptions: abbreviations commonly used as names,


such as Id, Xml, Ftp, Uri

1. // Correct

JSM College, Alibag Page 58


Mango Enterprises

2. UserGroup userGroup;
3. Assignment employeeAssignment;
4.
5. // Avoid
6. UserGroup usrGrp;
7. Assignment empAssignment;
8.
9. // Exceptions
10. CustomerId customerId;
11. XmlDocument xmlDocument;
12. FtpHelper ftpHelper;
13. UriPart uriPart;

Do use PascalCasing for abbreviations 3 characters or more (2 chars are both


uppercase)

1. HtmlHelper htmlHelper;
2. FtpTransfer ftpTransfer;
3. UIControl uiControl;

Do not use Underscores in identifiers. Exception: you can prefix private static
variables
with an underscore.

1. // Correct
2. public DateTime clientAppointment;
3. public TimeSpan timeLeft;
4.
5. // Avoid
6. public DateTime client_Appointment;
7. public TimeSpan time_Left;
8.
9. // Exception
10. private DateTime _registrationDate;

use predefined type names instead of system type names like Int16, Single, UInt64,
etc

1. // Correct
2. string firstName;
3. int lastIndex;
4. bool isSaved;
5.
6. // Avoid
7. String firstName;
8. Int32 lastIndex;
9. Boolean isSaved;

JSM College, Alibag Page 59


Mango Enterprises

use implicit type var for local variable declarations. Exception: primitive types (int,
string,
double, etc) use predefined names.

1. var stream = File.Create(path);


2. var customers = new Dictionary();
3.
4. // Exceptions
5. int index = 100;
6. string timeSheet;
7. bool isCompleted;

use noun or noun phrases to name a class.

1. public class Employee


2. {
3. }
4. public class BusinessLocation
5. {
6. }
7. public class DocumentCollection
8. {
9. }

vertically align curly brackets.

1. // Correct
2. class Program
3. {
4. static void Main(string[] args)
5. {
6. }
7. }

JSM College, Alibag Page 60


Mango Enterprises

10. S o u r c e C o d e

Splash.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 Mango
{
public partial class splash : Form
{
public splash()
{
InitializeComponent();
}

private void Timer1_Tick(object sender, EventArgs e)


{
if (pgbar.Value >= 100)
{
Timer1.Enabled = false;
this.Hide();
Form login = new login();
login.Show();
}
else
{
pgbar.Value = pgbar.Value + 10;
}
}

}
}

JSM College, Alibag Page 61


Mango Enterprises

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 System.Data.SqlClient;
namespace Mango
{
public partial class login : Form
{
public login()
{
InitializeComponent();
}

private void Button2_Click(object sender, EventArgs e)


{
this.Close();
}

private void Button1_Click(object sender, EventArgs e)


{
SqlConnection con = new SqlConnection(@"Data
Source=.\SQLEXPRESS;Initial Catalog=tulip;Integrated Security=True");
SqlDataAdapter sda = new SqlDataAdapter("select count(*) from login
where uname='" +TextBox1.Text +"' and pass='"+TextBox2.Text +"'",con);
DataTable dt = new DataTable();
sda.Fill(dt);
if (dt.Rows[0][0].ToString() == "1")
{
this.Hide();
Form1 m = new Form1();
if (TextBox1.Text == "Anuj")
{
m.UserToolStripMenuItem.Enabled = true;
m.ReportsToolStripMenuItem.Enabled = true;
m.Show();
}
else
{
m.UserToolStripMenuItem.Enabled = false;
m.ReportsToolStripMenuItem.Enabled = false;
m.Show();
}
m.Show();
}
else
{
MessageBox.Show("Please check username and password");
TextBox1.Text = "";
TextBox2.Text="";
}
}
}
}

JSM College, Alibag Page 62


Mango Enterprises

SqlDataAdapter da = new SqlDataAdapter(cmd);


da.Fill(dt);
dgv1.DataSource = dt;
con.Close();
}
private void clear()
{
txtcustid.Text = "";
txtmname.Text = "";
txtadd.Text = "";
txtcno.Text = "";
cmb1.Text = "";
}
private void btnadd_Click(object sender, EventArgs e)
{
btnsave.Enabled = true;
btnadd.Enabled = false;
clear();
string eid;
con.Close();
con.Open();
string qry = "select max(substring(custid,5,len(custid)))+1 from
customer";
cmd = new SqlCommand(qry, con);
dr = cmd.ExecuteReader();
if (dr.Read())
{
eid = dr[0].ToString();
if (eid == "")
{
txtcustid.Text = "Cust001";
}
else
{
if (eid == "1")
{
txtcustid.Text = "Cust00" + eid;
}
else if (eid == "2")
{
txtcustid.Text = "Cust0" + eid;
}
else
{
txtcustid.Text = "Cust" + eid;
}
}

}
}

private void btnxit_Click(object sender, EventArgs e)


{
this.Close();
}

private void btnsave_Click(object sender, EventArgs e)


{
btnsave.Enabled = false;

JSM College, Alibag Page 63


Mango Enterprises

btnadd.Enabled = true;
if (txtcustid.Text != "" & cmb1.Text != "" & txtmname.Text != "" &
txtadd.Text != "" & txtcno.Text != "")
{

con.Close();
con.Open();
string qry = "insert into customer values ('" + txtcustid.Text
+ "','" + txtmname.Text + "','" + txtadd.Text + "','" + txtcno.Text +
"','"+cmb1.Text +"')";
SqlCommand cmd = new SqlCommand(qry, con);
cmd.ExecuteNonQuery();
cmd.Clone();
loadlist();
MessageBox.Show("Records Inserted");
con.Close();
clear();
}

private void btndelete_Click(object sender, EventArgs e)


{
con.Open();
string qry = "delete from customer where custid ='" +
txtcustid.Text + "'";
SqlCommand cmd = new SqlCommand(qry, con);
cmd.ExecuteNonQuery();
cmd.Clone();
loadlist();
MessageBox.Show("Record Deleted");
txtcustid.Text = "";
con.Close();
}

private void btnbrowse_Click(object sender, EventArgs e)


{
loadlist();
clear();
}

private void Button1_Click(object sender, EventArgs e)


{
con.Open();
string qry = "update customer set custname='" + txtmname.Text +
"',cadd='" + txtadd.Text + "',cno='" + txtcno.Text + "',city='" + cmb1.Text +
"' where custid='" + txtcustid.Text + "'";
SqlCommand cmd = new SqlCommand(qry, con);
cmd.ExecuteNonQuery();
cmd.Clone();
loadlist();
MessageBox.Show("Record Updated");
clear();
con.Close();

private void dgv1_CellClick(object sender, DataGridViewCellEventArgs e)


{

JSM College, Alibag Page 64


Mango Enterprises

if (e.RowIndex >= 0)
{
DataGridViewRow row = this.dgv1.Rows[e.RowIndex];
txtcustid.Text = row.Cells[0].Value.ToString();
txtmname.Text = row.Cells[1].Value.ToString();
txtadd.Text = row.Cells[2].Value.ToString();
txtcno.Text = row.Cells[3].Value.ToString();
cmb1.Text = row.Cells[4].Value.ToString();

}
}
}
}

JSM College, Alibag Page 65


Mango Enterprises

Main.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 Mango
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void ProductToolStripMenuItem_Click(object sender, EventArgs e)


{
Form m = new item();
m.Show();
}

private void SupplierToolStripMenuItem_Click(object sender, EventArgs e)


{
Form s = new supplier();
s.Show();
}

private void ToolStripMenuItem1_Click(object sender, EventArgs e)


{
Form u = new umanage();
u.Show();
}

private void BackupToolStripMenuItem_Click(object sender, EventArgs e)


{
Form s = new search();
s.Show();
}

private void purchaseToolStripMenuItem2_Click(object sender, EventArgs e)


{
Form p = new purchase();
p.Show();
}

JSM College, Alibag Page 66


Mango Enterprises

private void ItemToolStripMenuItem1_Click(object sender, EventArgs e)


{
Form irpt = new itemplist();
irpt.Show();
}

private void SalesToolStripMenuItem1_Click(object sender, EventArgs e)


{
Form srpt = new salesrpt();
srpt.Show();
}

private void StockToolStripMenuItem_Click(object sender, EventArgs e)


{
Form srpt = new stock();
srpt.Show();
}

private void PurchaseToolStripMenuItem1_Click(object sender, EventArgs e)


{
Form purrpt = new smonrpt ();
purrpt.Show();
}

private void ExitToolStripMenuItem_Click(object sender, EventArgs e)


{
Application.Exit();
}

private void AboutToolStripMenuItem_Click(object sender, EventArgs e)


{
Form srpt = new AboutBox1 ();
srpt.Show();
}

private void saleToolStripMenuItem_Click(object sender, EventArgs e)


{
Form sal = new sale();
sal.Show();
}

private void logoutToolStripMenuItem_Click(object sender, EventArgs e)


{
this.Close();
Form l = new login();

JSM College, Alibag Page 67


Mango Enterprises

l.Show();
}

private void CustomerToolStripMenuItem_Click(object sender, EventArgs e)


{
Form c = new customer();
c.Show();
}

}
}

JSM College, Alibag Page 68


Mango Enterprises

Item.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;

namespace Mango
{
public partial class item : Form
{
SqlConnection con = new SqlConnection(@"Data Source=.\sqlexpress;Initial
Catalog=Mango;Integrated Security=True");
DataTable table = new DataTable();
SqlCommand cmd;
SqlDataReader dr;
public item()
{
InitializeComponent();
}

private void btnadd_Click(object sender, EventArgs e)


{
string s = "select max(icode)+1 from item";
SqlCommand cmd = new SqlCommand(s, con);
con.Open();
cmd.ExecuteNonQuery();
SqlDataReader dd = cmd.ExecuteReader();
while (dd.Read())
{
int n = dd.GetInt32(0);
txtid.Text = n.ToString();
}
btnsave.Enabled = true;
btnadd.Enabled = false;
}

private void btnxit_Click(object sender, EventArgs e)


{
this.Close();
}
private void loadlist()
{
con.Close();

JSM College, Alibag Page 69


Mango Enterprises

con.Open();
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from item";
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
dgv1.DataSource = dt;
con.Close();
}
private void clear()
{
txtid.Text = "";
txtname.Text = "";
txtqty.Text = "";
cmb1.Text = "";
txtprate.Text = "";
txtsrate.Text = "";
txtunit.Text = "";
txtamt.Text = "";
}

private void btnsave_Click(object sender, EventArgs e)


{
btnsave.Enabled = false;
btnadd.Enabled = true;
if (txtid.Text != "" & cmb1.Text != "" & txtname.Text != "" & txtqty.Text !=
"" & txtprate.Text != "" & txtsrate.Text != "" & txtunit.Text!="")
{

con.Close();
con.Open();
string qry = "insert into item values ('" + txtid.Text + "','" + txtname.Text +
"','" + cmb1.Text + "','" + txtunit.Text + "','" + txtqty.Text + "','" + txtprate.Text + "','"
+ txtsrate.Text + "','" + txtamt.Text + "')";
SqlCommand cmd = new SqlCommand(qry, con);
cmd.ExecuteNonQuery();
cmd.Clone();
loadlist();
MessageBox.Show("Records Inserted");
con.Close();
clear();
}
}

private void btndelete_Click(object sender, EventArgs e)


{

JSM College, Alibag Page 70


Mango Enterprises

con.Open();
string qry = "delete from item where icode ='" + txtid.Text + "'";
SqlCommand cmd = new SqlCommand(qry, con);
cmd.ExecuteNonQuery();
cmd.Clone();
loadlist();
MessageBox.Show("Record Deleted");
txtid.Text = "";
con.Close();
}

private void cmdfirst_Click(object sender, EventArgs e)


{
con.Close();
con.Open();
string qry = "update item set iname='" + txtname.Text + "',itype='" +
cmb1.Text + "',unit='" + txtunit.Text + "',pcs='" + txtqty.Text + "' ,prate='" +
txtprate.Text + "',srate='" + txtsrate.Text + "' where icode='" + txtid.Text + "'";
SqlCommand cmd = new SqlCommand(qry, con);
cmd.ExecuteNonQuery();
cmd.Clone();
loadlist();
MessageBox.Show("Record Updated");
clear();
con.Close();
}

private void txtprate_Leave(object sender, EventArgs e)


{

int a = Convert.ToInt32(txtqty.Text);
int b = Convert.ToInt32(txtprate.Text);
int d = a + b;
txtamt.Text = d.ToString();

private void btnbrowse_Click(object sender, EventArgs e)


{
loadlist();
dgv1.Visible = true;
btnbrowse.Visible = false;
button1.Visible = true;
}

private void button1_Click(object sender, EventArgs e)


{

JSM College, Alibag Page 71


Mango Enterprises

dgv1.Visible = false;
button1.Visible = false;
btnbrowse.Visible = true;

}
}
}

JSM College, Alibag Page 72


Mango Enterprises

Customer.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;
namespace Mango
{
public partial class customer : Form
{
SqlConnection con = new SqlConnection(@"Data Source=.\sqlexpress;Initial
Catalog=Mango;Integrated Security=True");
DataTable table = new DataTable();

public customer()
{
InitializeComponent();
}

private void btnadd_Click(object sender, EventArgs e)


{
string s = "select max(custid)+1 from customer";
SqlCommand cmd = new SqlCommand(s, con);
con.Open();
cmd.ExecuteNonQuery();
SqlDataReader dd = cmd.ExecuteReader();
while (dd.Read())
{
int n = dd.GetInt32(0);
txtcustid.Text = n.ToString();
}
btnsave.Enabled = true;
btnadd.Enabled = false;
}
private void loadlist()
{
con.Close();
con.Open();
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from customer";
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);

JSM College, Alibag Page 73


Mango Enterprises

da.Fill(dt);
dgv1.DataSource = dt;
con.Close();
}
private void clear()
{
txtcustid.Text = "";
txtmname.Text = "";
txtadd.Text = "";
txtcno.Text = "";
cmb1.Text = "";
}

private void btnsave_Click(object sender, EventArgs e)


{
btnsave.Enabled = false;
btnadd.Enabled = true;
if (txtcustid.Text != "" & cmb1.Text != "" & txtmname.Text != "" &
txtadd.Text != "" & txtcno.Text != "")
{

con.Close();
con.Open();
string qry = "insert into customer values ('" + txtcustid.Text + "','" +
txtmname.Text + "','" + txtadd.Text + "','" + txtcno.Text + "','" + cmb1.Text + "')";
SqlCommand cmd = new SqlCommand(qry, con);
cmd.ExecuteNonQuery();
cmd.Clone();
loadlist();
MessageBox.Show("Records Inserted");
con.Close();
clear();
}
}

private void btndelete_Click(object sender, EventArgs e)


{
con.Open();
string qry = "delete from customer where custid ='" + txtcustid.Text + "'";
SqlCommand cmd = new SqlCommand(qry, con);
cmd.ExecuteNonQuery();
cmd.Clone();
loadlist();
MessageBox.Show("Record Deleted");
txtcustid.Text = "";
con.Close();
}

JSM College, Alibag Page 74


Mango Enterprises

private void btnbrowse_Click(object sender, EventArgs e)


{
loadlist();
dgv1.Visible = true;
btnbrowse.Visible = false;
button1.Visible = true;

private void cmdfirst_Click(object sender, EventArgs e)


{
con.Open();
string qry = "update customer set custname='" + txtmname.Text + "',cadd='" +
txtadd.Text + "',cno='" + txtcno.Text + "',city='" + cmb1.Text + "' where custid='" +
txtcustid.Text + "'";
SqlCommand cmd = new SqlCommand(qry, con);
cmd.ExecuteNonQuery();
cmd.Clone();
loadlist();
MessageBox.Show("Record Updated");
clear();
con.Close();
}

private void btnxit_Click(object sender, EventArgs e)


{
this.Close();
}

private void button1_Click_1(object sender, EventArgs e)


{
dgv1.Visible = false;
button1.Visible = false;
btnbrowse.Visible = true;
}
}
}

JSM College, Alibag Page 75


Mango Enterprises

Supplier.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;

namespace Mango
{
public partial class supplier : Form
{
SqlConnection con = new SqlConnection(@"Data Source=.\sqlexpress;Initial
Catalog=Mango;Integrated Security=True");
DataTable table = new DataTable();

public supplier()
{
InitializeComponent();
}
private void loadlist()
{
con.Close();
con.Open();
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from supplier";
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
dgv1.DataSource = dt;
con.Close();
}
private void clear()
{
txtcustid.Text = "";
txtmname.Text = "";
txtadd.Text = "";
txtcno.Text = "";
cmb1.Text = "";
}

private void btnadd_Click(object sender, EventArgs e)


{

JSM College, Alibag Page 76


Mango Enterprises

private void btnsave_Click(object sender, EventArgs e)


{
btnsave.Enabled = false;
btnadd.Enabled = true;
if (txtcustid.Text != "" & cmb1.Text != "" & txtmname.Text != "" &
txtadd.Text != "" & txtcno.Text != "")
{

con.Close();
con.Open();
string qry = "insert into supplier values ('" + txtcustid.Text + "','" +
txtmname.Text + "','" + txtadd.Text + "','" + txtcno.Text + "','" + cmb1.Text + "')";
SqlCommand cmd = new SqlCommand(qry, con);
cmd.ExecuteNonQuery();
cmd.Clone();
loadlist();
MessageBox.Show("Records Inserted");
con.Close();
clear();
}
}

private void btndelete_Click(object sender, EventArgs e)


{
con.Open();
string qry = "delete from supplier where sid ='" + txtcustid.Text + "'";
SqlCommand cmd = new SqlCommand(qry, con);
cmd.ExecuteNonQuery();
cmd.Clone();
loadlist();
MessageBox.Show("Record Deleted");
txtcustid.Text = "";
con.Close();
}

private void cmdfirst_Click(object sender, EventArgs e)


{
con.Open();
string qry = "update supplier set sname='" + txtmname.Text + "',cadd='" +
txtadd.Text + "',cno='" + txtcno.Text + "',pname='" + cmb1.Text + "' where sid='" +
txtcustid.Text + "'";
SqlCommand cmd = new SqlCommand(qry, con);
cmd.ExecuteNonQuery();
cmd.Clone();
loadlist();

JSM College, Alibag Page 77


Mango Enterprises

MessageBox.Show("Record Updated");
clear();
con.Close();
}

private void btnbrowse_Click(object sender, EventArgs e)


{
loadlist();
dgv1.Visible = true;
btnbrowse.Visible = false;
button1.Visible = true;

private void btnxit_Click(object sender, EventArgs e)


{
this.Close();
}

private void button1_Click(object sender, EventArgs e)


{
dgv1.Visible = false;
button1.Visible = false;
btnbrowse.Visible = true;
}
}
}

JSM College, Alibag Page 78


Mango Enterprises

Search.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;
namespace Mango
{
public partial class search : Form
{
SqlConnection con = new SqlConnection(@"Data Source=.\sqlexpress;Initial
Catalog=Mango;Integrated Security=True");
DataTable table = new DataTable();
public search()
{
InitializeComponent();
hide1();
}

private void button1_Click(object sender, EventArgs e)


{
this.Close();
}
private void hide1()
{
txtcust.Enabled = false;
btnsearch.Enabled = false;
dgv1.Enabled = false;
btnProdSearch.Visible = false;
btnSearchSup.Visible = false;
dgv2.Visible = false;
dgv3.Visible = false;
RadioButton1.Refresh();
}
private void RadioButton1_CheckedChanged(object sender, EventArgs e)
{
txtcust.Enabled = true;
btnsearch.Enabled = true;
dgv1.Enabled = true ;
txtcust.Focus();
}

private void btnsearch_Click(object sender, EventArgs e)


{

JSM College, Alibag Page 79


Mango Enterprises

con.Close();
con.Open();
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from customer where custname like'%" +
txtcust.Text + "%'";
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
dgv1.DataSource = dt;
con.Close();
}

private void RadioButton2_CheckedChanged(object sender, EventArgs e)


{
txtcust.Enabled = true;
btnsearch.Visible = false ;
dgv1.Visible = false ;
dgv3.Visible = false;
btnSearchSup.Visible = true;
btnProdSearch.Visible = false ;
dgv2.Visible = true;
txtcust.Focus();
}

private void btnSearchSup_Click(object sender, EventArgs e)


{
con.Close();
con.Open();
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from supplier where sname like'%" +
txtcust.Text + "%'";
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
dgv2.DataSource = dt;
con.Close();

private void RadioButton3_CheckedChanged(object sender, EventArgs e)


{
txtcust.Enabled = true;
btnsearch.Visible = false;
dgv1.Visible = false;

JSM College, Alibag Page 80


Mango Enterprises

dgv3.Visible = true ;
btnSearchSup.Visible = false ;
btnProdSearch.Visible = true ;
dgv2.Visible = false ;
txtcust.Focus();
}

private void btnProdSearch_Click(object sender, EventArgs e)


{
con.Close();
con.Open();
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from item where iname like'%" + txtcust.Text
+ "%'";
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
dgv3.DataSource = dt;
con.Close();

}
}
}

JSM College, Alibag Page 81


Mango Enterprises

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;

namespace Mango
{
public partial class stock : Form
{
public stock()
{
InitializeComponent();
}

private void stock_Load(object sender, EventArgs e)


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

this.reportViewer1.RefreshReport();
}
}
}

JSM College, Alibag Page 82


Mango Enterprises

Umange.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;
namespace Mango
{
public partial class umanage : Form
{
SqlConnection con = new SqlConnection(@"Data Source=.\sqlexpress;Initial
Catalog=Mango;Integrated Security=True");
DataTable table = new DataTable();
public umanage()
{
InitializeComponent();
}

private void btnset_Click(object sender, EventArgs e)


{
if (txtuid.Text != "" & txtfname.Text != "" & txtlname.Text != "" &
txtuname.Text != "" & txtpass.Text != "" & txtconpass.Text != "" &
cbopermission.Text != "")
{

con.Open();
string qry = "insert into login(uid,fname,lname,uname,pass,permission)
values('" + txtuid.Text + "','" + txtfname.Text + "','" + txtlname.Text + "','" +
txtuname.Text + "','" + txtpass.Text + "','" + cbopermission.Text + "')";
SqlCommand cmd = new SqlCommand(qry, con);
cmd.ExecuteNonQuery();
cmd.Clone();
loadlist();
MessageBox.Show("Records Inserted");
cls();
con.Close();
}
}
private void cls()
{
txtuid.Text = "";
txtfname.Text = "";
txtlname.Text = "";
txtpass.Text = "";

JSM College, Alibag Page 83


Mango Enterprises

txtuname.Text = "";
cbopermission.Text = "";
txtconpass.Text = "";

}
private void loadlist()
{
con.Close();
con.Open();
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from login";
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
int indexrow;
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
dgv1.DataSource = dt;
con.Close();
}

private void button1_Click(object sender, EventArgs e)


{
con.Open();
string qry = "update login set fname='" + txtfname.Text + "',lname='" +
txtlname.Text + "',uname='" + txtuname.Text + "',pass='" + txtpass.Text + "'
,permission='" + cbopermission.Text + "' where uid='" + txtuid.Text + "'";
SqlCommand cmd = new SqlCommand(qry, con);
cmd.ExecuteNonQuery();
cmd.Clone();
loadlist();
MessageBox.Show("Record Updated");
cls();
con.Close();
}

private void button2_Click(object sender, EventArgs e)


{
con.Open();
string qry = "delete from login where uid ='" + txtuid.Text + "'";
SqlCommand cmd = new SqlCommand(qry, con);
cmd.ExecuteNonQuery();
cmd.Clone();
loadlist();
MessageBox.Show("Record Deleted");
txtuid.Text = "";
con.Close();
}

JSM College, Alibag Page 84


Mango Enterprises

private void btnSearch_Click(object sender, EventArgs e)


{
con.Close();
con.Open();
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from login where uid='" + txtuid.Text + "'";
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
dgv1.DataSource = dt;
cls();
con.Close();
}

private void button3_Click(object sender, EventArgs e)


{
loadlist();
cls();
}

private void btnsave_Click(object sender, EventArgs e)


{
this.Close();
}

}
}

JSM College, Alibag Page 85


Mango Enterprises

11. Screen Layout with test data

Splash Screen

Login

JSM College, Alibag Page 86


Mango Enterprises

Main form

Product

JSM College, Alibag Page 87


Mango Enterprises

Client

User table

JSM College, Alibag Page 88


Mango Enterprises

Search

Purchase

JSM College, Alibag Page 89


Mango Enterprises

Sale

JSM College, Alibag Page 90


Mango Enterprises

Report Layout

JSM College, Alibag Page 91


Mango Enterprises

12. Report Layout

Sale Report

JSM College, Alibag Page 92


Mango Enterprises

Purchase Report

JSM College, Alibag Page 93


Mango Enterprises

Product

JSM College, Alibag Page 94


Mango Enterprises

Stock

JSM College, Alibag Page 95


Mango Enterprises

References
Bibliography
Website

JSM College, Alibag Page 96


Mango Enterprises

13. References, Bibliography,


Website

Books:
Beginning Visual C# 2010, K. Watson, Wrox

Beginning ASP.NET 4 in C# and VB, I. Spanjaars,

Websites

http://stackoverflow.com

https://www.codeproject.com

http://www.c-sharpcorner.com

JSM College, Alibag Page 97

Вам также может понравиться