📄 query_blot.ec
字号:
/* query_blot */#include </u/ebcsav/include/sav.h>$include sqlca;$include sqlda;short menu();short menusel();void addspace();void mess();char y_n();char readdv();char readst();void prt_inum();void prt_dnum();#include </u/ebcsav/include/begin>short num_c1,num_c3,num;double x;char c;FILE *pf;$ char ope_num[2],s_num[2],nam[9],s_type[2],cu_type[2],ter[2],statu[2];$ long b_num,a_num,cr_num;$ double amoun,balanc,interes;static char *title1[6]={"0. 退 出 ","1.按 帐 号 ","2.按凭证号 ", "3.按 姓 名 ","4.按 金 额 ","5.按流水号 "};static char *remind1[6]={" 退出本程序 ", " 根据给定的帐号查询并显示相应的储户信息 ", " 根据给定的凭证号查询并显示相应的储户信息 ", " 根据给定的姓名查询并显示相应的储户信息 ", " 根据给定的金额查询并显示相应的储户信息 ", " 根据给定的流水号查询并显示相应的储户信息 "};static short menu_row1[6]={3,3,3,3,3,3}, menu_col1[6]={7,18,29,40,51,62};static char *title3[3]={"0.返回 ","1.人民币 ","2.外币 "};static char *remind3[3]={" 返回主选择单 "," 查询人民币储户 ", " 查询外币储户 "};static short menu_row3[3]={5,5,5},menu_col3[3]={9,16,25};move(0,27);$ database saving;printw("查 询 流 水 帐 信 息");num_c1=num_c3=0;while(1) { move(2,0); clrtobot(); block(1,0,22,80); block(2,5,3,70); num_c1=menu(title1,remind1,menu_row1,menu_col1,5,num_c1); num_c1=menusel(title1,remind1,menu_row1,menu_col1,5,num_c1,0); if(num_c1==0) break; if((op.type&3)==1) num_c3=1; else if((op.type&3)==2) num_c3=2; else { block(4,7,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; 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; } switch(num_c1) { case 1: move(12,6); addstr("帐号: "); readdv(&x,9); a_num=x; if(num_c3==1) { $ declare read_101 scroll cursor for select * into $b_num,$ope_num,$s_num,$a_num,$nam,$s_type, $cu_type,$ter,$cr_num,$statu,$amoun,$balanc,$interes from r_blot where sec_num=$s_num and acc_num=$a_num; $ open read_101; } else { $ declare read_102 scroll cursor for select * into $b_num,$ope_num,$s_num,$a_num,$nam,$s_type, $cu_type,$ter,$cr_num,$statu,$amoun,$balanc,$interes from f_blot where sec_num=$s_num and acc_num=$a_num; $ open read_102; } break; case 2: move(12,6); addstr("凭证号: "); readdv(&x,7); cr_num=x; if(num_c3==1) { $ declare read_201 scroll cursor for select * into $b_num,$ope_num,$s_num,$a_num,$nam,$s_type, $cu_type,$ter,$cr_num,$statu,$amoun,$balanc,$interes from r_blot where sec_num=$s_num and cre_num=$cr_num; $ open read_201; } else { $ declare read_202 scroll cursor for select * into $b_num,$ope_num,$s_num,$a_num,$nam,$s_type, $cu_type,$ter,$cr_num,$statu,$amoun,$balanc,$interes from f_blot where sec_num=$s_num and cre_num=$cr_num; $ open read_202; } break; case 3: move(12,6); addstr("姓名: "); readst(nam,8); if(num_c3==1) { $ declare read_301 scroll cursor for select * into $b_num,$ope_num,$s_num,$a_num,$nam,$s_type, $cu_type,$ter,$cr_num,$statu,$amoun,$balanc,$interes from r_blot where sec_num=$s_num and name=$nam; $ open read_301; } else { $ declare read_302 scroll cursor for select * into $b_num,$ope_num,$s_num,$a_num,$nam,$s_type, $cu_type,$ter,$cr_num,$statu,$amoun,$balanc,$interes from f_blot where sec_num=$s_num and name=$nam; $ open read_302; } break; case 4: move(12,6); addstr("金额: "); readdv(&amoun,13); if(num_c3==1) { $ declare read_401 scroll cursor for select * into $b_num,$ope_num,$s_num,$a_num,$nam,$s_type, $cu_type,$ter,$cr_num,$statu,$amoun,$balanc,$interes from r_blot where sec_num=$s_num and amount=$amoun; $ open read_401; } else { $ declare read_402 scroll cursor for select * into $b_num,$ope_num,$s_num,$a_num,$nam,$s_type, $cu_type,$ter,$cr_num,$statu,$amoun,$balanc,$interes from f_blot where sec_num=$s_num and amount=$amoun; $ open read_402; } break; case 5: move(12,6); addstr("流水号: "); readdv(&x,9); b_num=x; if(num_c3==1) { $ declare read_501 scroll cursor for select * into $b_num,$ope_num,$s_num,$a_num,$nam,$s_type, $cu_type,$ter,$cr_num,$statu,$amoun,$balanc,$interes from r_blot where sec_num=$s_num and blot_num>=$b_num; $ open read_501; } else { $ declare read_502 scroll cursor for select * into $b_num,$ope_num,$s_num,$a_num,$nam,$s_type, $cu_type,$ter,$cr_num,$statu,$amoun,$balanc,$interes from f_blot where sec_num=$s_num and blot_num>=$b_num; $ open read_502; } } if(sqlca.sqlcode!=0) { move(20,26); addstr("打开"); mess(14); printw("(%d), ",sqlca.sqlcode); mess(3); getch(); continue; } while(1) { switch(num_c1) { case 1: if(num_c3==1) { $ fetch read_101; } else { $ fetch read_102; } break; case 2: if(num_c3==1) { $ fetch read_201; } else { $ fetch read_202; } break; case 3: if(num_c3==1) { $ fetch read_301; } else { $ fetch read_302; } break; case 4: if(num_c3==1) { $ fetch read_401; } else { $ fetch read_402; } break; case 5: if(num_c3==1) { $ fetch read_501; } else { $ fetch read_502; } } if(sqlca.sqlcode!=0) { move(23,20); addstr("没有其他符合查询条件的帐户, "); mess(3); switch(num_c1) { case 1: if(num_c3==1) { $ close read_101; } else { $ close read_102; } break; case 2: if(num_c3==1) { $ close read_201; } else { $ close read_202; } break; case 3: if(num_c3==1) { $ close read_301; } else { $ close read_302; } break; case 4: if(num_c3==1) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -