0% found this document useful (0 votes)
2 views

Project Implementation Guide

The document outlines a Project Implementation Guide for a Shop Management system, detailing steps for creating a database, tables, and stored procedures. It includes instructions for developing login forms, admin and user interfaces, cascading combo boxes, cart functionality, and generating reports. Example SQL code and C# snippets are provided for clarity on implementation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Project Implementation Guide

The document outlines a Project Implementation Guide for a Shop Management system, detailing steps for creating a database, tables, and stored procedures. It includes instructions for developing login forms, admin and user interfaces, cascading combo boxes, cart functionality, and generating reports. Example SQL code and C# snippets are provided for clarity on implementation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Project Implementation Guide

Step 1: Create Database, Tables, and Stored Procedures

-----------------------------------------------------

1. Database Setup:

Create a database `ShopManagement`.

Create the following tables:

- Product

- Model

- Users

- Cart

SQL Example:

CREATE TABLE Product (

Pid INT PRIMARY KEY IDENTITY(1,1),

Pname NVARCHAR(100),

Specification NVARCHAR(500),

Uprice DECIMAL(10, 2),

SOH INT

);

CREATE TABLE Model (

Mid INT PRIMARY KEY IDENTITY(1,1),

Mname NVARCHAR(100),

Pid INT FOREIGN KEY REFERENCES Product(Pid),

Specification NVARCHAR(500),
Uprice DECIMAL(10, 2),

SOH INT

);

CREATE TABLE Users (

UserId INT PRIMARY KEY IDENTITY(1,1),

Username NVARCHAR(50),

Password NVARCHAR(50),

Utype NVARCHAR(10)

);

CREATE TABLE Cart (

CartId INT PRIMARY KEY IDENTITY(1,1),

Mid INT FOREIGN KEY REFERENCES Model(Mid),

Pid INT FOREIGN KEY REFERENCES Product(Pid),

BillNo INT,

BillDate DATETIME,

Qty INT,

TotalAmount DECIMAL(10, 2)

);

2. Stored Procedures:

Add/Edit/Delete/View procedures for each table.

Example Stored Procedure:

CREATE PROCEDURE SP_AddProduct

@Pname NVARCHAR(100),
@Specification NVARCHAR(500),

@Uprice DECIMAL(10, 2),

@SOH INT

AS

BEGIN

INSERT INTO Product (Pname, Specification, Uprice, SOH)

VALUES (@Pname, @Specification, @Uprice, @SOH)

END

Step 2: Create Login Page

-------------------------

Create a login form with fields:

1. Username

2. Password

3. Redirect based on user type (Admin/User).

Step 3: Admin MDI Form

----------------------

1. Set IsMdiContainer = True and WindowState = Maximized.

2. Add MenuStrip with options:

- Product: Add, Edit, Delete, View.

- Model: Add, Edit, Delete, View.

- Reports.

- Exit.
Step 4: User MDI Form

---------------------

1. Set IsMdiContainer = True.

2. Menu Options:

- View Products

- View Models

Step 5: SDI Forms

-----------------

Create SDI forms for all CRUD operations.

Example Code (Add Product):

private void btnSave_Click(object sender, EventArgs e)

using (SqlConnection con = new SqlConnection("your_connection_string"))

SqlCommand cmd = new SqlCommand("SP_AddProduct", con);

cmd.CommandType = CommandType.StoredProcedure;

cmd.Parameters.AddWithValue("@Pname", txtPname.Text);

cmd.Parameters.AddWithValue("@Specification", txtSpecification.Text);

cmd.Parameters.AddWithValue("@Uprice", decimal.Parse(txtUprice.Text));

cmd.Parameters.AddWithValue("@SOH", int.Parse(txtSOH.Text));

con.Open();

cmd.ExecuteNonQuery();

MessageBox.Show("Product Added Successfully");

}
}

Step 6: Cascading Combo Boxes

-----------------------------

1. Load product in the first combo box.

2. Load models based on the selected product.

Example Code:

private void cmbProduct_SelectedIndexChanged(object sender, EventArgs e)

int productId = (int)cmbProduct.SelectedValue;

using (SqlConnection con = new SqlConnection("your_connection_string"))

SqlDataAdapter da = new SqlDataAdapter("SELECT Mid, Mname FROM Model WHERE Pid =

@Pid", con);

da.SelectCommand.Parameters.AddWithValue("@Pid", productId);

DataTable dt = new DataTable();

da.Fill(dt);

cmbModel.DataSource = dt;

cmbModel.DisplayMember = "Mname";

cmbModel.ValueMember = "Mid";

Step 7: Cart Functionality


--------------------------

1. Calculate Total (Qty * Uprice).

2. Add to Cart Table.

Example Code:

private void btnAddToCart_Click(object sender, EventArgs e)

int qty = int.Parse(txtQty.Text);

decimal uprice = decimal.Parse(txtUprice.Text);

decimal totalAmount = qty * uprice;

using (SqlConnection con = new SqlConnection("your_connection_string"))

SqlCommand cmd = new SqlCommand("INSERT INTO Cart (Mid, Pid, BillNo, BillDate, Qty,

TotalAmount) VALUES (@Mid, @Pid, @BillNo, @BillDate, @Qty, @TotalAmount)", con);

cmd.Parameters.AddWithValue("@Mid", cmbModel.SelectedValue);

cmd.Parameters.AddWithValue("@Pid", cmbProduct.SelectedValue);

cmd.Parameters.AddWithValue("@BillNo", GenerateBillNo());

cmd.Parameters.AddWithValue("@BillDate", DateTime.Now);

cmd.Parameters.AddWithValue("@Qty", qty);

cmd.Parameters.AddWithValue("@TotalAmount", totalAmount);

con.Open();

cmd.ExecuteNonQuery();

MessageBox.Show("Added to Cart Successfully");

}
Step 8: Reports

---------------

Generate reports for Products, Models, and Cart using DataGridView or Crystal Reports.

You might also like