-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainVewMenuInterface.cpp
More file actions
84 lines (75 loc) · 1.71 KB
/
MainVewMenuInterface.cpp
File metadata and controls
84 lines (75 loc) · 1.71 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
// MainVewMenuInterface.cpp: implementation of the MainVewMenuInterface class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "MainVewMenuInterface.h"
void sleep(){
Sleep(20);
return;
}
int MainVewMenuInterface::view(Person* v_Person) const{
if (v_Person == NULL)
return -1;
bool refresh = true;
string addr = ".\\contact\\";
int fuckin_stupid = 0;
int slct_num = 0;
do{
print_prsn(*v_Person,"=====VIEW Contact====================\n",refresh);
if (refresh){
readFile(".\\io\\View.io",sleep);
}
else{
readFile(".\\io\\View.io");
}
cin.clear();
cin.sync();
if (fuckin_stupid != 0)
cout<<"\t\tError Inputing!\n";
cout<<"\tEnter number[1-3] to select the corresponding function: ";
cin.clear();
cin.sync();
slct_num = getch();
fuckin_stupid++;
refresh = false;
}while((slct_num<'1') || (slct_num>'3'));
switch (slct_num){
case '1':
delete_prsn(*v_Person);
cin.clear();
cin.sync();
getch();
break;
case '2':
modify_prsn(*v_Person);
cin.clear();
cin.sync();
getch();
break;
case '3':
break;
}
return 0;
}
int MainVewMenuInterface::doMainStrategy()
{
int fuckin_stupid = 0;
char slct_num = 0;
do{
system("cls");
readFile(".\\io\\ViewMenu.io");
if (fuckin_stupid != 0)
cout<<"\t\tError Inputing!\n";
cout<<"\tEnter number[1-"<<ViewFunctionsNum<<"] to select the corresponding function: ";
cin.clear();
cin.sync();
slct_num = getch();
fuckin_stupid++;
}while((slct_num<'1') || (slct_num>'0' + ViewFunctionsNum));
viewStrategy = setViewStrategy(slct_num - '0');
if (viewStrategy == NULL)
return -1;
view(viewStrategy->doViewStrategy());
removeViewStrategy(viewStrategy);
return 0;
}