BAKERY MANAGEMENT SYSTEM Project
BAKERY MANAGEMENT SYSTEM Project
Relationship:
Customer will have relationship with Registration, Login, Process an order, Inventory.
Manager will have relationship with Login, Order
Warehouse Staff will have relationship with Inventory.
Payment authentication will have relationship with Login, Order, Deliver
Warehouse system will have relationship with Inventory
Bakery staff will have relationship with Inventory
USE CASE DIAGRAMS
Domain Diagram of Bakery Management System
Domain Diagram of Bakery Management System Class Diagram describes the structure
of a Bakery Management System classes, their attributes, operations (or methods), and
the relationships among objects.
Sequence Diagram and Communication Diagram
Communication Diagram:
Class diagram Of System:
Chain Of Responsibility Design pattern :
Grasp pattern :
Code:
#include<stdio.h>
#include<stdlib.h>
#include <cstring>
#include<conio.h>
struct order
{
char code[20];
char name[20];
char date[20];
int cost;
}b;
struct bill
int bill_no;
char name[20];
long phone_no;
int total_amount,quantity;
}bi;
int price=60;
void insert_details();
void viewAll();
void find();
void order_item();
void old_record();
void search_bill();
void delete_item();
main(void)
char psword[100],user[100];
int diff,tm;
char p[100]="vinamra18",u[100]="vinamra",ch;
gets(user);
while(i!='\r')
i=getch();
if(i!='\r')
if(i!='\b')
psword[j]=i;
j++;
printf("@");
psword[j]='\0';
int ch;
do{
printf("\n====================================================================");
printf("\n");
printf("\n");
printf("\n====================================================================\n");
scanf("%d",&ch);
switch (ch)
case 1 :
insert_details();
break;
case 2:
viewAll();
break;
case 3:
find();
break;
case 4:
order_item();
break;
case 5:
old_record();
break;
case 6:
search_bill();
break;
case 7:
delete_item();
break;
case 0:
exit(0);
break;
default:
break;
}while(ch!=0);
void insert_details()
{
FILE *fp;
struct order b;
scanf("%s",b.code);
scanf("%s",b.name);
scanf("%s",b.date);
scanf("%d",&b.cost);
fp=fopen("bakery.txt","a");
if(fp == NULL)
else
fprintf(fp,"%s %s %s %d \n",b.code,b.name,b.date,b.cost);
printf("\n");
fclose(fp);
void find()
struct item_b;
FILE *fp;
char ch[20];
scanf("%s",ch);
fp = fopen("bakery.txt","r");
if(fp == NULL)
exit(1);
else
while(getc(fp) != EOF)
fscanf(fp,"%s %s %s %d",b.code,b.name,b.date,&b.cost);
if(strcmp(b.code,ch) == 0)
printf("%s / %s / %s / %d\n",b.code,b.name,b.date,b.cost);
printf("\n\t\tCode ::%s",b.code);
fclose(fp);
}
void viewAll()
char ch;
FILE *fp;
fp = fopen("bakery.txt","r");
if(fp == NULL)
exit(1);
else
system("clear");
printf("%c",ch);
fclose(fp);
void order_item()
struct order b;
int c=0,n,t=0;
FILE *fp;
FILE *ufp;
number++;
bi.bill_no=number;
bi.total_amount=0;
char ch;
char item_code[20];
fp = fopen("bakery.txt","r");
if(fp == NULL)
exit(1);
else
printf("%c",ch);
fclose(fp);
scanf("%s",bi.name);
scanf("%d",&bi.phone_no);
ufp=fopen("oldTransection1.txt","a");
fprintf(ufp,"\n\nbill no.: %d \nName of customer: %s \ncontact no.:
%d\n",bi.bill_no,bi.name,bi.phone_no);
printf("\n For order item Choosee item(Enter item Code First Letter Of item)\n");
do
scanf("%s",item_code);
fp = fopen("bakery.txt","r");
if(fp == NULL)
exit(1);
else
while(getc(fp) != EOF)
c=0;
fscanf(fp,"%s %s %s %d",b.code,b.name,b.date,&b.cost);
if(strcmp(b.code,item_code) == 0)
c=1;
printf("%s / %s / %s / %d\n",b.code,b.name,b.date,b.cost);
printf("\n\t\tCode ::%s",b.code);
printf("\n\t\titem name ::%s",b.name);
printf("\n\t\tPrice of item::%d",b.cost);
scanf("%d",&bi.quantity);
t=bi.total_amount+t;
if(ufp == NULL)
else
printf("\n");
fclose(fp);
if(c==0)
printf("\ninvalid item code\n");
scanf("%d",&n);
}while(n==1);
fclose(ufp);
void old_record()
char ch;
FILE *fp;
fp = fopen("oldTransection1.txt","r");
if(fp == NULL)
exit(1);
else
system("clear");
printf("%c",ch);
fclose(fp);
}
void search_bill()
struct order b;
int bill_no;
char ch;
int c1=0;
FILE *fp;
char name[20];
fp = fopen("oldTransection1.txt","r");
if(fp == NULL)
exit(1);
else
scanf("%d",&bill_no);
fscanf(fp,"%d %s %d %d %s %d
%d",&bi.bill_no,bi.name,&bi.phone_no,&bi.quantity,b.name,&b.cost,&bi.total_amount);
if(bill_no==bi.bill_no)
while(!bill_no)
c1=1;
printf("\ncustomer_name:%s\n",bi.name);
printf("bill_no.:%d\n",bi.bill_no);
printf("contact_no:%d\n",bi.phone_no);
printf("\nno. of items:%d",bi.quantity);
printf("\nitem:%d",b.name);
printf("\nMRP:%d",b.cost);
printf("\ntotal price:%d",bi.total_amount);
if(c1==0)
fclose(fp);
void add_item()
char ch;
FILE *ptr_file;
int x;
if (!ptr_file)
fprintf(ptr_file,"%d\n", x);
fclose(ptr_file);
void delete_item()
struct order b;
int n=1;
FILE *fp,*fp1;
char k[20];
puts(k);
fp=fopen("bakery.txt","r");
fp1=fopen("bakery1.txt","a");
while(!feof(fp))
{
fscanf(fp,"%s %s %s %d \n",b.code,b.name,b.date,&b.cost);
if(b.code!=k)
n=0;
fprintf(fp1,"%s %s %s %d \n",b.code,b.name,b.date,&b.cost);
else
continue;
if(n==1)
fclose(fp);
fclose(fp1);
remove("bakery.txt");
rename("bakery1.txt","bakery.txt");