-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
75 lines (72 loc) · 1.7 KB
/
main.cpp
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
#include "CaseRecord.h"
#include <curses.h>
#include <iostream>
#include <map>
#include <string.h>
#include <unistd.h>
using namespace std;
using namespace LawFirm;
void gotoxy(int x, int y)
{
printf("%c[%d;%df", 0x1B, y, x);
}
void scroll_note() //welcome note
{
system("figlet -cf big -t Law Firm Record Management System");
std::cout << "Press \'Return\' to continue." << endl;
std::cin.clear();
std::cin.get();
initscr();
noecho();
mvprintw(30, 23, "A K Harshith 4SF16IS001");
mvprintw(31, 23, "Akshay Ram Bhat 4SF16IS011");
mvprintw(32, 23, "Press Enter to continue");
getch();
endwin();
}
int main()
{
scroll_note();
CaseRecord caseRecord;
caseRecord.create_index();
int choice, count, mod_choice;
string key;
while (1)
{
std::cout << "\nMain Menu\n\n1. Add\t2. Search\t3. Delete\t4. Modify\t5. Exit\n";
std::cout << "Enter the choice:";
cin >> choice;
switch (choice)
{
case 1:
std::cout << "Data Entry\n";
caseRecord.read_data();
caseRecord.pack();
caseRecord.write_to_file();
break;
case 2:
caseRecord.disp();
std::cout << "\nEnter the name of the lawyer whose details you want to view: ";
cin >> key;
caseRecord.search(key);
break;
case 3:
std::cout << "\nEnter the name of the lawyer whose details you want to delete: ";
cin >> key;
if(caseRecord.remove(key)) std::cout << "Record deleted.";
else std::cout << "Record not found.";
break;
case 4:
std::cout << "Enter the name of the lawyer whose details you want to modify: ";
cin >> key;
caseRecord.modify(key);
std::cout << "Case Record modified.";
break;
case 5:
return 0;
default:
std::cout << "\n\nWrong choice\n";
break;
}
}
}