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

📄 change_cal.ec

📁 这是一个使用 informix esql/c 技术开发的银行程序的部分代码。
💻 EC
字号:
/*   change_call   */#include </u/ebcsav/include/sav.h>$include sqlca;$include sqlda;void addspace();void addspacef();void mess();char y_n();char readdv();char readch();char readst();void prt_inum();void prt_dnum();void prtf_inum();void prtf_dnum();void prtf_inte();double get_rate();void delay();short num_time();#include </u/ebcsav/include/begin>long k,key_num,key=4691813,key_date=99971231;short cred_type,i,j,flag,n,ti;double x;unsigned char c;char key_str[13];char ss[11];char stn[7];FILE *pf;$ char s_num[2],nam[9],ter[2],cu_type[2],  addres[25],statu[2],s_type[2],ope_num[2],lin_num[2];$ long a_num,pas,cr_num,ope_date,ope_date1,int_date,int_date1,  las_date,las_date1,b_num;$ double amoun,amoun1,interes;move(0,23);printw("通 知 存 款 储 蓄 帐 户 重 要 修 改");s_num[1]='\0';ope_num[0]=op_num;ope_num[1]='\0';s_type[1]='\0';ter[0]=0;ter[1]='\0';pf=fopen("/u/ebcsav/data/sav_sect.dat","r");fseek(pf,(op.num&0x7f)*34-10,0);fread(ss,10,1,pf);fclose(pf);ss[10]='\0';for(i=0;i<7;i++)  if(op.name[i]!='\0')stn[i]=op.name[i]^0xff;  else stn[i]='\0';move(2,0);clrtobot();block(1,0,22,80);if(year*10000+month*100+day>key_date)  {    move(10,20);    addstr("修改程序超过使用期限, ");    mess((short)3);    getch();    endwin();    return;  }move(3,6);addstr("密码:                     ");readst(key_str,12);k=key_num=j=0;for(i=2;i<=11;i++)  {    n=key_str[i]-97;    k+=n;    j=n-j;    key_num=key_num*10+j;  }i=k/26+97;j=(k%26)+97;ti=num_time();key_num+=(key+(year%100)*1000000+month*10000+day*100+ti/100);if((op.num&0x80)!=0) s_num[0]=op.num&0x7f;else  {    move(5,6);    addstr("营业所编号( 按 0 返回):  ");    readdv(&x,2);    s_num[0]=x;    if(s_num[0]==0)      {        endwin();        return;      }  }move(5,6);addstr("营业所编号:               ");prt_inum((long)s_num[0],2);cred_type=7;move(9,6);addstr("帐号( 按 0 返回 ):  ");readdv(&x,9);a_num=x;if(a_num==0)  {    endwin();    return;  }move(9,6);addstr("帐号:                     ");prt_inum(a_num,9);key_num+=a_num;move(11,6);addstr("修改项目(0-返回,2-余额,3-开户日,4-起息日,5-最后日: ");readdv(&x,1);n=x;if(n==0)  {    endwin();    return;  }ti=num_time();if((key_num+s_num[0]*10000+cred_type*100+n)!=2100000000||  i!=key_str[0]||j!=key_str[1])  {    move(20,20);    addstr("密码错, ");    mess((short)3);    getch();    endwin();    return;  }$ database saving;$ 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)  {    move(20,27);    mess((short)29);    mess((short)3);    getch();    $ close database;    endwin();    return;  }amoun1=amoun;ope_date1=ope_date;int_date1=int_date;las_date1=las_date;move(2,0);clrtobot();block(1,0,22,80);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);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("美元    ");  }move(7,10);addstr("金    额: ");move(7,48);prt_dnum(amoun,16);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);printw("%4d年%2d月%2d日",las_date/10000,(las_date%10000)/100,las_date%100);switch(n)  {    case 2:      move(7,20);      readdv(&x,11);      amoun1=x;      move(7,20);      addspace(11);      move(7,48);      prt_dnum(amoun1,16);      break;    case 3:      move(10,20);      readdv(&x,8);      ope_date1=x;      move(10,20);      addspace(8);      move(10,48);      printw("%4d年%2d月%2d日",ope_date1/10000,(ope_date1%10000)/100,        ope_date1%100);      break;    case 4:      move(11,20);      readdv(&x,8);      int_date1=x;      move(11,20);      addspace(8);      move(11,48);      printw("%4d年%2d月%2d日",int_date1/10000,(int_date1%10000)/100,        int_date1%100);      break;    case 5:      move(12,20);      readdv(&x,8);      las_date1=x;      move(12,20);      addspace(8);      move(12,48);      printw("%4d年%2d月%2d日",las_date1/10000,(las_date1%10000)/100,        las_date1%100);  }move(20,33);mess((short)33);c=y_n('Y','N','N');move(20,20);addspace(60);if(c=='Y')  {    flag=0;    $ begin work;    $ update r_call      set amount=$amoun1,open_date=$ope_date1,      inte_date=$int_date1,last_date=$las_date1      where sec_num=$s_num and acc_num=$a_num;    move(20,33);    if(sqlca.sqlerrd[2]!=1)      {        addstr("写");        mess((short)14);        printw("(%d), ",sqlca.sqlerrd[2]);        flag=1;      }    if(flag==0)      {        s_type[0]=cred_type;        for(i=0;i<5;i++)          {            $ insert into r_blot              values              (0,$ope_num,$s_num,$a_num,$nam,$s_type,              $cu_type,$ter,$cr_num,"E",$amoun,0.0,0.0);            if(sqlca.sqlcode!=-271) break;            printw("*");            refresh();            delay(5l);          }        if(sqlca.sqlcode==-271)          {            mess((short)73);            flag=1;          }        else if(sqlca.sqlcode!=0)          {            addstr("写");            mess(16);            printw("(%d), ",sqlca.sqlcode);            flag=1;          }      }    if(flag==0)      {        for(i=0;i<5;i++)          {            $ insert into r_blot              values              (0,$ope_num,$s_num,$a_num,$nam,$s_type,              $cu_type,$ter,$cr_num,"O",$amoun1,$amoun1,0.0);            if(sqlca.sqlcode!=-271) break;            printw("*");            refresh();            delay(5l);          }        if(sqlca.sqlcode==-271)          {            mess((short)73);            flag=1;          }        else if(sqlca.sqlcode!=0)          {            addstr("写");            mess(16);            printw("(%d), ",sqlca.sqlcode);            flag=1;          }      }    if(flag==0)      {        move(20,20);        addspace(50);        move(20,20);        mess((short)42);        mess((short)4);        getch();        printf("%c[5i%c%c9%c%c%c]%cq\n\n",27,27,'%',1,20,27,28);        addspacef(38);        printf("通知存款帐户重要修改通知单\n");        addspacef(38);        printf("==========================\n");        addspacef(14);        printf("%-10s",ss);        addspacef(40);        printf("%4d年%2d月%2d日 %2d时%2d分\n",year,month,day,ti/100,ti%100);        printf("          ─────────────────────────────────────────\n");        addspacef(14);        printf("帐号: ");        prtf_inum((long)s_num[0],2);        printf("-");        prtf_inum(a_num,9);        addspacef(14);        printf("户名: %-8s",nam);        addspacef(12);        printf("凭证号: ");        prtf_inum(cr_num,7);        printf("\n");        addspacef(14);        printf("币种: ");        switch(cu_type[0])          {            case 'C':              printf("加拿大元");              break;            case 'F':              printf("法国法郎");              break;            case 'H':              printf("港元    ");              break;            case 'J':              printf("日元    ");              break;            case 'M':              printf("德国马克");              break;            case 'P':              printf("英镑    ");              break;            case 'R':              printf("人民币  ");              break;            case 'U':              printf("美元    ");          }        printf("\n\n\n");        addspacef(14);        switch(n)          {            case 2:              printf("原金额:    ");              prtf_dnum(amoun,13);              addspacef(10);              printf("改为: ");              prtf_dnum(amoun1,13);              printf("\n");              break;            case 3:              printf("原开户日期:");              printf("%4d年%2d月%2d日",ope_date/10000,(ope_date%10000)/100,                ope_date%100);              addspacef(10);              printf("改为: ");              printf("%4d年%2d月%2d日\n",ope_date1/10000,(ope_date1%10000)/100,                ope_date1%100);              break;            case 4:              printf("原起息日期:");              printf("%4d年%2d月%2d日",int_date/10000,(int_date%10000)/100,                int_date%100);              addspacef(10);              printf("改为: ");              printf("%4d年%2d月%2d日\n",int_date1/10000,(int_date1%10000)/100,                int_date1%100);              break;            case 5:              printf("原最后日期:");              printf("%4d年%2d月%2d日",las_date/10000,(las_date%10000)/100,                las_date%100);              addspacef(10);              printf("改为: ");              printf("%4d年%2d月%2d日\n",las_date1/10000,(las_date1%10000)/100,                las_date1%100);          }        printf("          ─────────────────────────────────────────\n");        printf("              负责人:              复核人:            经办人:            操作员:%s\n",stn);        printf("%c%c[4i",12,27);        move(23,20);        addspace(50);        move(23,20);        addstr("修改操作已完成, ");      }    if(flag==0)      {        $ commit work;      }    else      {        $ rollback work;      }    mess((short)3);    getch();  }$ close database;endwin();#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/readdv>#include </u/ebcsav/include/readch>#include </u/ebcsav/include/readst>#include </u/ebcsav/include/num_time>#include </u/ebcsav/include/delay>

⌨️ 快捷键说明

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