📄 query_sch.ec
字号:
/* query_acc */#include </u/ebcsav/include/sav.h>$include sqlca;$include sqlda;short menu();short menusel();void addspace();void mess();char y_n();char readdv();void prt_inum();void prt_dnum();#include </u/ebcsav/include/begin>short num_c2,num_c3,l;double x;char c;$ char s_num[2],nam[9],cu_type[2],statu[2];$ long a_num,pre_date,b_num,b_date;$ double amoun,balanc,interes;static char *title2[6]={"0.返 回 ","2.活 期 ","3.零存整取 ", "4.存本取息 ","5.定活两便 ","7.通知存款 "};static char *remind2[6]={" 返回主选择单 ", " 查询活期储蓄储户 "," 查询零存整取储户 "," 查询存本取息储户 ", " 查询定活两便储户 "," 查询通知存款储户 "};static short menu_row2[6]={5,5,5,5,5,5},menu_col2[6]={9,18,27,38,49,60};static char *title3[3]={"0.返回 ","1.人民币 ","2.外币 "};static char *remind3[3]={" 返回主选择单 "," 查询人民币储户 ", " 查询外币储户 "};static short menu_row3[3]={7,7,7},menu_col3[3]={8,15,24};move(0,29);$ database saving;printw("查 询 明 细 信 息");num_c2=num_c3=0;while(1) { move(2,0); clrtobot(); block(1,0,22,80); if((op.type&1)==0) { num_c2=1; num_c3=2; } else { block(4,7,3,66); num_c2=menu(title2,remind2,menu_row2,menu_col2,5,num_c2); num_c2=menusel(title2,remind2,menu_row2,menu_col2,5,num_c2,0); if(num_c2==0) break; if(num_c2==1) { if((op.type&2)==0) num_c3=1; else { block(6,6,3,28); num_c3=menu(title3,remind3,menu_row3,menu_col3,2,num_c3); num_c3=menusel(title3,remind3,menu_row3,menu_col3,2,num_c3,0); if(num_c3==0) continue; } } else num_c3=1; } s_num[1]='\0'; move(10,6); addstr("营业所编号: "); if((op.num&0x80)!=0) { s_num[0]=op.num&0x7f; prt_inum((long)s_num[0],2); } else { readdv(&x,2); s_num[0]=x; } move(12,6); addstr("帐号(按 0 返回): "); readdv(&x,9); a_num=x; if(a_num==0) { if((op.type&1)==0) break; else continue; } move(14,6); addstr("起始日期: 年 月 日"); move(14,17); readdv(&x,4); b_date=x*10000; move(14,26); readdv(&x,2); b_date+=x*100; move(14,32); readdv(&x,2); b_date+=x; switch(num_c2) { case 1: if(num_c3==1) { $ declare read_21 scroll cursor for select * into $s_num,$a_num,$pre_date,$b_num,$nam,$cu_type, $amoun,$balanc,$interes,$statu from r_dem_sch where sec_num=$s_num and acc_num=$a_num and pres_date>=$b_date; $ open read_21; } else { $ declare read_22 scroll cursor for select * into $s_num,$a_num,$pre_date,$b_num,$nam,$cu_type, $amoun,$balanc,$interes,$statu from f_dem_sch where sec_num=$s_num and acc_num=$a_num and pres_date>=$b_date; $ open read_22; } break; case 2: $ declare read_31 scroll cursor for select * into $s_num,$a_num,$pre_date,$b_num,$nam,$cu_type, $amoun,$balanc,$interes,$statu from r_dated_sch where sec_num=$s_num and acc_num=$a_num and pres_date>=$b_date; $ open read_31; break; case 5: $ declare read_71 scroll cursor for select * into $s_num,$a_num,$pre_date,$b_num,$nam,$cu_type, $amoun,$balanc,$interes,$statu from r_cal_sch where sec_num=$s_num and acc_num=$a_num and pres_date>=$b_date; $ open read_71; } if(sqlca.sqlcode!=0) { move(20,26); addstr("打开"); mess(14); printw("(%d), ",sqlca.sqlcode); mess(3); getch(); continue; } l=6; while(1) { switch(num_c2) { case 1: if(num_c3==1) { $ fetch read_21; } else { $ fetch read_22; } break; case 2: $ fetch read_31; break; case 5: $ fetch read_71; } if(sqlca.sqlcode!=0) { move(23,20); addstr("没有其他符合查询条件的帐户, "); mess(3); switch(num_c2) { case 1: if(num_c3==1) { $ close read_21; } else { $ close read_22; } break; case 2: $ close read_31; break; case 5: $ close read_71; } getch(); break; } if(l==6) { move(2,0); clrtobot(); block(1,0,22,80); move(2,4); addstr("储蓄种类: "); addstr(&title2[num_c2][2]); move(2,24); addstr("币种: "); switch(toupper(cu_type[0])) { case 'C': addstr("加拿大元"); break; case 'F': addstr("法国法郎"); break; case 'H': addstr("港元"); break; case 'J': addstr("日元"); break; case 'M': addstr("德国马克"); break; case 'P': addstr("英镑"); break; case 'R': addstr("人民币"); break; case 'U': addstr("美元"); } move(2,40); addstr("帐号: "); prt_inum((long)s_num[0],2); addstr("-"); prt_inum(a_num,9); move(2,62); addstr("姓名: "); addstr(nam); move(4,2); addstr("流水 日期 摘要 借方(支出) 贷方(存入) 余额 利息"); move(5,2); addstr("----------------------------------------------------------------------------"); } move(l,2); printw("%4d",b_num); move(l,7); printw("%2d-%2d-%2d",(pre_date/10000)%100,(pre_date%10000)/100, pre_date%100); move(l,16); if((statu[0]&16)!=0) addstr("冲"); else addstr(" "); switch(statu[0]&3) { case 0: addstr("取"); move(l,22); break; case 1: addstr("存"); move(l,36); break; case 2: addstr("息"); move(l,36); break; case 3: addstr("转"); move(l,36); } prt_dnum(amoun,14); move(l,20); if((statu[0]&4)!=0) printw("?"); move(l,21); if((statu[0]&8)!=0) printw("*"); move(l,50); prt_dnum(balanc,14); move(l,64); prt_dnum(interes,14); l++; if(l==21) { move(23,25); mess((short)6); c=y_n('Y','N','N'); if(c=='N') { switch(num_c2) { case 1: if(num_c3==1) { $ close read_21; } else { $ close read_22; } break; case 2: $ close read_31; break; case 5: $ close read_71; } break; } l=6; } } }$ close database;endwin();#include </u/ebcsav/include/end>#include </u/ebcsav/include/mess>#include </u/ebcsav/include/addspace>#include </u/ebcsav/include/y_n>#include </u/ebcsav/include/prt_inum>#include </u/ebcsav/include/prt_dnum>#include </u/ebcsav/include/readdv>#include </u/ebcsav/include/menu>#include </u/ebcsav/include/menusel>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -