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

📄 unit_yezhubd.pas

📁 招投标软件代码,很有应用价值,请大家参考下哦,不明白的地方给我留言
💻 PAS
📖 第 1 页 / 共 2 页
字号:
begin
  nowrow:=cell1.GetCurrentRow;
  nowcol:=cell1.GetCurrentCol;
  nowpage:=cell1.GetCurSheet;
  icol:=nowcol+nowpage*20;
  if (nowrow<5) or ((nowrow<10) and (nowrow>7)) or (nowcol=1) then exit;
  if (nowrow>=5) and (nowrow<=6) then
  begin
    if (trim(cell1.GetCellString(nowcol,nowrow,nowpage))='') or (trim(cell1.GetCellString(nowcol,4,nowpage))='') then exit;
    adoquery:=tadoquery.Create(nil);
    try
      adoquery.Close;
      adoquery.Connection:=datamodule1.ADOMainConn;
      datamodule1.ADOMainConn.BeginTrans;
      try
        adoquery.SQL.Text:=' if (select count(*) from bid_biaoduan_xishu where bd_isbn in (select bd_isbn from '
               +' bid_biaoduan_xinxi where  xmgczb_id=bid_biaoduan_xinxi.xmgczb_id and xmgczb_id in (select xmgczb_id from bid_xmgczb '
              +' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID
              +' and zblx_id='+xmbdgc.BDLX_ID+') and bd_bianhao='
               +trim(inttostr(icol-1))+'))>0  begin';
        if nowrow=5 then
          adoquery.sql.text:=adoquery.SQL.Text+' update bid_biaoduan_xishu set bd_biaodicsz='''+cell1.GetCellString(nowcol,nowrow,nowpage)
              +''' where  bd_isbn in (select bd_isbn from bid_biaoduan_xinxi where '
              +' xmgczb_id=bid_biaoduan_xinxi.xmgczb_id and xmgczb_id in (select xmgczb_id from bid_xmgczb '
              +' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID
              +' and zblx_id='+xmbdgc.BDLX_ID+') and bd_bianhao='+trim(inttostr(icol-1))+')'
              +' end else begin '
              +' insert into bid_biaoduan_xishu(bd_isbn,bd_biaodicsz) select bd_isbn,'''+cell1.GetCellString(nowcol,nowrow,nowpage)
              +''' from bid_biaoduan_xinxi where xmgczb_id in (select xmgczb_id from bid_xmgczb '
              +' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID
              +' and zblx_id='+xmbdgc.BDLX_ID+') and  bd_bianhao='+trim(inttostr(icol-1))+' end '  ;
        if nowrow=6 then
          adoquery.sql.text:=adoquery.SQL.Text+' update bid_biaoduan_xishu set bd_xishu='''+cell1.GetCellString(nowcol,nowrow,nowpage)
              +''' where bd_isbn in (select bd_isbn from bid_biaoduan_xinxi where '
              +' xmgczb_id=bid_biaoduan_xinxi.xmgczb_id and xmgczb_id in (select xmgczb_id from bid_xmgczb '
              +' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID
              +' and zblx_id='+xmbdgc.BDLX_ID+') and bd_bianhao='+trim(inttostr(icol-1))+')'
              +' end else begin '
              +' insert into bid_biaoduan_xishu(bd_isbn,bd_xishu) select bd_isbn,'''+cell1.GetCellString(nowcol,nowrow,nowpage)
              +''' from bid_biaoduan_xinxi where xmgczb_id in (select xmgczb_id from bid_xmgczb '
              +' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID
              +' and zblx_id='+xmbdgc.BDLX_ID+') and  bd_bianhao='+trim(inttostr(icol-1))+' end '    ;
        adoquery.ExecSQL;
        datamodule1.ADOMainConn.CommitTrans;
        if cell1.GetCellString(nowcol,5,nowpage)='' then bdcsz:=0
        else  bdcsz:=strtofloat(format('%.4f',[STRtofloat(cell1.GetCellString(nowcol,5,nowpage))]));
        if cell1.GetCellString(nowcol,6,nowpage)='' then xishu:=0
        else  xishu:=strtofloat(format('%.4f',[STRtofloat(cell1.GetCellString(nowcol,6,nowpage))]));
        biaodi:=strtofloat(format('%.4f',[bdcsz*(100+xishu)/100]));
        cell1.SetCellDouble(nowcol,7,nowpage,biaodi);
      except
        datamodule1.ADOMainConn.RollbackTrans;
      end;
      datamodule1.ADOMainConn.BeginTrans;
      try
        adoquery.Close;
        adoquery.SQL.Text:=' update bid_biaoduan_xinxi set BD_BIAODI='''+floattostr(biaodi)
              +''' where xmgczb_id in (select xmgczb_id from bid_xmgczb '
              +' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID
              +' and zblx_id='+xmbdgc.BDLX_ID+') and  bd_bianhao='+trim(inttostr(icol-1));
        adoquery.ExecSQL;
        datamodule1.ADOMainConn.CommitTrans;
      except
        datamodule1.ADOMainConn.RollbackTrans;
      end;
    finally
      freeandnil(adoquery);
    end;
  end;
  if (nowrow>=10) and (nowrow<=11) then
  begin
    if (trim(cell1.GetCellString(nowcol,nowrow,nowpage))='') or (trim(cell1.GetCellString(nowcol,9,nowpage))='') then exit;
    adoquery:=tadoquery.Create(nil);
    try
      adoquery.Close;
      adoquery.Connection:=datamodule1.ADOMainConn;
      datamodule1.ADOMainConn.begintrans;
      try
        adoquery.SQL.Text:=' if (select count(*) from bid_biaoduan_xishu where bd_isbn in (select bd_isbn from '
               +' bid_biaoduan_xinxi where  xmgczb_id=bid_biaoduan_xinxi.xmgczb_id and xmgczb_id in (select xmgczb_id from bid_xmgczb '
              +' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID
              +' and zblx_id='+xmbdgc.BDLX_ID+') and bd_bianhao='
               +trim(inttostr(icol+9))+'))>0  begin';
        if nowrow=10 then
          adoquery.sql.text:=adoquery.SQL.Text+' update bid_biaoduan_xishu set bd_biaodicsz='''+cell1.GetCellString(nowcol,nowrow,nowpage)
              +''' where  bd_isbn in (select bd_isbn from bid_biaoduan_xinxi where '
              +' xmgczb_id=bid_biaoduan_xinxi.xmgczb_id and bd_bianhao='+trim(inttostr(icol+9))+')'
              +' end else begin '
              +' insert into bid_biaoduan_xishu(bd_isbn,bd_biaodicsz) select bd_isbn,'''+cell1.GetCellString(nowcol,nowrow,nowpage)
              +''' from bid_biaoduan_xinxi where xmgczb_id in (select xmgczb_id from bid_xmgczb '
              +' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID
              +' and zblx_id='+xmbdgc.BDLX_ID+') and  bd_bianhao='+trim(inttostr(icol+9))+' end '  ;
        if nowrow=11 then
          adoquery.sql.text:=adoquery.SQL.Text+' update bid_biaoduan_xishu set bd_xishu='''+cell1.GetCellString(nowcol,nowrow,nowpage)
              +''' where bd_isbn in (select bd_isbn from bid_biaoduan_xinxi where '
              +' xmgczb_id=bid_biaoduan_xinxi.xmgczb_id and bd_bianhao='+trim(inttostr(icol+9))+')'
              +' end else begin '
              +' insert into bid_biaoduan_xishu(bd_isbn,bd_xishu) select bd_isbn,'''+cell1.GetCellString(nowcol,nowrow,nowpage)
              +''' from bid_biaoduan_xinxi where xmgczb_id in (select xmgczb_id from bid_xmgczb '
              +' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID
              +' and zblx_id='+xmbdgc.BDLX_ID+') and  bd_bianhao='+trim(inttostr(icol+9))+' end '    ;
        adoquery.ExecSQL;
        datamodule1.ADOMainConn.CommitTrans;
        if cell1.GetCellString(nowcol,10,nowpage)='' then bdcsz:=0
        else  bdcsz:=strtofloat(format('%.4f',[STRtofloat(cell1.GetCellString(nowcol,10,nowpage))]));
        if cell1.GetCellString(nowcol,11,nowpage)='' then xishu:=0
        else  xishu:=strtofloat(format('%.4f',[STRtofloat(cell1.GetCellString(nowcol,11,nowpage))]));
        biaodi:=strtofloat(format('%.4f',[bdcsz*(100+xishu)/100]));
        cell1.SetCellDouble(nowcol,12,0,biaodi);
      except
        datamodule1.ADOMainConn.RollbackTrans;
      end;
      datamodule1.ADOMainConn.BeginTrans;
      try
        adoquery.Close;
        adoquery.SQL.Text:=' update bid_biaoduan_xinxi set BD_BIAODI='''+floattostr(biaodi)
              +''' where xmgczb_id in (select xmgczb_id from bid_xmgczb '
              +' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID
              +' and zblx_id='+xmbdgc.BDLX_ID+') and  bd_bianhao='+trim(inttostr(icol+9));
        adoquery.ExecSQL;
        datamodule1.ADOMainConn.CommitTrans;
      except
        datamodule1.ADOMainConn.RollbackTrans;
      end;
    finally
      freeandnil(adoquery);
    end;
  end;
end;

procedure TFrm_yezhubd.Com_xmnameChange(Sender:TObject);
begin
   inherited;
   if (Com_zhaoBiao.Items.IndexOf(Com_zhaoBiao.text)<0)
      or (Com_Gclxname.Items.IndexOf(Com_Gclxname.text)<0) then exit;
   ChooseLoadFile;
end;

procedure TFrm_yezhubd.Com_zhaoBiaoChange(Sender:Tobject);
begin
   inherited;
   if (com_xmname.Items.IndexOf(com_xmname.text)<0)
      or (Com_Gclxname.Items.IndexOf(Com_Gclxname.text)<0) then exit;
   ChooseLoadFile;
end;


procedure TFrm_yezhubd.Com_GclxnameChange(Sender: TObject);
begin
   inherited;
   if (com_xmname.Items.IndexOf(com_xmname.text)<0)
      or (Com_zhaoBiao.Items.IndexOf(Com_zhaoBiao.text)<0) then exit;
   ChooseLoadFile;
end;

procedure TFrm_yezhubd.FormCreate(Sender: TObject);
begin
  GetItems(com_xmname,com_zhaobiao,com_gclxname,1);
  inherited;
  panel2.Caption:='业主标底';
  caption:='业主标底';
  cell1.OnEditFinish:=cell1editfinish;
  bb_reflash.Visible:=true;
  bb_reflash.OnClick:=bb_reflashClick;
  bitbtn2.OnClick:=BitBtn2Click;
  chooseloadfile;
end;

procedure TFrm_yezhubd.bb_reflashClick(Sender: TObject);
begin
  ChooseLoadFile;
end;

procedure TFrm_yezhubd.BitBtn2Click(Sender:TObject);
begin
  inherited;
  if bOpen=true then exit;
  cell1.SaveFile(GetFilePath+'yzbd.cll',1);
end;

end.

⌨️ 快捷键说明

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