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

📄 hang_off.ec

📁 这是一个使用 informix esql/c 技术开发的银行程序的部分代码。
💻 EC
📖 第 1 页 / 共 3 页
字号:
/*   hang_off    */#include </u/ebcsav/include/sav.h>$include sqlca;$include sqlda;short menu();short menusel();void addspace();void addspacef();void mess();char y_n();char readdv();void prt_inum();void prt_dnum();void prtf_inum();void prtf_dnum();void prtf_dnum1();void prtf_upper();void delay();short num_time();#include </u/ebcsav/include/begin>short num_c2,num_c3,num,ti,i,flag;long k;double x,amoun1;char c,c1,c2;char sts[11];char stn[7];FILE *pf;$ char s_num[2],nam[9],ter[2],cu_type[2],addres[25],statu[2],  lin_num[2],ope_num[2],s_type[2],fla[2];$ long a_num,pas,cr_num,cr_num1,cr_num2,ope_date,int_date,las_date,las_month;$ double amoun,interes,maint_v,balanc,int_rate;$ short cred_type;$ long cred_num,b_num;short year1,month1,day1;static char *title2[8]={"0.返回 ","1.双整 ","2.活期 ","3.零整 ",  "4.存本取息 ","5.定活两便 ","6.大额 ","7.通知 "};static char *remind2[8]={"  返回主选择单  ","  整存整取储户解挂  ",  "  活期储蓄储户解挂  ","  零存整取储户解挂  ","  存本取息储户解挂  ",  "  定活两便储户解挂  ","  大额储蓄储户解挂  ","  通知存款储户解挂  "};static short menu_row2[8]={5,5,5,5,5,5,5,5},  menu_col2[8]={8,15,22,29,36,47,58,65};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,33);$ database saving;printw("办  理  解  挂");num_c2=num_c3=0;k=op.num&0x7f;pf=fopen("/u/ebcsav/data/sav_sect.dat","r");fseek(pf,k*34-10,0);fread(sts,10,1,pf);fclose(pf);sts[10]='\0';for(i=0;i<7;i++)  if(op.name[i]!='\0')stn[i]=op.name[i]^0xff;  else stn[i]='\0';$ declare blot1 scroll cursor for select blot_num from r_blot;$ declare blot2 scroll cursor for select blot_num from f_blot;while(1)  {    move(2,0);    clrtobot();    block(1,0,22,80);    num=((op.type&1)==1)?7:2;    block(4,6,3,(num==7)?68:26);    num_c2=menu(title2,remind2,menu_row2,menu_col2,num,num_c2);    num_c2=menusel(title2,remind2,menu_row2,menu_col2,num,num_c2,0);    if(num_c2==0)      {        endwin();        return;      }    if(num_c2>2||(op.type&3)==1) num_c3=1;    else if((op.type&3)==2) num_c3=2;    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;    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("帐号:               ");    readdv(&x,9);    a_num=x;    switch(num_c2)      {        case 1:          if(num_c3==1)            {              $ select * into $s_num,$a_num,$nam,$pas,$cu_type,$ter,                $amoun,$addres,$cr_num,$ope_date,$int_date,$statu,                $las_date,$interes,$maint_v from r_fix                where sec_num=$s_num and acc_num=$a_num;            }          else            {              $ select * into $s_num,$a_num,$nam,$pas,$cu_type,$ter,                $amoun,$addres,$cr_num,$ope_date,$int_date,$statu,                $las_date,$interes,$maint_v from f_fix                where sec_num=$s_num and acc_num=$a_num;            }          break;        case 2:          if(num_c3==1)            {              $ select * into $s_num,$a_num,$nam,$pas,$cu_type,                $amoun,$addres,$cr_num,$ope_date,$int_date,$statu,                $las_date,$interes,$lin_num from r_demand                where sec_num=$s_num and acc_num=$a_num;            }          else            {              $ select * into $s_num,$a_num,$nam,$pas,$cu_type,                $amoun,$addres,$cr_num,$ope_date,$int_date,$statu,                $las_date,$interes,$lin_num from f_demand                where sec_num=$s_num and acc_num=$a_num;            }          break;        case 3:          $ select * into $s_num,$a_num,$nam,$pas,$cu_type,$ter,            $amoun,$balanc,$addres,$cr_num,$ope_date,$int_date,$statu,            $fla,$las_date,$int_rate,$interes,$las_month,$lin_num from r_dated            where sec_num=$s_num and acc_num=$a_num;          break;        case 6:          $ select * into $s_num,$a_num,$nam,$pas,$cu_type,$ter,            $amoun,$addres,$cr_num,$ope_date,$int_date,$statu,            $las_date,$interes,$maint_v from l_fix            where sec_num=$s_num and acc_num=$a_num;          break;        case 7:          $ select * into $s_num,$a_num,$nam,$pas,$cu_type,            $amoun,$addres,$cr_num,$ope_date,$int_date,$statu,            $las_date,$interes,$lin_num from r_call            where sec_num=$s_num and acc_num=$a_num;      }    if(sqlca.sqlcode!=0||statu[0]=='E'||statu[0]=='B')      {        move(20,27);        mess((short)29);        mess(3);        getch();        continue;      }    if(pas!=0)      {        for(i=0;i<4;i++)          {            move(14,6);            addstr("密码:               ");            readdv(&x,7);            k=x;            if(k==pas) break;            move(20,27);            mess((short)20);            mess((short)2);          }      }    else k=pas;    move(20,27);    addspace(30);    move(20,27);    if(k!=pas)      {        mess((short)30);        mess((short)3);        getch();        continue;      }    if(toupper(statu[0])!='H'&&toupper(statu[0])!='V')      {        addstr("该帐户未曾挂失, ");        mess((short)3);        getch();        continue;      }    k=((year-las_date/10000)*12+month-(las_date%10000)/100)*30      +day-(las_date%100);    if(k<7)      {        addstr("挂失时间未超过 7 天, 不允许解挂. ");        mess((short)3);        getch();        continue;      }    move(2,0);    clrtobot();    block(1,0,22,80);    move(2,10);    addstr("储蓄种类: ");    move(2,48);    addstr(&title2[num_c2][2]);    move(3,10);    addstr("帐    号: ");    move(3,48);    prt_inum((long)s_num[0],2);    addstr("-");    prt_inum(a_num,9);    move(4,10);    addstr("姓    名: ");    move(4,48);    addstr(nam);    if(num_c2==3)      {        if((fla[0]&1)==0) addstr("  (个人户)");        else addstr("  (集体户)");      }    move(5,10);    addstr("币    种: ");    move(5,48);    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("美元");      }    if(cu_type[0]>'Z') addstr("  (自动转存)");    if(num_c2==1||num_c2==3||num_c2==6)      {        move(6,10);        addstr("期    限: ");        move(6,48);        if(ter[0]<12) printw("%2d个月",ter[0]);        else printw("%2d年",ter[0]/12);      }    move(7,10);    if(num_c2==3) addstr("定    额: ");    else addstr("金    额: ");    move(7,48);    prt_dnum(amoun,13);    move(8,10);    addstr("地    址: ");    move(8,48);    addstr(addres);    move(9,10);    addstr("凭 证 号: ");    move(9,48);    prt_inum(cr_num,7);    move(10,10);    addstr("开户日期: ");    move(10,48);    printw("%4d年%2d月%2d日",ope_date/10000,(ope_date%10000)/100,      ope_date%100);    move(11,10);    addstr("起息日期: ");    move(11,48);    printw("%4d年%2d月%2d日",int_date/10000,(int_date%10000)/100,      int_date%100);    move(12,10);    addstr("状    态: ");    move(12,48);    switch(toupper(statu[0]))      {        case 'A':          addstr("可存取");          break;        case 'B':          addstr("作废");          break;        case 'E':          addstr("销户");          break;        case 'F':          addstr("冻结");          break;        case 'H':          addstr("挂失");          break;        case 'V':          addstr("口头挂失");      }    if(statu[0]>'Z') addstr("  (曾经丢失过凭整)");    if(num_c2==3)      {        move(13,40);        if((fla[0]&2)!=0) addstr("办过补存 ");        if((fla[0]&4)!=0) addstr("办过增加定额 ");        if((fla[0]&8)!=0) addstr("办过减少定额 ");      }    move(14,10);    addstr("最后改变状态日期: ");    move(14,48);    printw("%4d年%2d月%2d日",las_date/10000,(las_date%10000)/100,      las_date%100);    move(15,10);    if((num_c2==1||num_c2==6)&&toupper(statu[0])!='E') addstr("利    率: ");    else addstr("累计利息: ");    move(15,48);    printw("%15.4f",interes);    if(num_c2==1)      {        move(16,10);        addstr("保    值: ");        move(16,48);        prt_dnum(maint_v,13);      }    else if(num_c2==2||num_c2==3||num_c2==7)      {        move(16,10);        addstr("存折行号: ");        move(16,48);        prt_inum((long)lin_num[0],2);      }    if(num_c2==3)      {        move(17,10);        addstr("余    额: ");        move(17,48);        amoun1=amoun;        amoun=balanc;        prt_dnum(balanc,13);        move(18,10);        addstr("利    率: ");        move(18,48);        printw("%15.4f",int_rate);        move(19,10);        addstr("最后存款月份: ");        move(19,48);        printw("%2d年%2d月",las_month/100,las_month%100);      }    move(20,30);    mess((short)33);    c=y_n('Y','N','N');    if(c=='Y')      {        flag=0;        $ begin work;        las_date=year*10000+month*100+day;        ope_num[0]=op_num;        ope_num[1]='\0';        s_type[0]=(num_c3-1)*10+num_c2;        s_type[1]='\0';        move(20,30);        statu[0]=(statu[0]>'Z')?'a':'A';        switch(num_c2)          {            case 1:              if(num_c3==1)                {                  $ update r_fix                    set status=$statu,last_date=$las_date                    where sec_num=$s_num and acc_num=$a_num;                }              else                {                  $ update f_fix                    set status=$statu,last_date=$las_date                    where sec_num=$s_num and acc_num=$a_num;                }              break;            case 2:              if(num_c3==1)                {                  $ update r_demand                    set status=$statu,last_date=$las_date                    where sec_num=$s_num and acc_num=$a_num;                }              else                {                  $ update f_demand                    set status=$statu,last_date=$las_date                    where sec_num=$s_num and acc_num=$a_num;                }              break;            case 3:              $ update r_dated                set status=$statu,last_date=$las_date                where sec_num=$s_num and acc_num=$a_num;              break;            case 6:              $ update l_fix                set status=$statu,last_date=$las_date                where sec_num=$s_num and acc_num=$a_num;              break;            case 7:              $ update r_call                set status=$statu,last_date=$las_date                where sec_num=$s_num and acc_num=$a_num;          }        if(sqlca.sqlerrd[2]!=1)          {            addstr("写");            mess((short)14);            printw("(%d), ",sqlca.sqlerrd[2]);          }        else          {            c1=cu_type[0];            c2=statu[0];            cu_type[0]=toupper(c1);            statu[0]='L';            $ insert into hang              values              ($s_num,$s_type,$cu_type,$ter,$a_num,$nam,$cr_num,              $amoun,$statu,$ope_num);            if(sqlca.sqlcode!=0)              {                addstr("写解挂登记表出错, ");                printw("(%d), ",sqlca.sqlcode);              }            else              {                for(i=0;i<5;i++)                  {                    if(num_c3==1)                      {                        $ insert into r_blot                          values                          (0,$ope_num,$s_num,$a_num,$nam,$s_type,                          $cu_type,$ter,$cr_num,$statu,0,$amoun,0);                      }                    else                      {                        $ insert into f_blot                          values                          (0,$ope_num,$s_num,$a_num,$nam,$s_type,                          $cu_type,$ter,$cr_num,$statu,0,$amoun,0);                      }

⌨️ 快捷键说明

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