📄 libsys.cpp
字号:
// LibSys.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "Data_Operate.h"
#include "Display.h"
#include "DataDefine.h"
#include "OtherFunc.h"
#include <string.h>
#include <ctype.h>
#include <conio.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
char Key_Value=0; //for store the key value
int ch=0;
BookData data[MAXSIZE]; //bookdata struct
FreeData(data); //free the struct for the safe
GetDataPoint(data);
ShowData(data);
ShowMenu();
while(Key_Value=GetKey())
{
switch(Key_Value)
{
case INSERT_KEY:
do
{
if(ch=='Y') //if yes?表示ch有意义,说明已经是第二次输入,需要刷新显示一下数据
{
system("cls"); //clean the screen
GetDataPoint(data);
ShowData(data);
ShowMenu();
}
if(!InsertData())//return false?
break;
gotoxy(0,24); //set the point
printf("继续?(Y/N)");
ch=getche();//get key
ch = toupper(ch);//转为大写易判断,如果用户输入了小写y/n
if(ch=='N')//n就出去
{
break;
}
}while(ch=='Y');
break;
case DELETE_KEY:
DeleteData(data);
break;
case EDIT_KEY:
EditData(data);
break;
case ORDER_KEY:
OrderData(data);
break;
case ABOUT_KEY:
ShowAbout();
break;
case EXIT_KEY:
printf("\n欢迎再次使用,再见!");
getche();//待确认
return 0;
default:
printf("\n无效菜单编号,请重新输入!\nPress any key to continue!");
getche();
break;
}
system("cls");
GetDataPoint(data);
ShowData(data);
ShowMenu();
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -