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

📄 hand_fix1.ec

📁 这是一个使用 informix esql/c 技术开发的银行程序的部分代码。
💻 EC
📖 第 1 页 / 共 2 页
字号:
              move(11,20);              c=readdv(&x,8);              if(c==10) las_date=x;              move(11,20);              addspace(10);              move(11,48);              printw("%4d年%2d月%2d日",las_date/10000,las_date%10000/100,                      las_date%100);              if(c==10||c==13||c==25) n=9;              else if(c==24) n=7;              else if(c==5) n=11;              else if(c==4) n=12;              break;            case 9:/*              move(20,20);              printw("请输入月利率");*/              move(12,20);/*              c=readdv(&x,10);              if(c==10) interes=x;*/              if(toupper(cu_type[0])=='R') cred_type=1;              else cred_type=11;              k=(ter[0]>64)?(ter[0]-64):(ter[0]-48)*12;              k+=((toupper(cu_type[0])-64)*10000+cred_type*100);              interes=get_rate(k,las_date);              move(12,20);              addspace(12);              move(12,48);              printw("%10.6f",interes);              if(c==10||c==13||c==25) n=10;              else if(c==24) n=8;              else if(c==5) n=11;              else if(c==4) n=12;              break;            case 10:              move(13,30);/*              c=readch();*/              c='Y';              if(c=='Y') cu_type[0]=tolower(cu_type[0]);              else if(c=='N') cu_type[0]=toupper(cu_type[0]);              move(13,48);              if(islower(cu_type[0])) addstr("自动转存  ");              else addstr("不自动转存");              if(c=='Y'||c=='N'||c==10||c==25||c==5) n=11;              else if(c==24) n=9;              else if(c==4) n=12;              break;            case 11:              move(20,20);              mess((short)5);              c=y_n('Y','N','C');              move(20,20);              addspace(42);              if(c=='C') n=1;              else if(c=='Y')                {                  flag=0;                  ope_num[0]=op_num;                  ope_num[1]='\0';                  if(toupper(cu_type[0])=='R')                    cred_type=1;                  else cred_type=11;                  s_type[0]=cred_type;                  cred_num=cr_num;                  move(20,20);                  $ begin work;                        move(20,20);                        ope_date=int_date=las_date;                        statu[0]='A';                        k=(ter[0]>64)?(ter[0]-64):(ter[0]-48)*12;                        ter[0]=k;                        k+=((toupper(cu_type[0])-64)*10000+cred_type*100);                        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);                            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!=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;                                  }                                $ 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                                  {                                    cu_type[0]=c;                                    move(20,20);                                    addspace(40);                                    move(20,20);                                    mess((short)13);                                    flag=1;                              }                          }                      }                    if(flag==1)                      {                        $ commit work;                      }                    else                      {                        $ rollback work;                      }                    n=12;                }              else n=12;          }        if(n==12) break;      }    move(20,46);    mess((short)15);    c=y_n('Y','N','N');    if(c=='N') break;    cr_num++;    move(2,0);    clrtobot();    block(1,0,22,80);    n=1;  }$ close database;#include </u/ebcsav/include/end>double get_rate(k,dat)long k,dat;{$double rat;$long k1,dat1;double ll2;int dat2;long tz[16]={15,30,60,90,120,150,180,210,240,270,300,330,360,720,1080,0};short year,month,day;long i,yy,mm,mm1,dd,t1,ts,m1,m2,m3,yer,da2;num_date(&year,&month,&day);yy=dat/10000;mm=(dat%10000)/100;dd=dat%100;t1=k/100;if(day>=dd)ts=(year-yy)*360+(month-mm)*30+day-dd;else   {                       if(month==1){yer=year-1;                                   mm1=12;                                   }                       else{  mm1=month-1;                              yer=year;                            }                       m1=yer%400;                       m2=yer%100;                       m3=yer%4;                       if(mm1==1||mm1==3||mm1==5||mm1==7||mm1==8||mm1==10||mm1==12) da2=31;                       else if(mm1!=2) da2=30;                            else if(m1==0||m2!=0&&m3==0) da2=29;                                 else da2=28;              ts=(yer-yy)*360+(mm1-mm)*30+da2+day-dd;   }if(t1==1807){             if(ts<15)k=180200;             else              {             i=0;                    do{                      i++;                      }while(ts>=tz[i]&&i<15);                      k=t1*100+i;              }            }k1=k;$ declare read3 scroll cursor for select ll,rq into $rat,$dat1 from inter_rate where syh=$k1;    if(sqlca.sqlcode!=0)      {        move(21,20);        addstr("申请");        mess((short)9);        printw("(%d), ",sqlca.sqlcode);        mess((short)3);        getch();        return;      } $ open read3; if(sqlca.sqlcode !=0)  {    printw("** %d 错误 1: 打开利率表出错 **",sqlca.sqlcode);   getch();   return;   }$fetch first read3;dat2=0;do{   if(dat1<=dat&&dat1>=dat2)               {                dat2=dat1;                ll2=rat;               }    $fetch next read3;  }while(sqlca.sqlcode!=SQLNOTFOUND);$close read3;return(ll2);}#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/prtf_upper>#include </u/ebcsav/include/num_time>#include </u/ebcsav/include/readch>#include </u/ebcsav/include/readdv>#include </u/ebcsav/include/readst>#include </u/ebcsav/include/ac_num>

⌨️ 快捷键说明

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