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

📄 dated_d.ec

📁 这是一个使用 informix esql/c 技术开发的银行程序的部分代码。
💻 EC
📖 第 1 页 / 共 2 页
字号:
/*   零整续存   */#include </u/ebcsav/include/sav.h>$include sqlca;$include sqlda;void addspace();void mess();char y_n();char readdv();char readst();char readch();long ac_num();double get_inte();void prt_inum();void prt_dnum();void addspacef();void prtf_inum();void prtf_dnum();short num_time();void delay();#include </u/ebcsav/include/begin>short ti,i,n,j=0,h=0,p=0;double x;double amm;long k,amt;unsigned char c;char st[30];$ char s_num[2],nam[9],cu_type[2],te[2];$ long a_num,cr_num,ope_date,b_num,o_date,p_date,z_date,a_date;$ double amoun,inte,inte1,amou,bala,amo,am,am1,bala1,amou1;$ short cred_type;$ long cred_num,i_date,l_mon,te1,m1,m2,pas;$ char ope_num[2],s_type[2],sta[2],l_num[2],r_type[2],fg[2];move(0,25);$ database saving;printw("零  存  整  取  续  存");ope_num[0]=op_num;ope_num[1]='\0';s_num[0]=op.num&0x7f;s_num[1]='\0';l_num[1]='\0';r_type[0]=9;r_type[1]='\0';s_type[1]='\0';nam[0]='\0';cu_type[0]='R';cu_type[1]='\0';amoun=0.0;$ declare blot scroll cursor for select blot_num from r_blot;move(23,16);standout();mess(1);standend();move(3,10);addstr("帐    号: ");move(3,20);prt_inum(s_num[0],2);addstr("-");while(1)  {    j=0;    h=0;    amou=0.0;    p=0;    $ begin work;    while(1)     {      move(3,24);      c=readdv(&x,9);      if(c==10) a_num=x;      move(3,24);      prt_inum(a_num,9);      cred_type=3;      s_type[0]=cred_type;      $ select name,pass,term,amount,balance,cre_num,open_date,inte_date,               status,flag,interest,last_month,line_num into $nam,$pas,$te,               $amoun,$bala,$cr_num,$o_date,$i_date,$sta,$fg,$inte,$l_mon,               $l_num from r_dated where sec_num=$s_num and acc_num=$a_num;         if(sqlca.sqlcode!=0)           {              move(20,20);              mess(19);              break;            }      ope_date=year*10000+month*100+day;      if(ope_date!=i_date)        {           k=0;           k=((toupper(cu_type[0])-64)*10000+200);           inte=inte+get_inte(k,i_date,bala,&amm);           i_date=ope_date;         }      if(sta[0]=='E')        {           mess(24);           break;         }       if((ope_date%10000)/100==01)a_date=ope_date/100-89;       else a_date=ope_date/100-1;        if(l_mon<a_date)        {         if(fg[0]&2==0)          {            if((a_date%100)==01)a_date=a_date-89;            else a_date=a_date-1;           }        }       else a_date=l_mon;       te1=a_date/100-o_date/10000;       if(te1>0)te1=te1*12+a_date%100;       else te1=a_date%100;       te1=te1-(o_date%10000)/100;       te1=te[0]-te1-1;       if(te1<1)         { move(20,20);           mess(52);           break;         }       if((ope_date%10000)/100<6)         p_date=(ope_date/10000-1)*100+12-5+(ope_date%10000)/100;       else p_date=ope_date/100-5;       move(5,10);       addstr("姓    名: ");       move(7,10);       addstr("存    期: ");       move(9,10);       addstr("金    额: ");       move(11,10);       addstr("余    额: ");       move(13,10);       addstr("凭 证 号: ");       move(5,20);       printw("%-8s",nam);       move(7,20);      prt_inum(te[0]/12,1);      printw("年");      move(11,20);      prt_dnum(bala,13);      move(13,20);      prt_inum(cr_num,7);      move(9,20);      addspace(20);      move(9,20);      c=readdv(&x,11);      if(c==10) amou=x;      if((amou<1)||(amou>100000))break;      if((amou-(long)amou)>0.005)       {        move(20,20);        mess(67);        mess(4);        getch();        move(20,20);        addspace(30);        break;       }      amo=amou;      move(9,20);      prt_dnum(amou,13);      move(20,02);      if(l_mon<p_date)        {  mess(46);          break; }     if(l_num[0]==0)     {      move(20,10);      addstr("存折行号: ");      move(20,34);      c=readdv(&x,2);      if(c==10) l_num[0]=x;     }     else      l_num[0]++;      if(l_num[0]>40)       {         move(20,20);         mess(37);         break;        }      m1=amoun+0.005;      m2=amou+0.005;      if((m2%m1)!=0)       if(fg[0]&0x1==1)/*集体户增减额度*/        {          if(l_mon==ope_date/100)            {  mess(50);              break; }         if(amou>amoun)          if((fg[0]&0x4)==4)            { mess(48);              break; }          else {               if(((o_date/100)%100)==12)               z_date=o_date/100+89;               else z_date=o_date/100+1;               if((ope_date/100)!=z_date)                { mess(49);                  break; }               else                  { move(20,20);                    mess(47);                    c=y_n('Y','Y','N');                    if(c=='N') break;                    move(20,20);                    addspace(30);                    move(20,20);                    printw("增后额度为");                    x=amou-(amou-amoun)/2;                    prt_dnum(x,11);                    printw("元吗(Y/N)?");                    c=y_n('Y','Y','N');                    if(c=='N')break;                    move(20,20);                    addspace(40);                    fg[0]=fg[0]|0x4;                    amoun=x;                    bala+=amou;                    h=1;                    j=1;                    l_mon=ope_date/100; }}         else /*减小额度*/               {                  if((fg[0]&0x8)==8)                  { mess(53);                    break; }                 move(20,20);                 mess(59);                 c=y_n('Y','Y','N');                 if(c=='N') break;                 k=((toupper(cu_type[0])-64)*10000+cred_type*100);                 am=amoun-amou;                 am1=bala/amoun*am;                 inte1=am/amoun*inte;                 inte-=inte1;                 amoun=amou;                 bala=bala-am1+amou;                 h=2;                 j=1;                 fg[0]=fg[0]|0x8;  } }         else { mess(51);                break; }        else if(amou>amoun)              { if((amou/amoun)>te1)                  { mess(52);                   break;}                amou1=amou;                while((amou-amoun)>=0)                 { j++;                   bala+=amoun;                   amou-=amoun;                   amt=(ope_date+0.005)/100;                   if(((l_mon+1)<amt) && ((fg[0]&2)==0))                    { fg[0]=fg[0]|0x2;                      l_mon=ope_date/100-1;}                   else {                           amt=(ope_date+0.005)/100;                          if((l_mon+1)<amt)                          l_mon=ope_date/100;                          else                          l_mon++;                          if((l_mon%100)>12)                           l_mon=(l_mon/100+1)*100+l_mon%100-12;} }                amou=amou1;               }             else                 { j=1;                  bala+=amoun;                  amt=(ope_date+0.005)/100;                  if(((l_mon+1)<amt) && ((fg[0]&2)==0))                   { l_mon=ope_date/100-1;                     fg[0]=fg[0]|0x2;}                   else {                           if((l_mon+1)<amt)                           l_mon=ope_date/100;                          else                           l_mon++;                           if((l_mon%100)>12)                            l_mon=(l_mon/100+1)*100+l_mon%100-12; }}               move(9,20);      prt_dnum(amoun,13);      move(11,20);      prt_dnum(bala,13);/*更新记录开始*/      move(20,20);      mess(5);      c=y_n('Y','N','C');      move(20,20);      addspace(42);      if(c=='N')break;      else if(c=='Y')        {          move(20,20);          for(n=0;n<7;n++)          if(op.name[n]!='\0')st[n]=op.name[n]^0xff;          else st[n]='\0';          ti=num_time();          if(h==2)          {           bala1=bala-amoun;           for(n=0;n<5;n++)           {             $ insert into r_blot               values              (0,$ope_num,$s_num,$a_num,$nam,$s_type,               $cu_type,$te,$cr_num,"P",$am1,$bala1,$inte1);             if(sqlca.sqlcode!=-271) break;             printw("*");             refresh();             delay(5l);           }           if(sqlca.sqlcode==-271)             { mess((short)73);               p=1;               break;             }           else if(sqlca.sqlcode!=0)              {                addstr("写");                mess(16);                printw("(%d), ",sqlca.sqlcode);                p=1;                break;              }          }          for(n=0;n<5;n++)          {            $ insert into r_blot              values             (0,$ope_num,$s_num,$a_num,$nam,$s_type,              $cu_type,$te,$cr_num,"C",$amo,$bala,$inte);            if(sqlca.sqlcode!=-271) break;            printw("*");            refresh();            delay(5l);          }          if(sqlca.sqlcode==-271)                { mess((short)73);                  p=1;                  break;                }          else if(sqlca.sqlcode!=0)             {               addstr("写");               mess(16);               printw("(%d), ",sqlca.sqlcode);                p=1;               break;             }          $ open blot;          $ fetch last blot into $b_num;          $ insert into r_dated_sch            values            ($s_num,$a_num,$ope_date,$b_num,             $nam,$cu_type,$amo,$bala,$inte,$r_type);          $ close blot;          if(sqlca.sqlcode!=0)             {               addstr("写");               mess(18);               printw("(%d), ",sqlca.sqlcode);                p=1;               break;             }          mess(42);          mess(4);          getch();          printf("%c%c%c%c%c%c%c%c%c",27,'%','9',1,20,28,'q',27,']');          printf("户  名: %-8s",nam);          printf("\n凭证号: ");          prtf_inum(cr_num,7);          addspacef(25);          printf("%4d   %2d   %2d   %2d时%2d分\n\n\n",                  year,month,day,ti/100,ti%100);          addspacef(14);          prtf_inum(s_num[0],2);          printf("-");          prtf_inum(a_num,9);          printf("        %d年%2d月%2d日",year,month,day);          printf(" %d年%2d月%2d日    ",o_date/10000,                 (o_date%10000)/100,o_date%100);          prtf_inum(s_num[0],2);          printf("        %d      ",b_num);          if((fg[0]&0x1)==1)          printf("%-4s","集体");          else          printf("%-4s","个人");          printf("\n\n");          if(pas!=0)printf("                  密");          else      printf("                    ");          addspacef(14);          prtf_dnum(amou,14);          printf("   ");          prtf_dnum(bala,14);          addspacef(9);          switch(te[0])            {              case 12:                printf("%4s","一年");                break;              case 36:                printf("%4s","三年");                break;              case 60:                printf("%4s","五年");                break;             }          addspacef(7);          printf("%-6s\f\n",st);          printf("");          move(20,20);          addspace(30);          move(20,20);          mess(43);          mess(4);          getch();          printf("%c9%c%c",'%',1,24);          if(h==2)          {           printf("%c9%c%c\n\n\n\n\n\n\n\n\n\n",'%',1,24);           printf("    **********************\n");           printf("    **********************");           printf("\n    额  度 :");           prtf_dnum(amoun,13);           printf("\f%c9%c%c",'%',1,20);           move(20,20);           addspace(30);           move(20,20);           mess(43);           mess(4);           getch();           printf("%c9%c%c",'%',1,24);          }          if((h==0)||(h==2))          {           if((l_num[0]>=11&&l_num[0]<=20)||(l_num[0]>=31&&l_num[0]<=40))           {             printf("%c9%c%c",'%',1,20);             for(i=1;i<5;i++)printf("\n");             printf("%c9%c%c",'%',1,24);             for(i=1;i<l_num[0]%10;i++)printf("\n");             if(l_num[0]%10==0)             for(i=1;i<10;i++)printf("\n");           }           if((l_num[0]>1&&l_num[0]<=10)||(l_num[0]>=21&&l_num[0]<=30))           {             printf("%c9%c%c",'%',1,20);             for(i=1;i<20;i++)printf("\n");             printf("%c9%c%c",'%',1,24);             for(i=1;i<l_num[0]%10;i++)printf("\n");             if(l_num[0]%10==0)             for(i=1;i<10;i++)printf("\n");           }          }          if(h==1)          {           printf("%c9%c%c\n\n\n\n\n\n\n\n\n\n",'%',1,24);           printf("    额  度 :");           prtf_dnum(amoun,13);           printf("\n    **********************");           printf("\n\n\n\n\n\n");           printf(" %2d%2d%2d 增             ",year%100,month,day);           prtf_dnum(amou-amoun,15);           prtf_dnum(amoun,15);           printf(" %-6s\n",st);           l_num[0]++;          }          while(j>0)          {            j--;            if(h==2)            {             printf(" %2d%2d%2d 减  ",year%100,month,day);             prtf_dnum(am1,15);             addspacef(11);             prtf_dnum(bala-amou,15);             printf(" %-6s\n",st);             l_num[0]++;            }            printf(" %2d%2d%2d 存             ",year%100,month,day);            prtf_dnum(amoun,15);            prtf_dnum(bala,15);            printf(" %-6s\n",st);            if(j>0)            {             if((l_num[0]==10)||(l_num[0]==30))              { printf("\f");                printf("%c9%c%c",'%',1,20);                for(i=1;i<5;i++)printf("\n");                printf("%c9%c%c",'%',1,24); }             if(l_num[0]==20) printf("\n\n");

⌨️ 快捷键说明

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