📄 house_open.ec
字号:
/* 住房基金开户 */#include </u/ebcsav/include/sav.h>$include sqlca;$include sqlda;void addspace();void mess();char y_n();char readdv();char readst();char readch();long ac_num();double get_rate();void prt_inum();void prt_dnum();void addspacef();void prtf_inum();void prtf_dnum();void delay();short num_time();#include </u/ebcsav/include/begin>short n=1,flag,ti,i,j=0,u=0;double x,sum;long k;unsigned char c;char st[36];FILE *pf;$ char s_num[2],nam[9],cu_type[2],addres[25],statu[2],l_num[2];$ long a_num,pas,cr_num,ope_date,int_date,las_date,l_mon;$ double amoun,amoun1,i_rate;$ short cred_type;$ long cred_num,b_num;$ char ope_num[2],s_type[2],te[2],fg[2],r_type[2];move(0,29);$ database saving;printw("住 房 基 金 开 户");s_num[0]=op.num&0x7f;s_num[1]='\0';cred_type=3;s_type[0]=cred_type;s_type[1]='\0';l_num[0]=0;l_num[1]='\0';te[0]=60;te[1]='\0';fg[0]=0;fg[1]='\0';r_type[0]=9;r_type[1]='\0';nam[0]='\0';cu_type[0]='R';cu_type[1]='\0';amoun=0.0;strcpy(addres,"住房基金");statu[1]='\0';pas=0;i_rate=0.0;ope_num[0]=op_num;ope_num[1]='\0';$ declare blot scroll cursor for select blot_num from r_blot;while(1) { move(23,16); standout(); mess((short)1); standend(); amoun1=0.0; move(3,10); addstr("帐 号: "); move(3,48); prt_inum((long)(op.num&0x7f),2); addstr("-"); move(5,10); addstr("姓 名: "); move(7,10); addstr("定 额: "); move(9,10); addstr("转存单位编号: "); while(1) { switch(n) { case 1: move(5,20); c=readst(st,8); if(c==10) strcpy(nam,st); move(5,20); addspace(10); move(5,48); printw("%-8s",nam); if(c==10||c==13||c==25) n=2; else if(c==5) n=4; else if(c==4) n=5; break; case 2: move(7,20); c=readdv(&x,13); if(c==10) amoun1=x; move(7,20); addspace(13); move(7,48); prt_dnum(amoun1,13); if(c==10||c==13||c==25) n=3; else if(c==24) n=1; else if(c==5) n=4; else if(c==4) n=5; break; case 3: move(9,26); c=readdv(&x,3); if(c==10) u=x; move(9,48); pf=fopen("/u/ebcsav/data/tran_sec.dat","r"); fseek(pf,(u-1)*24,0); fread(st,24,1,pf); st[24]='\0'; if(feof(pf)||st[0]=='\0') { printw("该单位不存在"); u=0; } else printw("%s",st); fclose(pf); if(c==10||c==13||c==25||c==5) n=4; else if(c==24) n=2; else if(c==4) n=5; break; case 4: move(20,20); mess((short)5); c=y_n('Y','N','C'); move(20,20); addspace(42); if(c=='C') n=1; else if(c=='Y') { flag=0; a_num=ac_num(cred_type); cr_num=a_num%1000000+8000000; move(3,52); prt_inum(a_num,9); ope_date=int_date=las_date=year*10000+month*100+day; l_mon=0; statu[0]='A'; move(20,20); $ begin work; $ insert into r_dated values ($s_num,$a_num,$nam,$pas,$cu_type,$te,$amoun,$amoun, $addres,$cr_num,$ope_date,$int_date,$statu,$fg, $las_date,$i_rate,0.0,$l_mon,$l_num); if(sqlca.sqlcode!=0) { addstr("写"); mess((short)14); printw("(%d), ",sqlca.sqlcode); } else { for(n=0;n<5;n++) { $ insert into r_blot values (0,$ope_num,$s_num,$a_num,$nam,$s_type, $cu_type,$te,$cr_num,"O",$amoun,$amoun,0); if(sqlca.sqlcode!=-271) break; printw("*"); refresh(); delay(5l); } if(sqlca.sqlcode==-271) mess((short)73); else if(sqlca.sqlcode!=0) { addstr("写"); mess((short)16); printw("(%d), ",sqlca.sqlcode); } else { $ insert into open_acc values ($s_num,$s_type,$cu_type,$te,$a_num,$nam, $addres,$amoun,$ope_num); if(sqlca.sqlcode!=0) { addstr("写"); mess((short)17); printw("(%d), ",sqlca.sqlcode); } else { $ open blot; $ fetch last blot into $b_num; $ close blot; $ insert into r_dated_sch values ($s_num,$a_num,$ope_date,$b_num, $nam,$cu_type,$amoun,$amoun,0,$r_type); if(sqlca.sqlcode!=0) { addstr("写"); mess((short)18); printw("(%d), ",sqlca.sqlcode); } else { if(u>0) { strcpy(st,"/u/ebcsav/data/tran001.dat"); st[19]=u/100+48; st[20]=(u%100)/10+48; st[21]=(u%10)+48; pf=fopen(st,"a"); fwrite(&a_num,4,1,pf); fwrite(&amoun1,8,1,pf); fclose(pf); pf=fopen(st,"r+"); fseek(pf,12,0); sum=0.0; while(1) { fread(&k,4,1,pf); fread(&x,8,1,pf); if(feof(pf)) break; sum+=x; } fseek(pf,4,0); fwrite(&sum,8,1,pf); fclose(pf); } for(n=0;n<7;n++) if(op.name[n]!='\0') st[n]=op.name[n]^0xff; else st[n]='\0'; ti=num_time(); mess((short)42); mess((short)4); getch(); printf("[5i%c%c%c%c%c%c%c%c%c", 27,'%','9',1,20,28,'q',27,']'); printf("户 名: %-8s",nam); printf("\n凭证号: "); prtf_inum(cr_num,7); addspacef(15); printf("%4d年%2d月%2d日%2d时%2d分\n\n\n", year,month,day,ti/100,ti%100); addspacef(14); prtf_inum(s_num[0],2); printf("-"); prtf_inum(a_num,9); printf(" %d年%2d月%2d日", year,month,day); printf(" %d年%2d月%2d日 ",year,month,day); prtf_inum(s_num[0],2); printf(" %d\n\n",b_num); addspacef(34); prtf_dnum(amoun,14); printf(" "); prtf_dnum(amoun,14); addspacef(5); printf("住房基金"); addspacef(7); printf("%-6s\f\n",st); printf("[4i"); move(20,20); addspace(40); move(20,20); mess((short)13); flag=1; } } } } if(flag==1) { $ commit work; } else { $ rollback work; } n=5; } else n=5; } if(n==5) break; } move(20,46); mess((short)15); c=y_n('Y','N','N'); if(c=='N') break; move(2,0); clrtobot(); block(1,0,22,80); n=1; }$ close database;#include </u/ebcsav/include/end>#include </u/ebcsav/include/mess>#include </u/ebcsav/include/addspace>#include </u/ebcsav/include/addspacef>#include </u/ebcsav/include/y_n>#include </u/ebcsav/include/prt_inum>#include </u/ebcsav/include/prt_dnum>#include </u/ebcsav/include/prtf_inum>#include </u/ebcsav/include/prtf_dnum>#include </u/ebcsav/include/prtf_dnum1>#include </u/ebcsav/include/prtf_upper>#include </u/ebcsav/include/num_time>#include </u/ebcsav/include/readch>#include </u/ebcsav/include/readdv>#include </u/ebcsav/include/readst>#include </u/ebcsav/include/ac_num>#include </u/ebcsav/include/delay>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -