📄 dem_prt.ec
字号:
/* 活期登折 */#include </u/ebcsav/include/sav.h>$include sqlca;$include sqlda;void addspace();void addspacef();void mess();char y_n();char readdv();char readst();char readch();long ac_num();void prt_inum();void prt_dnum();void prtf_inum();void prtf_dnum();#include </u/ebcsav/include/begin>double x;long k,i,j=0,p=0;unsigned char c;char st[30],yn;$ char s_num[2],nam[9],cu_type[2];$ long a_num,cr_num,ope_date,cr_num1,b_num,p_date;$ double amoun,inte,amou,balan;$ short cred_type;$ long cred_num,i_date,l_date;$ char ope_num[2],s_type[2],sta[2],l_num[2];move(0,25);$ database saving;printw("活 期 储 蓄 登 折");ope_num[0]=op_num;ope_num[1]='\0';s_num[0]=op.num&0x7f;s_num[1]='\0';l_num[0]=1;l_num[1]='\0';s_type[1]='\0';nam[0]='\0';sta[1]='\0';cu_type[0]=((op.type&1)==1)?'R':'U';cu_type[1]='\0';ope_date=year*10000+month*100+day;amoun=0.0;amou=0.0;move(23,16);standout();mess(1);standend();move(3,10);addstr("帐 号: ");move(3,20);prt_inum(s_num[0],2);addstr("-");while(1) { $ begin work; p=0; while(1) { move(3,24); c=readdv(&x,9); if(c==10) a_num=x; move(3,24); prt_inum(a_num,9); if((op.type&3)==1)cred_type=2; else if((op.type&3)==2)cred_type=12; else { move(5,10); addstr("人民币/外币:(R/F)"); move(5,30); c=y_n('R','R','F'); if(isprint(c)) cu_type[0]=c; if(toupper(cu_type[0])=='R')cred_type=2; else cred_type=12; move(5,10); addspace(40); } s_type[0]=cred_type; if(cred_type==2) $ select name,interest,inte_date,line_num into $nam,$inte, $i_date,$l_num from r_demand where sec_num=$s_num and acc_num=$a_num; else $ select name,interest,inte_date,line_num into $nam,$inte, $i_date,$l_num from f_demand where sec_num=$s_num and acc_num=$a_num; if(sqlca.sqlcode!=0) { move(20,20); mess(19); p=1; break; }/*更新记录开始*/ move(5,10); printw("姓 名:"); move(5,24); printw("%-8s",nam); move(20,20); mess(5); c=y_n('Y','N','C'); move(20,20); addspace(42); if(c=='N')break; else if(c=='Y') { move(20,20); l_num[0]++; if(cred_type==2) { $ declare blot scroll cursor for select pres_date,blot_num, amount,balance,status into $l_date, $b_num,$amoun,$balan,$sta from r_dem_sch where sec_num=$s_num and acc_num=$a_num; $ open blot; } else { $ declare blot1 scroll cursor for select pres_date,blot_num, amount,balance,status into $l_date, $b_num,$amoun,$balan,$sta from f_dem_sch where sec_num=$s_num and acc_num=$a_num; $ open blot1; } sta[0]=1; while(((sta[0]&0x4)!=4)&&(sqlca.sqlcode==0)) if(cred_type==2) $ fetch blot; else $ fetch blot1; if(sqlca.sqlcode!=0) break; move(20,20); mess(43); mess(4); getch(); printf("[5i%c%c%c%c%c",27,'%','9',1,20); if((l_num[0]>=11&&l_num[0]<=20)|| (l_num[0]>=31&&l_num[0]<=40)) { printf("%c9%c%c",'%',1,20); for(i=1;i<4;i++)printf("\n"); printf("%c9%c%c",'%',1,24); for(i=1;i<l_num[0]%10;i++)printf("\n"); if(l_num[0]%10==0) for(i=1;i<10;i++)printf("\n"); } if((l_num[0]>=1&&l_num[0]<=10)|| (l_num[0]>=21&&l_num[0]<=30)|| (l_num[0]>=41&&l_num[0]<=50)) { printf("%c9%c%c",'%',1,20); for(i=1;i<18;i++)printf("\n"); printf("%c9%c%c",'%',1,24); for(i=1;i<l_num[0]%10;i++)printf("\n"); if(l_num[0]%10==0) for(i=1;i<10;i++)printf("\n"); } while(sqlca.sqlcode==0) { if((sta[0]&0x3)==2) printf("%4d.%2d.%2d 利息", (l_date/10000)%100, (l_date%10000)/100,l_date%100); else printf("%4d.%2d.%2d 转帐", (l_date/10000)%100, (l_date%10000)/100,l_date%100); printf("(+)"); prtf_dnum(amoun,15); prtf_dnum(balan,15); printf(" \n"); sta[0]=sta[0]&0xfb; if(cred_type==2) $ update r_dem_sch set status=$sta where sec_num=$s_num and acc_num=$a_num and pres_date=$l_date and blot_num=$b_num; else $ update f_dem_sch set status=$sta where sec_num=$s_num and acc_num=$a_num and pres_date=$l_date and blot_num=$b_num; if(sqlca.sqlerrd[2]!=1) { printf("\f\n%c9%c%c[4i",'%',1,20); move(20,20); addstr("写"); mess(18); printw("(%d), ",sqlca.sqlcode); p=1; break; } while(((sta[0]&0x4)!=4)&&(sqlca.sqlcode==0)) if(cred_type==2) $ fetch blot; else $ fetch blot1; if(sqlca.sqlcode==0) { if((l_num[0]==10)||(l_num[0]==30)) { printf("\f\n%c9%c%c[4i",'%',1,20); move(20,20); addspacef(50); move(20,20); printw("请翻页后继续打印"); getch(); printf("[5i%c%c%c%c%c",27,'%','9',1,20); for(i=1;i<5;i++)printf("\n"); printf("%c9%c%c",'%',1,24); } if((l_num[0]==20)||(l_num[0]==40)) { printf("%c%c%c%c%c",27,'%','9',1,20); printf("\n\n"); printf("%c9%c%c",'%',1,24); } if(l_num[0]==50) {printf("\f\n%c9%c%c[4i",'%',1,20); move(20,20); mess(37); break;} l_num[0]++; } } if(cred_type==2) $ close blot; else $ close blot1; printf("\f\n%c9%c%c[4i",'%',1,20); if(cred_type==2) $ update r_demand set interest=$inte,inte_date=$i_date,line_num=$l_num where sec_num=$s_num and acc_num=$a_num; else $ update f_demand set interest=$inte,inte_date=$i_date,line_num=$l_num where sec_num=$s_num and acc_num=$a_num; move(20,20); addspace(50); move(20,20); if(sqlca.sqlerrd[2]!=1) { addstr("写"); mess(14); printw("(%d), ",sqlca.sqlcode); p=1; } else mess(55); } break;/*更新记录结束*/ } if(p==1) { $ rollback work; } else { $ commit work; } p=0; mess(15); c=y_n('Y','N','N'); if(c=='N') break; move(20,10); addspace(62); move(3,24); addspace(40); }$ 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/readch>#include </u/ebcsav/include/readdv>#include </u/ebcsav/include/readst>#include </u/ebcsav/include/ac_num>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -