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

📄 change_dem.ec

📁 这是一个使用 informix esql/c 技术开发的银行程序的部分代码。
💻 EC
📖 第 1 页 / 共 2 页
字号:
/*   change_demand   */#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],cu_type1[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,interes1;move(0,25);printw("活 期 储 蓄 帐 户 重 要 修 改");s_num[1]='\0';ope_num[0]=op_num;ope_num[1]='\0';s_type[1]='\0';cu_type1[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=op.type&3;if(cred_type==2) cred_type=11;if(cred_type==3)  {    move(7,6);    addstr("币种(0:返回, R:人民币, F:外币):");    c=y_n('0','R','F');    if(c=='0')      {        endwin();        return;      }    cred_type=(c=='R')?1:11;  }cred_type++;move(7,6);addstr("币种:                     ");if(cred_type==2) addstr("人民币  ");else addstr("外币    ");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-最后日,6-币种,8-累计利息: ");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;if(cred_type==2)  {    $ 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;  }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;cu_type1[0]=cu_type[0];interes1=interes;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);move(13,10);addstr("累计利息: ");move(13,48);printw("%16.4f",interes);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);      break;    case 6:      flag=0;      while(flag==0)        {          move(17,2);          if(cred_type==12) addstr("请选择: U-美元  J-日元  H-港元  M-德国马克  P-英镑  F-法国法郎  C-加拿大元");          else break;          move(5,20);          c=readch();          if(isprint(c)) cu_type1[0]=toupper(c);          move(5,48);          switch(cu_type1[0])            {              case 'U':                printw("%-10s","美元    ");                flag=1;                break;              case 'J':                printw("%-10s","日元    ");                flag=1;                break;              case 'H':                printw("%-10s","港元    ");                flag=1;                break;              case 'M':                printw("%-10s","德国马克");                flag=1;                break;              case 'P':                printw("%-10s","英镑    ");                flag=1;                break;              case 'F':                printw("%-10s","法国法郎");                flag=1;                break;              case 'C':

⌨️ 快捷键说明

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