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

📄 menue3-modify.cpp

📁 tc 2.0下用680*480 256 色模式下写成的中文菜单程序
💻 CPP
字号:
int modefywork(int x,int y,struct work *p)
{
	int kx,ky;
	char string[15];
	saveimage(x,y,x+,y+,"e:\\keshe\\temp.bmp");
	Loadimage(x,y,"e:\\keshe\\modefiywork.bmp");
	puts16(x,y,p->cardmun);
	puts16(x,y,,p->idtification);
	puts16(x,y,p->name);
	if(p->sex==0)
		puts16(x,y,"man");
	else
		puts16(x,y,"woman");
    puts16(x,y,p->age);
	puts16(x,y,p->workyear);
	puts16(x,y,p->zhicheng);
	puts16(x,y,p->bianhao);
	puts16(x,y,p->section);
	puts16(x,y,p->homephone);
	puts16(x,y,p->mobiephone);
	puts16(x,y,p->month);
	while(1)
	{
        getkey(&kx,&ky);
		 if(kx==13)      /*enter*/ 
		 {
			 switch(state)
				 case 0:getstring(x,y,p->cardmun);
			            break:
				 case 1:getstring(x,y,p->idtification);
					    break;
				 case 2:getstring(x,y,p->name);
					    break;
				 case 3:
                        getint(x,y,p->sex);
					    break;
				 case 4:getint(x,y,p->age);
					    break;
				 case 5:getint(x,y,p->workyear);
					    break;
				 case 6:getstring(x,y,p->zhicheng);
					    break;
				 case 8:getstring(x,y,p->bianhao);
					    break;
				 case 9:getstring(x,y,p->section);
					    break;
				 case 10:getstring(x,y,p->homephone);
					    break;
				 case 11:getstring(x,y,p->mobiephone);
					    break;
				 case 12:getint(x,y,p->month);
					     break;
				 case 13:butt_down(13);
					     p->next=NULL;
					     Loadimage(x,y,"e:\\keshe\\temp.bmp");
						 return 1;
				 case 14:butt_down(14);
					     Loadimage(x,y,"e:\\keshe\\temp.bmp");
						 return 0;
		 }

	
		 else if(kx==27)
		 {
			 Loadimage(x,y,"e:\\keshe\\temp.bmp");
			 return 0;
		 }
		 else if(ky==80)    /*down*/
		 {
			 if(state>12)
			 {
				 state=state+1;
				 bar(state);
				 unbar(state-1);
			 }
			 else if(state==12)
			 {
				 state=13;
				 unbar(12);
				 butt_on(13);
			 }
		 }
		 else if(ky==72)      /*up*/
		 {
			 if(state==13)
			 {
				 state=12;
				 bar(12);
			     butt_off(13);
			 }
			 else if(state==14)
			 {  
				 state=12;
				 bar(12);
				 butt_off(13);
			 }
			 else if(0<state&&state<13)
			 {
				 state--;
				 bar(state);
				 unbar(--state);
			 }
		 }
		 else if(ky==75||ky==77)   /*left*/
		 {
			 if(state==13)
			 {
				 butt_on(14);
				 butt_off(13);
				 state=14;
			 }
			 else if(state==14)
			 {
				 butt_on(13);
				 butt_off(14);
				 state=13;
			 }
		 }
	 }
 }

 int modifysalary(int x,int y,struct  payroll *p)
 {
     int kx,ky;
	 int state=0;
	 char string[10];
	 saveimage(x,y,x+,y+,"e:\\keshe\\temp.bmp");
	 Loadimage(x,y,"e:\\keshe\\inputsalary.bmp");
	 atoi(p->month,string);
	 puts16(x,y,string,240);
	 atof(p->taxs,string);
	 puts16(x,y,string,240);
	 atof(p->basesalary,string);
	 puts16(x,y,string);
	 atof(&((p->a).salary),string);
	 puts16(x,y,string);
	 atof(&((p->a).grant),string);
	 puts16(x,y,string);
	 atof(&((p->a).award),string);
	 putts16(x,y,string);
	 atof(&((p->b.)Water),string);
	 puts16(x,y,string);
	 atof(&((p->b).Electricity),string);
	 while(1)
	 {
		 getkey(&kx,&ky);
		 if(kx==13)      /*enter*/ 
		 {
			 switch(state)
				 case 0:getint(x,y,&(p->month));
			            break:
				 case 1:getfloat(x,y,&(p->taxs));
					    break;
				
				 case 2:gefloat(x,y,&((p->a).basesalary));
					    break;
				 case 3:getfloat(x,y,&((p->a).salary));
					    break;
				 case 4:getfloat(x,y,&((p->a).grant));
					    break;
				 case 5:getfloat(x,y,&((p->a).award));
					    break;
				 case 6:getfloat(x,y,&((p->b.)Water));
					    break;
				 case 7:getfloat(x,y,&((p->b).Electricity));
					    break;
				 case 8:butt_down(8);      /*queding*/
                         (p->a).pay=(p->a).basesalary+(p->a).salary+(p->a).grant+(p->a).award;
						 (p->b).Clealing=5;
						 (p->b).costs=5;
						 p->paywage=(p->a).pay-p->taxs-(p->b).Water-(p->b).Electricity-10;
                         Loadimage(x,y,"e:\\keshe\\temp.bmp");
						 return 1;
				 case 9:butt_down(9);
					     Loadimage(x,y,"e:\\keshe\\temp.bmp");
						 return 0;
		 }
		else if(kx==27)  /*esc*/
		 {
			 Loadimage(x,y,"e:\\keshe\\temp.bmp");
			 return 0;
		 }
		 else if(ky==80)    /*down*/
		 {
			 if(state<7)
			 {
				 state=state+1;
				 bar(state);
				 unbar(state-1);
			 }
			 else if(state==7)
			 {
				 state=8;
				 unbar(7);
				 butt_on(8);
			 }
		 }
		 else if(ky==72)      /*up*/
		 {
			 if(state==8)
			 {
				 state=7;
				 bar(7);
			     butt_off(8);
			 }
			 else if(state==9)
			 {  
				 state=7;
				 bar(7);
				 butt_off(9);
			 }
			 else if(0<state&&state<8)
			 {
				 state--;
				 bar(state);
				 unbar(--state);
			 }
		 }
		 else if(ky==75||ky==77)   /*left*/
		 {
			 if(state==8)
			 {
				 butt_on(9);
				 butt_off(8);
				 state=9;
			 }
			 else if(state==9)
			 {
				 butt_on(8);
				 butt_off(9);
				 state=8;
			 }
		 }
	 }
 }

 void menue3()    /*modify*/
 {
    int xk,yk;
	int state=0;
	char sectionname[10];
	char workename[10];
	char month[10];
	int month1;
	struct work *p
	Loadimage(x,y,"e:\\keshe\\modify.bmp");
	while(1)
	{
		getkey(&xk,&yk);
    	if(yk==13)
		{
			Loadimage(x,y,"e\\keshe\\temp.bmp");
			return ;
		}
		else if(yk==27)
			switch(state)
			case 0: while(1)
		             {
						 diaologe1(x,y,"请输入您要修改的部门名称",sectionname);
						 {
							 if(findsection(phead,sectionname)==NULL)
							 {
								 if(dioaloge2(x,y,"无法找到","继续","取消")==0)
									 continue ;
								 else break:
							 }
							 else 
							 {
								 modefysection(phead,sectionname);
									 break;
							 }
						 }
		             }
		             break ;
            case 1:while(1)
		             {
						 diaologe1(x,y,"请输入您要修改的职工",workname);
						 {
							 if(findsection(phead,workname)==NULL)
							 {
								 if(dioaloge2(x,y,"无法找到","继续","取消")==0)
									 continue ;
								 else break:
							 }
							 else 
							 {
								 modefywork(phead,workname);
									 break;
							 }
						 }
		             }
		             break ;
			case 2:while(1)
				   {
					   diaologe2(x,y,"输入要修改的职工工资",);
                       if((q=findsection(phead,workname))==NULL)
					   {
						     if(dioaloge2(x,y,"无法找到","继续","取消")==0)
									 continue ;
								 else break:
							 }
							 else 
							 {
								 diaologe1(x,y,"输入要修改的月份",month);
								 month1=atoi(month);
								 for(q=q->p;q!=NULL;q=q->next)                                    
									 if( p->month==month1)
										 break;
								 if(p==NULL)
								 {
									 if(diaologe2(x,y,"无法找到","继续","取消")==0)
										 continue;
									 else
										 break;
								 }
								 modefiysalary(x,y,q);
								 break;
							 }
						 }
		             }
		             break ;
				       
		 else if(yk==80)  /*up*/
			 if(state==0)
			 {
				 state=2;
				 unrectangle(0);
				 rectangle(2);
			 }
			 else
			 {
				 state--;
				 unrectangle(state+1);
				 rectangle(state);
			 }
		 else if(yk==72)
			 if(state==0)
			 {   

				 state=2
				 unrectangle(2);
				 rectangle(0);
			 }
			 else
			 {
				 state++;
				 unrectangle(state-1);
				 rectangle(state);
			 }
	}
}

 void modifysection(struct section *phead,char *sectionname)
 {
	 struct section *p;
	 p=findsection(phead,section);
	 strcpy(p->name,sectionname);
 }


⌨️ 快捷键说明

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