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

📄 dem_open1.ec

📁 这是一个使用 informix esql/c 技术开发的银行程序的部分代码。
💻 EC
字号:
/*   活期开户   */#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();long ac_num();void prt_inum();void prt_dnum();void prtf_inum();void prtf_dnum();short num_time();#include </u/ebcsav/include/begin>short n=1,flag,ti,p=0;double x;unsigned char c;char st[30];$ char s_num[2],nam[9],cu_type[2],addres[25],statu[2],l_num[2];$ long a_num,pas,cr_num,ope_date,int_date,las_date;$ double amoun;$ short cred_type;$ long cred_num,b_num;$ char ope_num[2],s_type[2],r_type[2];move(0,25);$ database saving;printw("活  期   储  蓄  开  户");s_num[0]=op.num&0x7f;s_num[1]='\0';s_type[1]='\0';r_type[0]=9;r_type[1]='\0';l_num[0]=1;l_num[1]='\0';nam[0]='\0';cu_type[0]=((op.type&1)==1)?'R':'U';cu_type[1]='\0';amoun=0.0;addres[0]='\0';statu[1]='\0';pas=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();amoun=0.0;move(3,10);addstr("帐    号: ");move(5,10);addstr("姓    名: ");move(7,10);addstr("密    码: ");move(9,10);addstr("币    种: ");if((op.type&3)==1)  {    move(9,48);    addstr("人民币");  }move(11,10);addstr("金    额: ");move(13,10);addstr("地    址: ");move(15,10);addstr("凭 证 号: ");while(1)  {    $ begin work;    p=0;    while(1)      {        switch(n)          {            case 1:move(3,20);c=readdv(&x,9);if(c==10)a_num=x;move(3,48);prt_inum(s_num[0],2);addstr("-");                        move(3,52);                        prt_inum(a_num,9);              move(5,20);              c=readst(st,8);              if(c==10) strcpy(nam,st);              move(5,20);              addspace(10);              move(5,48);              printw("%-8s",nam);              if(c==10||c==13||c==25) n=2;              else if(c==5) n=7;              else if(c==4) n=10;              break;            case 2:              move(7,20);              c=readdv(&x,7);              if(c==10) pas=x;              move(7,20);              addspace(10);              move(7,48);              printw("%d",pas);              if(c==10||c==13||c==25)                {                  if((op.type&3)==1) n=4;                  else n=3;                }              else if(c==24) n=1;              else if(c==5) n=7;              else if(c==4) n=10;              break;            case 3:              move(17,2);              if((op.type&1)==1) addstr("请选择: R-人民币");              move(18,2);              if((op.type&2)==2) printw("请选择: U-美元  J-日元  H-港元  M-德国马克  P-英镑  F-法国法郎  C-加拿大元");              move(9,20);              c=readch();              if(isprint(c)) cu_type[0]=c;              move(9,48);              flag=0;              if((op.type&1)==1&&toupper(cu_type[0])=='R')                {                  printw("%-10s","人民币");                  flag=1;                }              if((op.type&2)==2&&flag==0)                {                  switch(toupper(cu_type[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':                        printw("%-10s","加拿大元");                        flag=1;                    }                }              move(17,2);              addspace(34);              move(18,2);              addspace(76);              move(9,20);              addspace(2);              if(flag==0);              else if(c==24) n=2;              else if(c==5) n=7;              else if(c==4) n=10;              else n=4;              break;            case 4:              move(11,20);              c=readdv(&x,11);              if(c==10) amoun=x;              move(11,20);              addspace(12);              move(11,48);              prt_dnum(amoun,13);              if(c==10||c==13||c==25) n=5;              else if(c==24) n=3;              else if(c==5) n=7;              else if(c==4) n=10;              break;            case 5:              move(13,20);              c=readst(st,24);              if(c==10) strcpy(addres,st);              move(13,20);              addspace(26);              move(13,48);              printw("%-24s",addres);              if(c==10||c==13||c==25) n=6;              else if(c==24) n=4;              else if(c==5) n=7;              else if(c==4) n=10;              break;            case 6:              move(15,20);              c=readdv(&x,7);              if(c==10) cr_num=x;              move(15,20);              addspace(10);              move(15,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=7;              else if(c==4) n=10;              break;            case 7:              move(20,20);              mess(5);              c=y_n('Y','N','C');              move(20,20);              addspace(42);              if(c=='C') n=1;              else if(c=='Y')                {                  ope_num[0]=op_num;                  ope_num[1]='\0';                  if(toupper(cu_type[0])=='R')                    cred_type=2;                  else cred_type=12;                  s_type[0]=cred_type;                  move(20,20);                      {                        move(20,20);                        ope_date=int_date=las_date=year*10000+month*100+day;                        statu[0]='A';                        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(cred_type==2)                          {                            $ insert into r_demand                              values                              ($s_num,$a_num,$nam,$pas,$cu_type,$amoun,                              $addres,$cr_num,$ope_date,$int_date,$statu,                              $las_date,0,$l_num);                          }                        else                          {                            $ insert into f_demand                              values                              ($s_num,$a_num,$nam,$pas,$cu_type,$amoun,                              $addres,$cr_num,$ope_date,$int_date,$statu,                              $las_date,0,$l_num);                          }                        if(sqlca.sqlcode!=0)                          {                            addstr("写");                            mess(14);                            printw("(%d), ",sqlca.sqlcode);                            p=1;                            n=10;                          }                        else                          {                            if(cred_type==2)                              {                                $ insert into r_blot                                  values                                  (0,$ope_num,$s_num,$a_num,$nam,$s_type,                                  $cu_type,0,$cr_num,"O",$amoun,$amoun,0);                              }                            else                              {                                $ insert into f_blot                                  values                                  (0,$ope_num,$s_num,$a_num,$nam,$s_type,                                  $cu_type,0,$cr_num,"O",$amoun,$amoun,0);                              }                            if(sqlca.sqlcode!=0)                              {                                addstr("写");                                mess(16);                                printw("(%d), ",sqlca.sqlcode);                                p=1;                                n=10;                              }                            else                              {                                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,$amoun,$amoun,0,$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,$amoun,$amoun,0,$r_type);                                  }                               if(sqlca.sqlcode!=0)                                 {                                   addstr("写");                                   mess(18);                                   printw("(%d), ",sqlca.sqlcode);                                   p=1;                                   n=10;                                  }                               else                                {                                $ insert into open_acc                                  values                                  ($s_num,$s_type,$cu_type,"0",$a_num,$nam,                                  $addres,$amoun,$ope_num);                                if(sqlca.sqlcode!=0)                                  {                                    addstr("写");                                    mess(17);                                    printw("(%d), ",sqlca.sqlcode);                                    p=1;                                    n=10;                                    break;                                  }                                   move(20,20);                                   addspace(30);                                   move(20,20);                                   mess(13);                              }                           }                        }                     }                    n=10;                }              else n=10;          }        if(n==10) break;      }   if(p==1)     {      $ rollback work;     }   else     {      $ commit work;     }    move(20,46);    mess(15);    c=y_n('Y','N','N');    if(c=='N') break;    move(20,20);    addspace(56);    n=1;  }$ close database;#include </u/ebcsav/include/end>#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/readch>#include </u/ebcsav/include/readdv>#include </u/ebcsav/include/readst>#include </u/ebcsav/include/ac_num>#include </u/ebcsav/include/num_time>

⌨️ 快捷键说明

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