-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCloth_Showroom.cpp
More file actions
548 lines (479 loc) · 10.8 KB
/
Copy pathCloth_Showroom.cpp
File metadata and controls
548 lines (479 loc) · 10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
#include<iostream>
#include<fstream>
#include<conio.h>
#include<string.h>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
class dress{
private:
char filename[20];
protected:
char dressname[60];
char dressid[10];
float price;
void get();
};
class emp{
private:
char filename[20];
protected:
char employeename[20];
char employeeid[10];
long long employeephone;
char employeeaddress[20];
float employeesalary;
void get();
};
void dress::get()
{
cout<<"\n ENTER DRESS NAME : ";
cin>>dressname;
cout<<"\n ENTER DRESS ID NO : ";
cin>>dressid;
cout<<"\n ENTER DRESS PRICE : ";
cin>>price;
strcpy(filename,dressid);
strcat(filename,".txt");
ofstream x(filename);
x<<"\n\nDRESS NAME :"<<dressname;
x<<"\n\nDRESS ID :"<<dressid;
x<<"\n\nPRICE :"<<price;
x.close();
}
void emp::get()
{
cout<<"\n ENTER EMPLOYEE NAME : ";
cin>>employeename;
cout<<"\n ENTER EMPLOYEE ID NO : ";
cin>>employeeid;
cout<<"\n ENTER EMPLOYEE PHONE NUMBER : ";
cin>>employeephone;
cout<<"\n ENTER EMPLOYEE ADDRESS : ";
cin>>employeeaddress;
cout<<"\n ENTER EMPLOYEE SALARY : ";
cin>>employeesalary;
strcpy(filename,employeeid);
strcat(filename,".txt");
ofstream y(filename);
y<<"\n\nEMPLOYEE NAME :"<<employeename;
y<<"\n\nEMPLOYEE ID NO :"<<employeeid;
y<<"\n\nEMPLOYEE PHONE NUMBER :"<<employeephone;
y<<"\n\nEMPLOYEE ADDRESS :"<<employeeaddress;
y<<"\n\nEMPLOYEE SALARY :"<<employeesalary;
y.close();
}
class male:protected dress
{
public:
male();
};
male::male()
{
get();
fstream x("MALE.txt",ios::app|ios::out);
x<<dressname;
x<<"\t"<<dressid;
x<<"\t "<<price<<endl;
x.close();
}
class female:protected dress
{
public:
female();
};
female::female()
{
get();
fstream x("FEMALE.txt",ios::app|ios::out);
x<<dressname;
x<<"\t"<<dressid;
x<<"\t "<<price<<endl;
x.close();
}
class childrn:protected dress
{
public:
childrn();
};
childrn::childrn()
{
get();
fstream x("CHILD.txt",ios::app|ios::out);
x<<dressname;
x<<"\t"<<dressid;
x<<"\t "<<price<<endl;
x.close();
}
class employee:protected emp
{
public:
employee();
};
employee::employee()
{
get();
fstream y("EMPLOYEE.txt",ios::app|ios::out);
y<<employeename;
y<<"\t"<<employeeid;
y<<"\t "<<employeephone;
y<<"\t "<<employeeaddress;
y<<"\t "<<employeesalary<<endl;
y.close();
}
class add
{
private:
int i;
public:
add();
};
add::add()
{
system("cls");
while(1)
{
system("cls");
cout<<"\n\n";
cout<<"\t\t Categories of the dress products\n\n";
cout<<"\n\n01. MALE DRESS. \n\n02. FEMALE DRESS. \n\n03. CHILDREN DRESS.";
/*cout<<"\n\n04.EMPLOYEE.*/cout<<"\n\n04. EXIT. ";
cout<<"\n\n\n\t Enter your option :";
cin>>i;
if(i==1)
{
male m;
}
if(i==2)
{
female f;
}
if(i==3)
{
childrn c;
}
/*if(i==4)
{
employee e;
}*/
if(i==4)
break;
}
}
class addemp{
private:
int j;
public:
addemp();
};
addemp::addemp()
{
system("cls");
employee e;
};
class search
{
private:
int m;
char ch;
public:
search();
};
search::search()
{
while(1)
{
system("cls");
cout<<"\n\n 01.Male dress";
cout<<"\n\n 02.Female dress";
cout<<"\n\n 03.Children dress";
//cout<<"\n\n 04.Employee";
cout<<"\n\n 04.Search by dress id";
cout<<"\n\n 05.Exit";
cout<<"\n\n\t Select an option :";
cin>>m;
if(m==1)
{
ifstream m("MALE.txt");
while(m)
{
m.get(ch);
cout<<ch;
}
getch();
}
if(m==2)
{
ifstream m("FEMALE.txt");
while(m)
{
m.get(ch);
cout<<ch;
}
getch();
}
if(m==3)
{
ifstream m("CHILD.txt");
while(m)
{
m.get(ch);
cout<<ch;
}
getch();
}
/* if(m==4)
{
ifstream m("EMPLOYEE.txt");
while(m)
{
m.get(ch);
cout<<ch;
}
getch();
}*/
if(m==4)
{
char did[10],filename[20];
cout<<"input id for search:";
cin>>did;
strcpy(filename,did);
strcpy(filename,did);
strcpy(filename,did);
strcat(filename,"MALE.txt");
strcat(filename,"FEMALE.txt");
strcat(filename,"CHILD.txt");
ifstream m(filename);
fstream x(filename,ios::out);
x<<"INFORMATION IS UNAVALABLE";
x.close();
while(m)
{
m.get(ch);
cout<<ch;
}
getch();
}
if(m==5)
break;
}
}
class showdress{
private:
int m;
char ch;
public:
showdress();
};
showdress::showdress()
{
while(1)
{
cout<<"\nSelect the category of dress : ";
cout<<"01.Male dress";
cout<<"\n\t\t\t\t02.Female dress";
cout<<"\n\t\t\t\t03.Children dress";
//cout<<"\n\n 04.Exit";
cout<<"\n\n\t Select an option :";
cin>>m;
if(m==1)
{
ifstream m("MALE.txt");
while(m)
{
m.get(ch);
cout<<ch;
}
getch();
}
if(m==2)
{
ifstream m("FEMALE.txt");
while(m)
{
m.get(ch);
cout<<ch;
}
getch();
}
if(m==3)
{
ifstream m("CHILD.txt");
while(m)
{
m.get(ch);
cout<<ch;
}
getch();
}
break;
}
}
class searchemp{
private:
int n;
char ch;
public:
searchemp();
};
searchemp::searchemp()
{
while(1)
{
system("cls");
cout<<"\n\n 01.List of Employees";
cout<<"\n\n 02.Search by id";
cout<<"\n\n 03.Exit";
cout<<"\n\n\t Select an option :";
cin>>n;
if(n==1)
{
ifstream n("EMPLOYEE.txt");
while(n)
{
n.get(ch);
cout<<ch;
}
getch();
}
if(n==2)
{
char eid[10],filename[20];
cout<<"input id for search:";
cin>>eid;
strcpy(filename,eid);
strcat(filename,"EMPLOYEE.txt");
ifstream n(filename);
fstream x(filename,ios::out);
x<<"INFORMATION IS UNAVALABLE";
x.close();
while(n)
{
n.get(ch);
cout<<ch;
}
getch();
}
if(n==3)
break;
}
}
class cut{
public:
cut();
};
cut::cut(){
char id[20],filename[20];
cout<<"\n\nEnter the id to delete : ";
cin>>id;
strcpy(filename,id);
strcat(filename,".txt");
fstream x(filename,ios::out);
x<<"INFORMATION IS UNAVALABLE";
x.close();
}
class buy{
public :
buy();
};
buy::buy(){
char id[20],filename[20];
cout<<"\n Enter the Dress ID to buy : ";
cin>>id;
strcpy(filename,id);
strcat(filename,".txt");
cout<<"Thanks for purchasing ";
fstream x(filename,ios::out);
x<<"Out of Stock";
x.close();
}
int main()
{
int i;
int j;
int k;
int id;
system("cls");
while(1)
{
//system("cls");
cout<< "Choose an option\n\n";
cout<< "\n\t01. Garments.\n";
/* cout<< "\n\t01. Add a product.\n";
cout<< "\n\t02. Search any product.\n";
cout<< "\n\t03. Delete any product.\n";*/
cout<< "\n\t02. Employee.\n";
cout<< "\n\t03. customer.\n";
cout<< "\n\t04. Exit.\n";
cout<< "\n\n\nEnter an option :";
cin>>i;
if(i==1)
{
while(1)
{
system("cls");
cout<< "Choose an option\n\n";
cout<< "\n\t01. Add a dress.\n";
cout<< "\n\t02. Search a dress.\n";
cout<< "\n\t03. Delete a dress.\n";
cout<< "\n\t04. Exit.\n";
cout<< "\n\n\nEnter an option :";
cin>>j;
if(j==1)
{
add a;
}
if(j==2)
{
search s;
}
if(j==3)
{
cut c;
}
if(j==4)
{
break;
}
}
}
if(i==2)
{
while(1)
{
system("cls");
cout<< "Choose an option\n\n";
cout<< "\n\t01. Add an Employee.\n";
cout<< "\n\t02. Search an Employee.\n";
cout<< "\n\t03. Delete an Employee.\n";
cout<< "\n\t04. Exit.\n";
cout<< "\n\n\nEnter an option :";
cin>>k;
if(k==1)
{
addemp ae;
}
if(k==2)
{
searchemp se;
}
if(k==3)
{
cut c;
}
if(k==4)
break;
}
}
if(i==3)
{
cout<<"\nHello welcome to E5 Garments\n";
showdress sd;cout<<endl;
buy b;cout<<endl;
// cout<<"thanks for purchase";
}
if(i==4)
break;
}
return 0;
}