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

📄 dem_pay.ec

📁 这是一个使用 informix esql/c 技术开发的银行程序的部分代码。
💻 EC
📖 第 1 页 / 共 2 页
字号:
/*   活期支取   */#include </u/ebcsav/include/sav.h>$include sqlca;$include sqlda;void addspace();void addspacef();void mess();char y_n();char readdv();char readst();char readch();char fv_date();long ac_num();short num_time();double get_inte();void prt_inum();void prt_dnum();void prtf_inum();void prtf_dnum();void delay();#include </u/ebcsav/include/begin>double x,amm;short j=0,i,n,ti,p=0;unsigned char c;char st[30],yn;long k;$ char s_num[2],nam[9],cu_type[2],addres[25];$ long pas,pas1,a_num,cr_num,ope_date,b_num,b_num2;$ double amoun,inte,amou,amo,balan;$ short cred_type;$ long cred_num,i_date,l_date,r_date;$ char ope_num[2],s_type[2],sta[2],l_num[2],r_type[2],stat[2];move(0,25);$ database saving;printw("活  期   储  蓄  支  取");ope_num[0]=op_num;addres[0]='\0';ope_num[1]='\0';s_num[0]=op.num&0x7f;s_num[1]='\0';l_num[1]='\0';s_type[1]='\0';r_type[0]=8;r_type[1]='\0';sta[1]='\0';stat[1]='\0';nam[0]='\0';cu_type[0]=((op.type&1)==1)?'R':'F';cu_type[1]='\0';amoun=0.0;amou=0.0;$ declare blot scroll cursor for select blot_num from r_blot;$ declare blot1 scroll cursor for select blot_num from f_blot;move(23,16);standout();mess(1);standend();move(3,10);addstr("帐    号: ");move(3,20);prt_inum(s_num[0],2);addstr("-");while(1)  {    $ begin work;    pas=0;    p=0;    while(1)     {      move(3,24);      c=readdv(&x,9);      if(c==10) a_num=x;      move(3,24);      prt_inum(a_num,9);      if((op.type&3)==1)cred_type=2;      else if((op.type&3)==2)cred_type=12;      else        {         move(7,10);         addstr("人民币/外币:(R/F)");         move(7,30);         c=y_n('R','R','F');         if(isprint(c)) cu_type[0]=c;         if(toupper(cu_type[0])=='R')cred_type=2;         else cred_type=12;         move(7,10);         addspace(40);        }      s_type[0]=cred_type;      if(cred_type==2)      $ select name,pass,cur_type,amount,address,cre_num,inte_date,status,        last_date,interest,line_num into $nam,$pas1,$cu_type,$amoun,$addres,               $cr_num,$i_date,$sta,$l_date,$inte,$l_num               from r_demand where sec_num=$s_num and acc_num=$a_num;      else      $ select name,pass,cur_type,amount,address,cre_num,inte_date,status,         last_date,interest,line_num into $nam,$pas1,$cu_type,$amoun,$addres,               $cr_num,$i_date,$sta,$l_date,$inte,$l_num               from f_demand where sec_num=$s_num and acc_num=$a_num;         if(sqlca.sqlcode!=0)           {              move(20,20);              mess(19);              p=1;              break;            }       if(pas1!=0)        {         move(5,10);         addstr("密    码: ");         move(5,22);         c=readdv(&x,7);         if(c==10) pas=x;         move(5,20);         addspace(40);         if(pas!=pas1)           {              move(20,20);              mess(20);              p=1;              break;            }         }      ope_date=year*10000+month*100+day;      if(ope_date!=i_date)        {           k=0;           k=((toupper(cu_type[0])-64)*10000+cred_type*100);           inte=inte+get_inte(k,i_date,amoun,&amm);           i_date=ope_date;         }      if(sta[0]!='A')        if(sta[0]=='a')          {            beep();            move(19,20);            standout();            mess(26);            standend();           }        else         if(toupper(sta[0])=='F'||toupper(sta[0])=='V')           {             yn=fv_date(l_date,toupper(sta[0]));             if(yn!='Y') break;             else/*              if(toupper(sta[0])==sta[0])sta[0]='A';              else sta[0]='a';*/              {              move(20,20);              mess(68);              p=1;              break;              }            }          else           {             move(20,20);             mess(22);             p=1;             break;            }       move(7,10);       addstr("姓    名: ");       move(9,10);       addstr("币    种: ");       move(11,10);       addstr("金    额: ");       move(13,10);       addstr("余    额: ");       move(15,10);       addstr("凭 证 号: ");       move(17,10);       addstr("地    址: ");       move(7,20);       printw("%-8s",nam);       move(9,20);       switch(toupper(cu_type[0]))              {                   case 'R':                    printw("%-10s","人民币");                     break;                   case 'U':                    printw("%-10s","美元");                     break;                   case 'J':                     printw("%-10s","日元");                     break;                   case 'H':                     printw("%-10s","港元");                     break;                   case 'M':                     printw("%-10s","德国马克");                     break;                   case 'P':                     printw("%-10s","英镑");                     break;                   case 'F':                     printw("%-10s","法国法郎");                     break;                   case 'C':                     printw("%-10s","加拿大元");               }      move(13,20);      prt_dnum(amoun,13);      move(15,20);      prt_inum(cr_num,7);      move(17,20);      printw("%24s",addres);      move(11,20);      c=readdv(&x,11);      if(c==10) amou=x;      move(11,20);      prt_dnum(amou,13);      move(19,20);      addspace(30);      if(amou>=amoun)       {        move(20,10);        mess(35);        p=1;        break;       }      amoun-=amou;      move(13,20);      prt_dnum(amoun,13);      l_num[0]++;      if(l_num[0]>50)       {         move(20,20);         mess(37);         p=1;         break;        }              if(cred_type==2)               {                $ declare alot scroll cursor for select pres_date,blot_num,                  amount,balance,status into $l_date,                  $b_num2,$amo,$balan,$stat from r_dem_sch                   where sec_num=$s_num and acc_num=$a_num;                  $ open alot;               }              else               {                  $ declare alot1 scroll cursor for select pres_date,blot_num,                    amount,balance,status into $l_date,                    $b_num2,$amo,$balan,$stat from f_dem_sch                     where sec_num=$s_num and acc_num=$a_num;                  $ open alot1;               }              if(sqlca.sqlcode==0)              {                stat[0]=1;                while(((stat[0]&0x4)!=4)&&(sqlca.sqlcode==0))                if(cred_type==2)                   $ fetch alot;                else                   $ fetch alot1;                if(sqlca.sqlcode==0)                  {                   move(20,20);                   addstr("该户有未登折信息,请先登折,");                   p=1;                   break;                  }              }/*更新记录开始*/           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();              for(n=0;n<5;n++)              {                 if(cred_type==2)                     $ insert into r_blot                       values                       (0,$ope_num,$s_num,$a_num,$nam,$s_type,                       $cu_type,0,$cr_num,"D",$amou,$amoun,$inte);                 else                     $ insert into f_blot                       values                       (0,$ope_num,$s_num,$a_num,$nam,$s_type,                       $cu_type,0,$cr_num,"D",$amou,$amoun,$inte);                 if(sqlca.sqlcode!=-271) break;                 printw("*");                 refresh();                 delay(5l);               }              if(sqlca.sqlcode==-271)                { mess((short)73);                  p=1;                  break;                }              if(sqlca.sqlcode!=0)                {                  addstr("写");                  mess(16);                  printw("(%d), ",sqlca.sqlcode);                  p=1;                  break;                }              if(cred_type==2)                {                  $ open blot;                  $ fetch last blot into $b_num;                  $ close blot;                  $ insert into r_dem_sch                    values                    ($s_num,$a_num,$ope_date,$b_num,                     $nam,$cu_type,$amou,$amoun,$inte,$r_type);                }              else                {                  $ open blot1;                  $ fetch last blot1 into $b_num;                  $ close blot1;                  $ insert into f_dem_sch                    values                    ($s_num,$a_num,$ope_date,$b_num,                     $nam,$cu_type,$amou,$amoun,$inte,$r_type);                }              if(sqlca.sqlcode!=0)                {                  addstr("写");                  mess(18);                  printw("(%d), ",sqlca.sqlcode);                  p=1;                  break;                }               if(cred_type==2)                     $ update r_demand                       set amount=$amoun,interest=$inte,                           inte_date=$i_date,line_num=$l_num                       where sec_num=$s_num and acc_num=$a_num;               else                     $ update f_demand                       set amount=$amoun,interest=$inte,                           inte_date=$i_date,line_num=$l_num                       where sec_num=$s_num and acc_num=$a_num;               if(sqlca.sqlerrd[2]!=1)                   {                     addstr("写");                     mess(14);                     printw("(%d), ",sqlca.sqlcode);                     p=1;                     getch();                     break;                   }               move(20,20);                mess(42);               mess(4);               getch();              printf("%c%c%c%c%c%c%c%c%c",27,'[','5','i',27,'%','9',1,20);                                   printf("\n      凭证号: ");                                   prtf_inum(cr_num,7);                                   printf("\n");                                   addspacef(30);                                   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("  ");              prtf_dnum(amou,14);              prtf_dnum(amoun,14);                                   printf("\n\n");                                   addspacef(21);                                   printf("%d-%2d-%2d            ",year,month,day);                                   printf("                      ");                                   printf("       %d             ",b_num);                                   printf(" %-6s\n\f",st);              printf("%c%c%c%c",27,'[','4','i');               move(20,20);               addspace(30);               move(20,20);               mess(43);               mess(4);               getch();               printf("%c9%c%c",'%',1,24);               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<4;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)||                  (l_num[0]>=41&&l_num[0]<=50))               {                 printf("%c9%c%c",'%',1,20);                 for(i=1;i<18;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");               }                       printf("%4d.%2d.%2d   取款",year,month,day);                                   printf("(-)");                                   prtf_dnum(amou,15);                                   prtf_dnum(amoun,15);                                   printf(" %-6s\f\n",st);              printf("%c9%c%c",'%',1,20);               move(20,20);               addspace(30);               move(20,20);

⌨️ 快捷键说明

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