⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 keypad.c

📁 欣技8000 资料 很适用的资料
💻 C
📖 第 1 页 / 共 3 页
字号:
				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("货号:");
	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("数量:");
		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;
		//建一临时数据库文件和索引文件,用以判断是否有重复的序列号
		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("序号:");
		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')
					{
						//把临时数据库删除
						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;
			}

			//判断序号是否重复
			//if(重复)goto INPUTISERIAL1;
			//else 把序号回入到临时数据库中
			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("数量:");
		i = read_nkey(0, 7, num_code, 5, 0);
		if(i == -1)
		{
			gotoxy(0, 3);
			if(SysParam.language == 1)
				puts("invalid");
			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')
					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)
	{
		//建一临时数据库文件和索引文件,用以判断是否有重复的序列号
		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("序号:");
		gotoxy(0,7);
		if(SysParam.language == 1)
			puts("left:");
		else 
			scputs("数量:");
		num = 0;
		while(1)
		{
			i = read_skey(0, 3, serial_code, 20, 0);
			if(i == -1)
			{
				//把临时的数据库删除
				remove("REPEAT");
				goto INPUTEND;
			}
			if(*serial_code == 0)
			{
				clr_scr();
				gotoxy(0, 1);
				puts("empty!");
				OSTimeDly(200);
				continue;
			}
			//判断序号是否重复
			//if(重复)goto continue;
			//else 把序号回入到临时数据库中
			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("序号:");
				gotoxy(0,7);
				if(SysParam.language == 1)
					puts("left:");
				else 
					scputs("数量:");
				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("继续从该供");
		gotoxy(0, 5);
		if(SysParam.language == 1)
			puts("provider");
		else 
		scputs("应商进货吗");
		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("继续对该进");
		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("出货单号:");
			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("客户代号:");

			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("货号:");
	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("数量:");
		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;

		//建一临时数据库文件和索引文件,用以判断是否有重复的序列号
		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("序号:");
		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')
					{
						//把临时数据库删除
						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;
		}
			//判断序号是否重复
			//if(重复)goto INPUTISERIAL1;
			//else 把序号回入到临时数据库中
			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
		//把临时的数据库删除
		remove("REPEAT");
	}//if

INPUTNUM2://only input num
	if(SysParam.oserial == 0 && SysParam.onum == 1)
	{
		gotoxy(0, 5);
		if(SysParam.language == 1)
			puts("number:");
		else 
			scputs("数量:");
		i = read_nkey(0, 7, num_code, 5, 0);
		if(i == -1)
		{
			gotoxy(0, 3);
			if(SysParam.language == 1)
				puts("invalid");
			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')
					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)
	{
		//建一临时数据库文件和索引文件,用以判断是否有重复的序列号
		if ((repeat_file = create_DBF((char*)"REPEAT", 20)) > 0)
		{

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -