[go: up one dir, main page]

0% found this document useful (0 votes)
56 views12 pages

Cs Projectile

This document contains code for an inventory management system with the following features: 1. Modules for product management, purchase management, sales management, and user management. 2. Functions for inserting product data, customer data, and viewing products and customers. 3. A function for customers to purchase products that retrieves product details from the database and calculates total cost. The code is written in Python and uses MySQL for the database. It provides a basic framework for managing inventory, customers, and sales transactions.

Uploaded by

bhavya partap
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)
56 views12 pages

Cs Projectile

This document contains code for an inventory management system with the following features: 1. Modules for product management, purchase management, sales management, and user management. 2. Functions for inserting product data, customer data, and viewing products and customers. 3. A function for customers to purchase products that retrieves product details from the database and calculates total cost. The code is written in Python and uses MySQL for the database. It provides a basic framework for managing inventory, customers, and sales transactions.

Uploaded by

bhavya partap
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/ 12

(LNTWTDVNYN

AHOINANI)
LOINoHd
Index

SNO CONTENT PAGE


NO.

Certificate 4

2 Acknowledgement 5

3 Synopsis 6-7

Source Code 8-16

5 Output 17-18

6 bibliography 19
Certilicate
This is to certily that computer ocience paject
titlesly "Jnventeuy Management" has been
uccessfully completed by Shruti Chauhan of
class 12th e bearing oll no..... under the
guidance of Mo.Puiyanka ma'am (suliject
teacher) as prescribed by the CBSE duwring
the academic periad of 2021-2022.
acknowledgement
would like ta express a deep sense af thanks
aurd gratitude to
ny project guide Ms. Puiyanka
2m an for guiding meimmensely thraugh the
counse af the
project. She aluways evinced keen
interest in my
praject.
My sincere thanks ga ta Mo. Rashmi
own
principal ma'am, for her ca-ordination in
eatending eveny passible suppot far
campletion of this project.
I alsa thanhs ta
my parents fon their
motivation and
suppot. J must thank my
classmate for thein
timely help andouppot.
Last but nat least, I
thase wha had
would like ta thank ae
helped divectly or indinectly
towands the
completion of this project.
Sfruti chauhan
(12th e)
Synopsis
About the pwject
Jwentony management is the practice of
ondening, otoning, tracking and contralling
ta
inventouy. Jnventouy management applies
its product
eveuy item a business uses to puoduce
oewice- puom uau mateials to inished goods.
Jn other wonds, inventony managenent couers

eweuy aspect of a
business's inventouy.

The project contains the (ollowinq modules:


used ta
1.Puoduct management:_this module is
add, update and delete the puaducts.
2.Fuwchasemanagement: this module isused to
the sale af the sqstem.
manage the pwchase
module is used toa
3. Sales manaqement: this
manage the sale af the products.
#.Use management: this module is used to
add/delete the usen/staff.
. Dataliasesetup: this madule is used to oetup
the database in the system fon the finst time.

Saltunane specilication
Operating system: Windou 10
Plaifeum: Python 3DLE 3.8.5
Database: MySeL

Languages: Python

Nate
Far Python-MyS@L connectirity, following
data haue been used:

Host: local-host, uwer: naot, pasoword:


database: stockh
e t platform
mer mysql, eonnector
myab "mY3ql.connector.connect (hoat"localhost",user"rod
passwcl"root",
database-"cosme tic", charset"utfo")
mycursormydb.cursort)
df cosmeticsInsert ( ) :

code-int
(input ("Enter the cosmet.ic ID number "))
J.append (code)
naeinput ("Enter the oomet icD Name "
1.append (name)
Company-input ("Enter company of CoImeties ")
1.append(company)
coSt int (input ("Enter the Cost"))
1.append (cost)
anudteinut ("Enter the Dace ot Manufaccure : ")
l.append (manucdate)
expdateminput ("Enter the Date of Expiry : ")
1.append (expdate)
stud= (1)
"

nto pzduct (cocle, name, company, cost, manudate, ex5date) values ($s, is, is, $s, *s, * )
**sert
mycursoX.execute (sql, stud)
mycb.commit (

der customerInsert ())

cust idinput ("Enter the Custoter aumber: ")


.aPpend (cust_id)
enameinput ("Enter the tustomer Name: ")
1.append (cname)
Customer
c_phoneo-input ("Enter Fhone no. o
1.append(c_phoneno)
C_address=input ( "Enter Address")
1.append (c_address)
gender=input ( "Enter gende? of Cust omer: ")
1.append (gender)
membezship=1nput ("Eater the membership: ")
1.append (membership)
"
stud(1) gendex, membership)
values (s, $s, s , ts, as, $s)
sql"insext into customer (cust_id, caame, c_phoneno, c_address,
TyCursor.execute (sql,stud)
mydb.commit ()

e i cO3metic3View (): search critera: ")


the
print ("Select
print ("i. Pzodact Id")
PELnt ("2. Product Name")
D i n t ( " 3 . Al1")
choice: ")}
ch23t (2nput ("Enter th
f ch==1:
Product ID "})
s=int(input (" nter
rl=(s, wheXe code$s"
* iron product
sql="select
mycursor.execute (sql, T1)
e S m y e u r s o r . f e t c h a l l ()

print (x*)

eLif chs-2:
Product Name :")
=input ("Enter
rame=$s"
r1=(ss where

sql="select fxom product


aycursor.execute (sql, rl)
res=mycuzsor.fetchall ()

fox res
p i n t (2)

. ch==3:
preduct"
' trom
s q l " s e l e c t

mycursor. execute (sql)


res=mycursor.tetchall () as
follows : ") Expiry) ")
deta2ls
are Date oz
toCR Hanufasture,
D&te Of
3metics CSt,
print
("The
ID, COsime tic Nan*
(Cosmetics
print ("

p r i n t (*)
2e viewCustomer ()
PIint("Select the seazch cziteria: ")
print("l. Customer ID")
print("2. Cust omer Name")
print("3. A1l")
ch-int (input ("Enter the choice : "))
ch=l:
3 i n t (1nput ("Enter cust omer ID : "))
zl=(s,)
sq"3elect from customer where cust_id=$s"
mycursor.execute (sql, rl)
resmycursor.fetchall ()
for x 1.n res:
print (x)
I i f ch=-2
Sinput("Enter Cosmetics Name ")
zl=(s,)
9q1"9elect frcm customer where Crama=*s"
mycursoI.execute (sql, zl)
resmycursor.fetchall ()
for z in res:
print (x)
elf ch=3:

sql-"selectfron customer"
mycursor.execute (sql)
resmycursor.fetchall (
print("The Cosmetics Stock detail1s are as follcws :")
print (" (Cosmetics ID, Cosuetics Hame, Cost, Date of Manufacture, DatE a Expir7! ")
for x i7 res:
print (x)

def CustomerPurchase ():


pzint ("Flease enter the details to purchase cosmetics producT :")
sql-"select from product"
mycur30r.execute (sql)
resmycursor.fetchall ()
print("The Cosmetics Stock details are as iollows: ")
print (" (Cesmetics ID, Cosmetics Hame, Cost, Date of Manufactare, Date f ExpirY) ")
f i n res:
print (x)
costso.0
LI-dict ()
ch-'y'

ch!='n')
cl=input ( "Enter the items to be purchased : ")

z1=(cl, )
sql="Select cost from product where name=is"
mycursor.execute (sql, rl)
res-mycursor. fetchall ()
tsum=00
for x 17 res:

cost-float (x[0])
print (cost)
ql=int (input ("Enter the item quantity: "))
cc=ql*cost
print (cc)
tsu=tsum+cc
ch-input ( "Want to purchase more item9: ")

print("Total coST of tem prchased 15 Rs.", tsum)


clef removeCosmetics ():
the cosmetics name to be d e l e t e d : ")
name=input ("Enter
rl=(name,)
sql="Delete frem product where name=$"
mycursor. execute (sql, r1)
sql="Delete from customer where cname=$s"
mycursor. ecute (sql, Il)
mydb.commit ()

dei MenuSet () : # Function For The Student Management System

Print("Enter 1 : To Adcd cosmetics product")

print ("Enter To View Complete Cosmetics Stock")


PIint( "Enter 3 : To Purchase any cosmetics Product ")
PIint("Enter 4 To Remove any Cosmetic product")
i n t ( "Enter 5 To Add Customer Details")

print ( "Enter 6:To View Cust omer Details")

#Using Exceptions Foz Validation


userInput = i n t (input ("Please Select An Above Option: ")) #Ni11 Take Input From User
ex cept ValueError:

exit("\nHy: That's Not A Nunber") #Error Message


e
print("\n") #Print New Line
i f(useIInput 1):
cosmeticsInsert()
elif (userInputs=2):
cosmeticsView ()
1 if (userInput-=3)
CustomerPurchase ()
elif (user Input=4):
removeCosmetics ()
eli (userInput=-5) :
customerInsert ()
elif (user+nputs=6):
viewcustomer ()

p r i n t ("Enter CorreCt choice. ")

MenuSet ()
cief runAgain()
runAgn = input ("\nwant To Run Again Y/n: ")

wile(runAgn.1ower() 'y'}:
(platform. system() "Windows") :

print (os.system('cla'))
else:
print (os.system('clear'))
MenuSet ()
runAgn input ("\nwant To
= Run Again Y/n: ")
print("Good Bye")
runAgain()

Coding
Enter 1:To Add cosmetics product
Enter 3
2: : To View Complete Cosmetica Stock
Enter
Enter :
To Purchase
any cosmetics
Product
To Remove any Cosmetic product
Enter 5 To View Customer Details
Please Select An Above Option: 1

Enter the cosmetic ID number 111


Enter the Cosmetics Name: jatin
Enter company
of Cosmetics yaggay
Enter the Cost 69
Enter the Date of Manufacture : 18/3/2002
Enter the Date of Expiry 25/5/2020

Enter 1 To Add cosmetics product


ter 2 To View Complete Cosmetics Stock
Enter 3 To Purchase any cosmetics Product
Enter 4 :To Remove
CoSmetic
Enter 5 : To View Customer Detailsproduct
any

Please Select An Above Option: 2

Select the search criteria


Roll
2 Name
3. A11
Enter the choice: 3
The Cosmetics Stock details are as Eollows:
(CoSmetics ID, Cosmetics Name, Cost, Date of Manufacture, Date of Expiry)
(69 yaggay 42069, sai villa', 'F' 'precius)
Enter 1 To Add cosmetics product
Enter 2 To view Complete Cosmetics Stock
Bnter 3 To Purchase any
Enter 4 To Remove any
coametics Product
Cosmetic product
Enter 5 To View Customer Details
Please Select An Above option: 3

Please enter the detaila to


purchase cosmetics
The Cosmetics
Stock details a r e product
followa as
(Cosmetics ID, Cosmetica Name Cost, Date of
("69'yaggay 42069,sai villa' F' precius') Manufacture, Date of
Expiry)
Enter the items
to be purchas3ed jatin
69.0
Enter the item quantity: 4
276.0
Want to purchase more itemsY
Enter customer ID120
Enter customer nameamit
Enter Phone no.420619
Enter Addresschautala amrit\
Enter your Genderbi
Enter membershipchutiya
Record of customer saves...
Total cost of item purchased is Rs. 276.0

want To Run Again Y/n: n


Good Bye
Database
CAProgram Files\MySQLMySQL Server 5.11bin\mysql.exe
Enter password: *
telcone to the MysQL
Your MysQL connection nonitor.
Connands end with or g.
id is 2
Server version 5.1.33-comnunity MySQL Connunity Server (GPLD
ype helps or for he lp, Type"se to clear the buffer.
mysql use cosnetics
patabase changed
nysgl desc product
Field Iype Null 1 Key 1 Default 1 Extra 1
code int 30) NO PRI NULL
nane VarcharC30) N0 NULL
conpany
cost
varcharC30): NO NULL
int (30) NO NULL
manudate varchar(30) NO NULL
expdate varchar(30) INO NULL
6 Pows' in set (O.02 secE)

nysql desc custoners

Pield Iype Null Key 1 Default Extra


cust id varchar(30) NO PRI 1 NULL
Cnane varchar(30) NO INULL
c_phoneno int(30) NO NULL
c_address varchar(30) i NO NULL
gender varchar(10) NO NULL
menbership varchar(20)NO NULL

6 rows in set (0.01 sec)


Bibliography
ww.aeegle.cem
www.pythen.ong
>BOOK- Python by Sunita Arora

You might also like