Cs Project File-3
Cs Project File-3
CERTIFICAT
This is to certify that,
E
AKANKSHA SINGH of Class XII A Under Board Roll No _________ _has successfully
completed the Computer Science investigatory Project on Agro-Food Industry
Management System for the Session 2023-2024 under the guidance of Mrs. Rani Tiwari
PGT(Computer Science).
___________________ ___________________
___________________
EXTERNAL EXAMINER
INDEX
1. Certificate
2. Acknowledgement
3. Requirements
4. Project Introduction
5. Overview
6. Project code
7. Need for the project
8. Future scope of the project
9. Limitations of the project
10. Output
11. Conclusion
12. Bibliography
PROJECT CODE
import mysql.connector
cursor.execute('''
CREATE TABLE IF NOT EXISTS suppliers (
id INTEGER PRIMARY KEY,
supplier_id TEXT,
supplier_name TEXT,
supplier_contact TEXT
)
''')
cursor.execute('''
CREATE TABLE IF NOT EXISTS orders (
id INTEGER PRIMARY KEY,
order_id TEXT,
product_id TEXT,
quantity INTEGER,
order_date DATE
)
''')
conn.commit()
def add_product():
print("\n=== Add Product ===")
product_id = input("Enter Product ID: ")
product_name = input("Enter Product Name: ")
product_price = float(input("Enter Product Price: "))
def add_supplier():
print("\n=== Add Supplier ===")
supplier_id = input("Enter Supplier ID: ")
supplier_name = input("Enter Supplier Name: ")
supplier_contact = input("Enter Supplier Contact: ")
def place_order():
print("\n=== Place Order ===")
order_id = input("Enter Order ID: ")
product_id = input("Enter Product ID: ")
quantity = int(input("Enter Quantity: "))
order_date = input("Enter Order Date: ")
def display_products():
print("\n=== List of Products ===")
cursor.execute("SELECT * FROM products")
for row in cursor.fetchall():
print(f"ID: {row[0]}, Product ID: {row[1]}, Name: {row[2]}, Price:
{row[3]}")
def display_suppliers():
print("\n=== List of Suppliers ===")
cursor.execute("SELECT * FROM suppliers")
for row in cursor.fetchall():
print(f"ID: {row[0]}, Supplier ID: {row[1]}, Name: {row[2]}, Contact:
{row[3]}")
def display_orders():
print("\n=== List of Orders ===")
cursor.execute("SELECT * FROM orders")
for row in cursor.fetchall():
print(f"ID: {row[0]}, Order ID: {row[1]}, Product ID: {row[2]}, Quantity:
{row[3]}, Order Date: {row[4]}")
def search_product_by_name():
print("\n=== Search Product by Name ===")
search_name = input("Enter the Product Name to search: ")
if results:
for row in results:
print(f"ID: {row[0]}, Product ID: {row[1]}, Name: {row[2]}, Price:
{row[3]}")
else:
print("Product not found.")
def export_orders_to_csv():
print("\n=== Export Orders to CSV ===")
cursor.execute("SELECT * FROM orders")
orders = cursor.fetchall()
def main():
while True:
print("\n==== Agro Food Company Management System ====")
print("1. Add Product")
print("2. Add Supplier")
print("3. Place Order")
print("4. Display Products")
print("5. Display Suppliers")
print("6. Display Orders")
print("7. Search Product by Name")
print("8. Export Orders to CSV")
print("9. Exit")
if choice == '1':
add_product()
elif choice == '2':
add_supplier()
elif choice == '3':
place_order()
elif choice == '4':
display_products()
elif choice == '5':
display_suppliers()
elif choice == '6':
display_orders()
elif choice == '7':
search_product_by_name()
elif choice == '8':
export_orders_to_csv()
elif choice == '9':
print("Exiting the program.")
break
else:
print("Invalid choice. Please try again.")
if __name__ == "__main__":
main()
OUTPU
MANAGEMENT SYSTEM:
LIST: