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

📄 fix_reopen.ec

📁 这是一个使用 informix esql/c 技术开发的银行程序的部分代码。
💻 EC
📖 第 1 页 / 共 5 页
字号:
            printf("%c%c%c%c%c%c%c%c%c%c%c%c%c\n\n\n\n\n\n\n\n\n\n\n\n",              27,'[','5','i',28,'q',27,']',27,'%','9',1,20);            addspacef(10);            printf("销户并转存日期: %4d年%2d月%2d日",year,month,day);            printf("  本金:");            prtf_dnum(amoun,13);            printf("  利息(保值):");            prtf_dnum(interes+maint_v,13);            printf("\n%c%c%c%c%c",12,27,'[','4','i');            move(20,20);            addspace(50);            move(20,20);            mess((short)44);            mess((short)4);            getch();            strcpy(na,nam);            s_n=s_num[0];            a_n=a_num;            cu_t=cu_type[0];            te=ter[0];            b_n=b_num;            prtf_inte(k,int_date,amoun,amoun+interes+maint_v);            sum+=(amoun+interes+maint_v);            if(flag1==0) flag1=toupper(cu_type[0]);            mess((short)23);          }        if(flag==0)          {            $ commit work;          }        else          {            $ rollback work;          }        move(20,20);        addspace(50);        move(20,20);        addstr(" 还有其它帐户要合并转存吗(Y/N)? ");        c=y_n('Y','N','N');        if(c=='N') break;      }    if(flag1==0) break;    amoun=sum;    move(2,0);    clrtobot();    block(1,0,22,80);    move(3,10);    addstr("帐    号: ");    move(4,10);    addstr("姓    名: ");    move(4,48);    addstr(nam);    move(5,10);    addstr("密    码: ");    move(5,48);    printw("%7d",pas);    move(6,10);    addstr("币    种: ");    move(6,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);    if(ter[0]<12) printw("%2d个月",ter[0]);    else printw("%2d年",ter[0]/12);    move(8,10);    addstr("金    额: ");    move(8,48);    prt_dnum(amoun,16);    move(9,10);    addstr("地    址: ");    move(9,48);    addstr(addres);    move(10,10);    addstr("凭 证 号: ");    move(10,48);    prt_inum(cr_num,7);    move(11,10);    addstr("是否自动转存(Y/N)? ");    n=1;    while(1)      {        switch(n)          {            case 1:              move(4,20);              c=readst(s,8);              if(c==10) strcpy(nam,s);              move(4,20);              addspace(10);              move(4,48);              printw("%-8s",nam);              if(c==10||c==13||c==25) n=2;              else if(c==5) n=9;              break;            case 2:              move(5,20);              c=readdv(&x,7);              if(c==10) pas=x;              move(5,20);              addspace(10);              move(5,48);              printw("%7d",pas);              if(c==10||c==13||c==25) n=3;              else if(c==24) n=1;              else if(c==5) n=9;              break;            case 3:              move(17,2);              if(toupper(cu_type[0])=='R') addstr("请选择: C-三个月  F-六个月  1-一年  2-二年  3-三年  5-五年");              else addstr("请选择: A-一个月  C-三个月  F-六个月  1-一年  2-二年");              move(7,20);              c=readch();              if(isprint(c)) ter[0]=c;              else ter[0]=(ter[0]>=12)?(ter[0]/12+48):(ter[0]+64);              flag=0;              move(7,48);              if(toupper(cu_type[0])=='R')                {                  switch(ter[0])                    {                      case 'C':                      case 'F':                        printw("%1d个月    ",ter[0]-64);                        flag=1;                        break;                      case '1':                      case '2':                      case '3':                      case '5':                        printw("%1d年    ",ter[0]-48);                        flag=1;                    }                }              else                {                  switch(ter[0])                    {                      case 'A':                      case 'C':                      case 'F':                        printw("%1d个月    ",ter[0]-64);                        flag=1;                        break;                      case '1':                      case '2':                        printw("%1d年    ",ter[0]-48);                        flag=1;                    }                }              move(17,2);              addspace(76);              move(7,20);              addspace(2);              ter[0]=(ter[0]>64)?(ter[0]-64):(ter[0]-48)*12;              if(flag==0);              else if(c==24) n=2;              else if(c==5) n=9;              else n=4;              break;            case 4:              move(8,20);              c=readdv(&x,11);              if(c==10) amoun=x;              move(8,20);              addspace(12);              move(8,48);              prt_dnum(amoun,16);              x=amoun-sum;              move(18,6);              if(x>0.005)                {                  addstr("储户应再交款");                  move(18,48);                  prt_dnum(x,13);                }              else if(x<-0.005)                {                  x=-x;                  addstr("应退还储户款");                  move(18,48);                  prt_dnum(x,13);                }              else addspace(60);              if(amoun<10.0||amoun>=100000000.0);              else if(toupper(cu_type[0])!='R'&& fabs(x-(long)(x+0.005))>0.005);              else if(c==10||c==13||c==25) n=5;              else if(c==24) n=3;              else if(c==5) n=9;              break;            case 5:              move(9,20);              c=readst(s,24);              if(c==10) strcpy(addres,s);              move(9,20);              addspace(26);              move(9,48);              printw("%-24s",addres);              if(c==10||c==13||c==25) n=6;              else if(c==24) n=4;              else if(c==5) n=9;              break;            case 6:              move(10,20);              c=readdv(&x,7);              if(c==10) cr_num=x;              move(10,20);              addspace(10);              move(10,48);              prt_inum(cr_num,7);              if(c==10||c==13||c==25) n=7;              else if(c==24) n=5;              else if(c==5) n=9;              break;            case 7:              move(11,30);              c=readch();              if(c=='Y') cu_type[0]=tolower(cu_type[0]);              else if(c=='N') cu_type[0]=toupper(cu_type[0]);              move(11,48);              if(islower(cu_type[0])) addstr("自动转存  ");              else addstr("不自动转存");              if(c=='Y'||c=='N'||c==10||c==25) n=9;              else if(c==24) n=6;              else if(c==5) n=9;              break;            case 9:              move(20,20);              addstr("执行(Y) 或修改(C)? ");              c=y_n('Y','C','C');              move(20,20);              addspace(42);              if(c=='C')                {                  n=1;                  break;                }              $ select cre_num from credential                where op_num=$ope_num and cre_type=$cred_type                and cre_num=$cr_num;              if(sqlca.sqlcode!=0)                {                  move(20,20);                  mess((short)11);                  mess((short)2);                  n=6;                }              else n=10;          }        if(n==10) break;      }    flag=0;    $ begin work;    cred_num=cr_num;    cred_num+=100000000;    $ update credential      set cre_num=$cred_num      where op_num=$ope_num and cre_type=$cred_type and cre_num=$cr_num;    if(sqlca.sqlerrd[2]!=1)      {        addstr("写");        mess((short)9);        printw("(%d), ",sqlca.sqlerrd[2]);      }    else      {        s_num[0]=op.num&0x7f;        a_num=ac_num(cred_type);        move(3,48);        prt_inum((long)s_num[0],2);        addstr("-");        prt_inum(a_num,9);        move(20,20);        ope_date=int_date=las_date=year*10000+month*100+day;        statu[0]='A';        k=((toupper(cu_type[0])-64)*10000+cred_type*100)+ter[0];        interes=get_rate(k,int_date);        maint_v=0.0;        if(cred_type==1)          {            $ insert into r_fix              values              ($s_num,$a_num,$nam,$pas,$cu_type,$ter,$amoun,              $addres,$cr_num,$ope_date,$int_date,$statu,              $las_date,$interes,$maint_v);          }        else          {            $ insert into f_fix              values              ($s_num,$a_num,$nam,$pas,$cu_type,$ter,$amoun,              $addres,$cr_num,$ope_date,$int_date,$statu,              $las_date,$interes,$maint_v);          }        if(sqlca.sqlcode!=0)          {            addstr("写");            mess((short)14);            printw("(%d), ",sqlca.sqlcode);          }        else          {            c=cu_type[0];            cu_type[0]=toupper(c);            for(i=0;i<5;i++)              {                if(cred_type==1)                  {                    $ insert into r_blot                      values                      (0,$ope_num,$s_num,$a_num,$nam,$s_type,                      $cu_type,$ter,$cr_num,"O",$amoun,$amoun,0);                  }                else                  {                    $ insert into f_blot                      values                      (0,$ope_num,$s_num,$a_num,$nam,$s_type,                      $cu_type,$ter,$cr_num,"O",$amoun,$amoun,0);                  }                if(sqlca.sqlcode!=-271) break;                printw("*");                refresh();                delay(5l);              }            if(sqlca.sqlcode==-271) mess((short)73);            else if(sqlca.sqlcode!=0)              {                addstr("写");                mess((short)16);                printw("(%d), ",sqlca.sqlcode);              }            else              {                if(cred_type==1)                  {                    $ open blot1;                    $ fetch last blot1 into $b_num;                    $ close blot1;                  }                else                  {                    $ open blot2;                    $ fetch last blot2 into $b_num;                    $ close blot2;                  }                cu_type[0]=c;                $ insert into open_acc                  values                  ($s_num,$s_type,$cu_type,$ter,$a_num,$nam,                  $addres,$amoun,$ope_num);                if(sqlca.sqlcode!=0)                  {                    addstr("写");                    mess((short)17);                    printw("(%d), ",sqlca.sqlcode);                  }                else                  {                    for(i=0;i<7;i++)                      if(op.name[i]!='\0')st[i]=op.name[i]^0xff;                      else st[i]='\0';                    ti=num_time();                    year1=year;                    month1=month;                    month1+=ter[0];                    year1+=((month1-1)/12);                    month1=((month1-1)%12)+1;                    mess((short)42);                    mess((short)4);                    getch();                                   printf("%c%c%c%c%c",27,'%','9',1,20);                                   printf("\n      凭证号: ");                                   prtf_inum(cr_num,7);                                   printf("\n");                                   addspacef(28);                                   printf("%4d      %2d      %2d      %2d时%2d分\n\n\n\n\n\n\n\n\n\n",                                           year,month,day,ti/100,ti%100);                                   addspacef(11);                                   printf("%-8s    ",nam);                                   prtf_inum(s_num[0],2);                                   printf("-");                                   prtf_inum(a_num,9);                                   printf("  ");

⌨️ 快捷键说明

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