?? keypad.c
字號(hào):
if(SysParam.language == 1)
puts("exit");
else
scputs("退出嗎");
gotoxy(0, 7);
scputs("1 YES 2 NO");
while(1)
{
c = getchar();
if(c == '1')
goto INPUTEND;
else if(c == '2')
goto INPUTISHEE;
OSTimeDly (8);
}
}
if(has_member(ishee_file, 1, ishee_code))
{
OSTimeDly (100);
break;//go input the ishee
}
else
{
if(SysParam.language == 1)
{
gotoxy(0, 5);
puts("no match");
}
else
{
gotoxy(0, 5);
scputs("記錄不存在");
}
OSTimeDly (100);
}
}//while(1)
}//if
else ishee_code[0] = 0;
INPUTPROV:
if(SysParam.iprov == 1)
{
while(1)
{
clr_scr();
gotoxy(0, 1);
if(SysParam.language == 1)
puts("provider:");
else
scputs("供貨商:");
i = read_nkey(0, 3, prov_code, 4, 0);
if(i == -1)
{
gotoxy(0, 5);
if(SysParam.language == 1)
puts("sure to exit");
else
scputs("退出嗎");
gotoxy(0, 7);
scputs("1 YES 2 NO");
while(1)
{
c = getchar();
if(c == '1')
goto INPUTEND;
else if(c == '2')
goto INPUTPROV;
OSTimeDly (8);
}
}
if(has_member(prov_file, 1, prov_code))
{
get_member(prov_file, 1, temp);
if(SysParam.language == 1)
{
gotoxy(0, 5);
puts("provider: ");
gotoxy(0, 7);
puts(temp+4);
}
else
{
gotoxy(0, 5);
scputs("供貨商:");
gotoxy(0, 7);
scputs(temp+4);
}
OSTimeDly (100);
break;
}
else
{
if(SysParam.language == 1)
{
gotoxy(0, 5);
puts("no match");
}
else
{
gotoxy(0, 5);
scputs("記錄不存在");
}
OSTimeDly (100);
}
}//while(1)
}
else prov_code[0] = 0;
INPUTIGOOD:
good_code[0] = 0;
clr_scr();
gotoxy(0, 1);
if(SysParam.language == 1)
puts("goods:");
else
scputs("貨號(hào):");
i = read_nkey(0, 3, good_code, 20, 0);
if(i == -1)
{
gotoxy(0, 5);
if(SysParam.language == 1)
puts("exit");
else
scputs("退出嗎");
gotoxy(0, 7);
scputs("1 YES 2 NO");
while(1)
{
c = getchar();
if(c == '1')
goto INPUTEND;
else if(c == '2')
goto INPUTIGOOD;
OSTimeDly (8);
}
}//if
if(*good_code == 0)
{
clr_scr();
gotoxy(0, 1);
puts("empty!");
OSTimeDly(200);
goto INPUTIGOOD;
}
INPUTINUM1://input num and serial number
if(SysParam.inum == 1 && SysParam.iserial == 1)
{
gotoxy(0, 5);
if(SysParam.language == 1)
puts("number:");
else
scputs("數(shù)量:");
i = read_nkey(0, 7, num_code, 5, 0);
if(i == -1)
{
gotoxy(0, 5);
if(SysParam.language == 1)
puts("exit");
else
scputs("退出嗎");
gotoxy(0, 7);
scputs("1 YES 2 NO");
while(1)
{
c = getchar();
if(c == '1')
goto INPUTEND;
else if(c == '2')
goto INPUTINUM1;
OSTimeDly (8);
}
}//if
if(*num_code == 0)
{
clr_scr();
gotoxy(0, 1);
puts("empty!");
OSTimeDly(200);
goto INPUTINUM1;
}
num = atoi(num_code);
leftnum = num;
//建一臨時(shí)數(shù)據(jù)庫(kù)文件和索引文件,用以判斷是否有重復(fù)的序列號(hào)
if ((repeat_file = create_DBF((char*)"REPEAT", 20)) > 0)
{
create_index(repeat_file, 1, 0, 20);
}
INPUTISERIAL1:
clr_scr();
gotoxy(0, 1);
if(SysParam.language == 1)
puts("serial:");
else
scputs("序號(hào):");
gotoxy(0,7);
if(SysParam.language == 1)
puts("left:");
else
scputs("剩余:");
gotoxy(6,7);
printf("%4d",leftnum);
while(leftnum)
{
i = read_skey(0, 3, serial_code, 20, 0);
if(i == -1)
{
gotoxy(0, 3);
if(SysParam.language == 1)
puts("nocomplete");
else
scputs("還未完成");
gotoxy(0, 5);
if(SysParam.language == 1)
puts("exit");
else
scputs("退出嗎");
gotoxy(0, 7);
scputs("1 YES 2 NO");
while(1)
{
c = getchar();
if(c == '1')
{
//把臨時(shí)數(shù)據(jù)庫(kù)刪除
remove("REPEAT");
goto INPUTEND;
}
else if(c == '2')
{
goto INPUTISERIAL1;
}
OSTimeDly (8);
}//while
}//if
if(*serial_code == 0)
{
clr_scr();
gotoxy(0, 1);
puts("empty!");
OSTimeDly(200);
goto INPUTISERIAL1;
}
//判斷序號(hào)是否重復(fù)
//if(重復(fù))goto INPUTISERIAL1;
//else 把序號(hào)回入到臨時(shí)數(shù)據(jù)庫(kù)中
if(has_member(repeat_file, 1, serial_code))
{
clr_scr();
gotoxy(0, 1);
puts("repeat!");
OSTimeDly(200);
goto INPUTISERIAL1;
}
else
{
add_member(repeat_file, serial_code);
}
get_time(curtime);
sprintf(databuf, "%s,%s,%s,%s,%s,%s,%s",oper_code, ishee_code, prov_code, good_code, num_code, serial_code, curtime);
appendln(input_file, databuf);
leftnum--;
gotoxy(6,7);
printf("%4d",leftnum);
}//while
remove("REPEAT");
}//if
INPUTINUM2://input num only
if(SysParam.iserial == 0 && SysParam.inum == 1)
{
gotoxy(0, 5);
if(SysParam.language == 1)
puts("number:");
else
scputs("數(shù)量:");
i = read_nkey(0, 7, num_code, 5, 0);
if(i == -1)
{
gotoxy(0, 3);
if(SysParam.language == 1)
puts("invalid");
else
scputs("輸入無(wú)效");
gotoxy(0, 5);
if(SysParam.language == 1)
puts("exit");
else
scputs("退出嗎");
gotoxy(0, 7);
scputs("1 YES 2 NO");
while(1)
{
c = getchar();
if(c == '1')
goto INPUTEND;
else if(c == '2')
goto INPUTINUM2;
OSTimeDly (8);
}//while
}//if
if(*num_code == 0)
{
clr_scr();
gotoxy(0, 1);
puts("empty!");
OSTimeDly(200);
goto INPUTINUM2;
}
num = atoi(num_code);
get_time(curtime);
sprintf(databuf, "%s,%s,%s,%s,%s,%s",oper_code, ishee_code, prov_code, good_code, num_code, curtime);
appendln(input_file, databuf);
}//else if
//only input serial number
if(SysParam.iserial == 1 && SysParam.inum == 0)
{
//建一臨時(shí)數(shù)據(jù)庫(kù)文件和索引文件,用以判斷是否有重復(fù)的序列號(hào)
if ((repeat_file = create_DBF((char*)"REPEAT", 20)) > 0)
{
create_index(repeat_file, 1, 0, 20);
}
clr_scr();
gotoxy(0, 1);
if(SysParam.language == 1)
puts("serial:");
else
scputs("序號(hào):");
gotoxy(0,7);
if(SysParam.language == 1)
puts("left:");
else
scputs("數(shù)量:");
num = 0;
while(1)
{
i = read_skey(0, 3, serial_code, 20, 0);
if(i == -1)
{
//把臨時(shí)的數(shù)據(jù)庫(kù)刪除
remove("REPEAT");
goto INPUTEND;
}
if(*serial_code == 0)
{
clr_scr();
gotoxy(0, 1);
puts("empty!");
OSTimeDly(200);
continue;
}
//判斷序號(hào)是否重復(fù)
//if(重復(fù))goto continue;
//else 把序號(hào)回入到臨時(shí)數(shù)據(jù)庫(kù)中
if(has_member(repeat_file, 1, serial_code))
{
clr_scr();
gotoxy(0, 1);
puts("repeat!");
OSTimeDly(200);
clr_scr();
gotoxy(0, 1);
if(SysParam.language == 1)
puts("serial:");
else
scputs("序號(hào):");
gotoxy(0,7);
if(SysParam.language == 1)
puts("left:");
else
scputs("數(shù)量:");
gotoxy(6,7);
printf("%4d",num);
continue;
}
else
{
add_member(repeat_file, serial_code);
}
get_time(curtime);
sprintf(databuf, "%s,%s,%s,%s,1,%s,%s",oper_code, ishee_code, prov_code, good_code, serial_code, curtime);
appendln(input_file, databuf);
num++;
gotoxy(6,7);
printf("%4d",num);
}//while
}//else if
if(SysParam.iprov == 1)
{
clr_scr();
gotoxy(0, 3);
if(SysParam.language == 1)
puts("go on for");
else
scputs("繼續(xù)從該供");
gotoxy(0, 5);
if(SysParam.language == 1)
puts("provider");
else
scputs("應(yīng)商進(jìn)貨嗎");
gotoxy(0, 7);
scputs("1 YES 2 NO");
while(1)
{
c = getchar();
if(c == '1')
goto INPUTIGOOD;
else if(c == '2')
{
break;
}
OSTimeDly (8);
}//while
}
if(SysParam.ishee == 1)
{
clr_scr();
gotoxy(0, 3);
if(SysParam.language == 1)
puts("go on for");
else
scputs("繼續(xù)對(duì)該進(jìn)");
gotoxy(0, 5);
if(SysParam.language == 1)
puts("the sheet");
else
scputs("貨單操作嗎");
gotoxy(0, 7);
scputs("1 YES 2 NO");
while(1)
{
c = getchar();
if(c == '1')
goto INPUTPROV;
else if(c == '2')
{
break;
}
OSTimeDly (8);
}//while
}
INPUTEND:
;
}
void output()
{
int i;
int num;
int leftnum;
char c;
char oper_code[10];
char oshee_code[10];
char cust_code[10];
char num_code[10];
char good_code[25];
char serial_code[25];
char temp[50];
char databuf[100];
char curtime[16];
INPUTOOPER:
if(SysParam.ooper == 1)
{
while(1)
{
clr_scr();
gotoxy(0, 1);
if(SysParam.language == 1)
puts("operator:");
else
scputs("操作員:");
i = read_nkey(0, 3, oper_code, 4, 0);
if(i == -1)
{
gotoxy(0, 5);
if(SysParam.language == 1)
puts("exit");
else
scputs("退出嗎");
gotoxy(0, 7);
scputs("1 YES 2 NO");
while(1)
{
c = getchar();
if(c == '1')
goto OUTPUTEND;
else if(c == '2')
goto INPUTOOPER;
OSTimeDly (8);
}
}
if(has_member(oper_file, 1, oper_code))
{
get_member(oper_file, 1, temp);
if(SysParam.language == 1)
{
gotoxy(0, 5);
puts("operator: ");
gotoxy(0, 7);
puts(temp+4);
}
else
{
gotoxy(0, 5);
scputs("操作員:");
gotoxy(0, 7);
scputs(temp+4);
}
OSTimeDly (100);
break;//go input the ishee
}
else
{
if(SysParam.language == 1)
{
gotoxy(0, 5);
puts("no match");
}
else
{
gotoxy(0, 5);
scputs("不存在");
}
OSTimeDly (100);
}
}//while(1)
}
else oper_code[0] = 0;
INPUTOSHEE://input shipment sheet
if(SysParam.oshee == 1)
{
while(1)
{
clr_scr();
gotoxy(0,1);
if(SysParam.language == 1)
puts("list number:");
else
scputs("出貨單號(hào):");
if(read_nkey(0, 3, oshee_code, 4, 0) == -1)
{
gotoxy(0, 5);
if(SysParam.language == 1)
puts("exit");
else
scputs("退出嗎");
gotoxy(0, 7);
scputs("1 YES 2 NO");
while(1)
{
c = getchar();
if(c == '1')
goto OUTPUTEND;
else if(c == '2')
goto INPUTOSHEE;
OSTimeDly (8);
}
}
if(has_member(oshee_file, 1, oshee_code))
{
OSTimeDly (100);
break;
}
else
{
if(SysParam.language == 1)
{
gotoxy(0, 5);
puts("no match");
}
else
{
gotoxy(0, 5);
scputs("記錄不存在");
}
OSTimeDly (100);
}
}//while(1)
}//if
else oshee_code[0] = 0;
INPUTCUST:
if(SysParam.ocust == 1)
{
while(1)
{
clr_scr();
gotoxy(0, 1);
if(SysParam.language == 1)
puts("customer:");
else
scputs("客戶代號(hào):");
i = read_nkey(0, 3, cust_code, 4, 0);
if(i == -1)
{
gotoxy(0, 5);
if(SysParam.language == 1)
puts("exit");
else
scputs("退出嗎");
gotoxy(0, 7);
scputs("1 YES 2 NO");
while(1)
{
c = getchar();
if(c == '1')
goto OUTPUTEND;
else if(c == '2')
goto INPUTCUST;
OSTimeDly (8);
}
}
if(has_member(cust_file, 1, cust_code))
{
get_member(cust_file, 1, temp);
if(SysParam.language == 1)
{
gotoxy(0, 5);
puts("customer: ");
gotoxy(0, 7);
puts(temp+4);
}
else
{
gotoxy(0, 5);
scputs("客戶:");
gotoxy(0, 7);
scputs(temp+4);
}
OSTimeDly (100);
break;
}
else
{
if(SysParam.language == 1)
{
gotoxy(0, 5);
puts("no match");
}
else
{
gotoxy(0, 5);
scputs("記錄不存在");
}
OSTimeDly (100);
}
}//while(1)
}
else cust_code[0] = 0;
INPUTGOOD:
good_code[0] = 0;
clr_scr();
gotoxy(0, 1);
if(SysParam.language == 1)
puts("goods:");
else
scputs("貨號(hào):");
i = read_nkey(0, 3, good_code, 20, 0);
if(i == -1)
{
gotoxy(0, 5);
if(SysParam.language == 1)
puts("exit");
else
scputs("退出嗎");
gotoxy(0, 7);
scputs("1 YES 2 NO");
while(1)
{
c = getchar();
if(c == '1')
goto OUTPUTEND;
else if(c == '2')
goto INPUTGOOD;
OSTimeDly (8);
}
}
if(*good_code == 0)
{
clr_scr();
gotoxy(0, 1);
puts("empty!");
OSTimeDly(200);
goto INPUTGOOD;
}
INPUTONUM1://input num and serial number
if(SysParam.onum == 1 && SysParam.oserial == 1)
{
gotoxy(0, 5);
if(SysParam.language == 1)
puts("number:");
else
scputs("數(shù)量:");
i = read_nkey(0, 7, num_code, 5, 0);
if(i == -1)
{
gotoxy(0, 5);
if(SysParam.language == 1)
puts("sure to exit");
else
scputs("退出嗎");
gotoxy(0, 7);
scputs("1 YES 2 NO");
while(1)
{
c = getchar();
if(c == '1')
goto OUTPUTEND;
else if(c == '2')
goto INPUTONUM1;
OSTimeDly (8);
}
}//if
if(*num_code == 0)
{
clr_scr();
gotoxy(0, 1);
puts("empty!");
OSTimeDly(200);
goto INPUTONUM1;
}
num = atoi(num_code);
leftnum = num;
//建一臨時(shí)數(shù)據(jù)庫(kù)文件和索引文件,用以判斷是否有重復(fù)的序列號(hào)
if ((repeat_file = create_DBF((char*)"REPEAT", 20)) > 0)
{
create_index(repeat_file, 1, 0, 20);
}
INPUTSERIAL1:
clr_scr();
gotoxy(0, 1);
if(SysParam.language == 1)
puts("serial:");
else
scputs("序號(hào):");
gotoxy(0,7);
if(SysParam.language == 1)
puts("left:");
else
scputs("剩余:");
while(leftnum--)
{
i = read_skey(0, 3, serial_code, 20, 0);
if(i == -1)
{
gotoxy(0, 3);
if(SysParam.language == 1)
puts("nocomplete");
else
scputs("未完成");
gotoxy(0, 5);
if(SysParam.language == 1)
puts("sure to exit");
else
scputs("退出嗎");
gotoxy(0, 7);
scputs("1 YES 2 NO");
while(1)
{
c = getchar();
if(c == '1')
{
//把臨時(shí)數(shù)據(jù)庫(kù)刪除
remove("REPEAT");
goto OUTPUTEND;
}
else if(c == '2')
{
goto INPUTSERIAL1;
}
OSTimeDly (8);
}//while
}//if
if(*serial_code == 0)
{
clr_scr();
gotoxy(0, 1);
puts("empty!");
OSTimeDly(200);
goto INPUTSERIAL1;
}
//判斷序號(hào)是否重復(fù)
//if(重復(fù))goto INPUTISERIAL1;
//else 把序號(hào)回入到臨時(shí)數(shù)據(jù)庫(kù)中
if(has_member(repeat_file, 1, serial_code))
{
clr_scr();
gotoxy(0, 1);
puts("repeat!");
OSTimeDly(200);
goto INPUTSERIAL1;
}
else
{
add_member(repeat_file, serial_code);
}
get_time(curtime);
sprintf(databuf, "%s,%s,%s,%s,%s,%s,%s",oper_code, oshee_code, cust_code, good_code, num_code, serial_code, curtime);
appendln(output_file, databuf);
gotoxy(6,7);
printf("%4d",leftnum);
}//while
//把臨時(shí)的數(shù)據(jù)庫(kù)刪除
remove("REPEAT");
}//if
INPUTNUM2://only input num
if(SysParam.oserial == 0 && SysParam.onum == 1)
{
gotoxy(0, 5);
if(SysParam.language == 1)
else
scputs("數(shù)量:");
i = read_nkey(0, 7, num_code, 5, 0);
if(i == -1)
{
gotoxy(0, 3);
if(SysParam.language == 1)
puts("invalid");
else
scputs("輸入無(wú)效");
gotoxy(0, 5);
if(SysParam.language == 1)
puts("sure to exit");
else
scputs("退出嗎");
gotoxy(0, 7);
scputs("1 YES 2 NO");
while(1)
{
c = getchar();
if(c == '1')
goto OUTPUTEND;
else if(c == '2')
goto INPUTNUM2;
OSTimeDly (8);
}//while
}//if
if(*num_code == 0)
{
clr_scr();
gotoxy(0, 1);
puts("empty!");
OSTimeDly(200);
goto INPUTNUM2;
}
num = atoi(num_code);
get_time(curtime);
sprintf(databuf, "%s,%s,%s,%s,%s,%s",oper_code, oshee_code, cust_code, good_code, num_code, curtime);
appendln(output_file, databuf);
}//else if
//only input serial number
if(SysParam.oserial == 1 && SysParam.onum == 0)
{
//建一臨時(shí)數(shù)據(jù)庫(kù)文件和索引文件,用以判斷是否有重復(fù)的序列號(hào)
if ((repeat_file = create_DBF((char*)"REPEAT", 20)) > 0)
{
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -