unit_xiangxi.pas
来自「招投标软件代码,很有应用价值,请大家参考下哦,不明白的地方给我留言」· PAS 代码 · 共 1,646 行 · 第 1/5 页
PAS
1,646 行
if strtofloat(edt_zyzj.Text)<(strtofloat(edt_gsz.Text)*0.25) then
a:=0
else a:=2;
b:=(10*strtofloat(edt_xd.Text))/strtofloat(edt_gsz.Text);
if b<1 then
begin
edt_zjnl.Text:=floattostr(a+0);
exit;
end;
if b<1.5 then
begin
edt_zjnl.Text:=floattostr(a+1);
exit;
end;
if b<2 then
begin
edt_zjnl.Text:=floattostr(a+2);
exit;
end;
if b<2.5 then
begin
edt_zjnl.Text:=floattostr(a+3);
exit;
end;
if b>=2.5 then
begin
edt_zjnl.Text:=floattostr(a+4);
exit;
end;
end;
procedure tfrm_xiangxi.gettbnl;
var
N:real;
begin
N:=(strtofloat(edt_jzc.Text)*5)-(strtofloat(edt_syjz.Text)*0.3);
n:=(10*n)/(strtofloat(edt_gsz.Text));
if n<2 then
begin
edt_tbnl.text:='0';
exit;
end;
if n<4 then
begin
edt_tbnl.text:='2';
exit;
end;
if n<6 then
begin
edt_tbnl.text:='3';
exit;
end;
if n<8 then
begin
edt_tbnl.text:='4';
exit;
end;
if n<10 then
begin
edt_tbnl.text:='5';
exit;
end;
if n>=10 then
begin
edt_tbnl.text:='6';
exit;
end;
end;
procedure tfrm_xiangxi.getcaiwu;
begin
edt_caiwu.Text:=inttostr(strtoint(trim(edt_cwnl.Text))+strtoint(trim(edt_tbnl.Text))
+strtoint(trim(edt_zjnl.Text)));
end;
procedure TFrm_Xiangxi.Edt_tExit(Sender: TObject);
begin
if trim(edt_t.Text)='' then
begin
edt_cwnl.Text:='';
edt_caiwu.Text:='';
exit;
end;
if (trim(edt_w.Text)='') or (trim(edt_gsz.Text)='') then exit;
GetCwnl;
end;
procedure TFrm_Xiangxi.Edt_jzcExit(Sender: TObject);
begin
if trim(edt_jzc.Text)='' then
begin
edt_tbnl.Text:='';
edt_caiwu.Text:='';
exit;
end;
if (trim(edt_syjz.Text)='') or (trim(edt_gsz.Text)='') then exit;
gettbnl;
if (trim(edt_zjnl.Text)='') or (trim(edt_tbnl.Text)='') or (trim(edt_cwnl.Text)='') then exit;
getcaiwu;
end;
procedure TFrm_Xiangxi.Edt_syjzExit(Sender: TObject);
begin
if trim(edt_syjz.Text)='' then
begin
edt_tbnl.Text:='';
edt_caiwu.Text:='';
exit;
end;
if (trim(edt_jzc.Text)='') or (trim(edt_gsz.Text)='') then exit;
gettbnl;
if (trim(edt_zjnl.Text)='') or (trim(edt_tbnl.Text)='') or (trim(edt_cwnl.Text)='') then exit;
getcaiwu;
end;
procedure TFrm_Xiangxi.Edt_gszExit(Sender: TObject);
begin
if trim(edt_gsz.Text)='' then
begin
edt_cwnl.Text:='';
edt_tbnl.Text:='';
edt_zjnl.Text:='';
edt_caiwu.Text:='';
exit;
end;
if (trim(edt_w.Text)<>'') and (trim(edt_t.Text)<>'') then
begin
getcwnl;
end;
if (trim(edt_jzc.Text)<>'') and (trim(edt_syjz.Text)<>'') then
begin
gettbnl;
end;
if (trim(edt_zyzj.Text)<>'') and (trim(edt_xd.Text)='') then
getzjnl;
if (trim(edt_zjnl.Text)='') or (trim(edt_tbnl.Text)='') or (trim(edt_cwnl.Text)='') then exit;
getcaiwu;;
end;
procedure TFrm_Xiangxi.Edt_xdExit(Sender: TObject);
begin
if trim(edt_xd.Text)='' then
begin
edt_tbnl.Text:='';
edt_caiwu.Text:='';
exit;
end;
if (trim(edt_gsz.Text)<>'') and (trim(Edt_zyzj.Text)<>'') then
begin
getzjnl;
end else exit;
if (trim(edt_zjnl.Text)='') or (trim(edt_tbnl.Text)='') or (trim(edt_cwnl.Text)='') then exit;
getcaiwu;
end;
procedure TFrm_Xiangxi.Edt_zyzjExit(Sender: TObject);
begin
if trim(edt_zyzj.Text)='' then
begin
edt_zjnl.Text:='';
edt_caiwu.Text:='';
exit;
end;
if (trim(edt_xd.Text)='') or (trim(edt_gsz.Text)='') then exit;
getzjnl;
if (trim(edt_zjnl.Text)='') or (trim(edt_tbnl.Text)='') or (trim(edt_cwnl.Text)='') then exit;
getcaiwu;
end;
procedure TFrm_Xiangxi.BitBtn1Click(Sender: TObject);
var
adoquery:tadoquery;
s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12:string;
begin
SaveSource;
//下面代码加在了SaveSource中
{ if trim(combobox1.Text)='' then exit;
adoquery:=tadoquery.Create(nil);
try
adoquery.Connection:=datamodule1.ADOMainConn;
adoquery.Close;
datamodule1.ADOMainConn.BeginTrans;
try
if pagecontrol1.ActivePageIndex=0 then
begin
if (trim(edt_t.Text)='') or (trim(edt_w.Text)='') or (trim(edt_t.Text)='') or
(trim(edt_gsz.Text)='') or (trim(edt_zyzj.Text)='') or (trim(edt_syjz.Text)='')
or (trim(edt_xd.Text)='') then
begin
showmessage('输入信息不完整');
datamodule1.ADOMainConn.RollbackTrans;
freeandnil(adoquery);
exit;
end;
adoquery.SQL.Text:='update bid_yushen_defen set ys_cw_cwsr='+trim(edt_w.Text)+',ys_cw_jzc='
+trim(edt_jzc.Text)+',ys_cw_wcgq='+trim(edt_t.Text)+',ys_cw_gsz='+trim(edt_gsz.Text)
+',ys_cw_zyzj='+trim(edt_zyzj.Text)+',ys_cw_syjz='+trim(edt_syjz.Text)
+',ys_cw_xdnl='+trim(edt_xd.Text)+',ys_caiwu='+trim(edt_caiwu.Text)
+',ys_caiwu_ms='''+trim(memo1.Text)+'''' //财务描述
+' from bid_yushen_defen a,bid_danwei_xinxi b,bid_xmgczb c where a.dw_id=b.dw_id '
+' and b.dw_name='''+trim(combobox1.Text)+''' and c.xm_isbn='''+trim(xmbdgc.XM_ISBn)
+''' and c.gclx_id='+xmbdgc.gCLX_ID+' and c.zblx_id='+xmbdgc.BDLX_ID+' and a.xmgczb_id=c.xmgczb_id';
end;
if pagecontrol1.ActivePageIndex=1 then
begin
if ((not RadioButton2.Checked) and (not RadioButton1.Checked)) or ((not RadioButton7.Checked) and (not RadioButton8.Checked))
or (trim(edit7.Text)='') or (trim(edit8.Text)='') or (trim(edit9.Text)='') or (trim(edit10.Text)='') or
(trim(edit11.Text)='') or ((not RadioButton9.Checked) and (not RadioButton10.Checked) and (not RadioButton11.Checked))
or ((not RadioButton21.Checked) and (not RadioButton22.Checked)) then
begin
showmessage('输入信息不完整');
datamodule1.ADOMainConn.RollbackTrans;
freeandnil(adoquery);
exit;
end;
if RadioButton1.Checked then s1:='1';
if RadioButton2.Checked then s1:='3';
if RadioButton7.Checked then s2:='1';
if radiobutton8.Checked then s2:='2';
if not checkbox1.Checked then s3:='1';
if checkbox1.Checked then s3:='0';
if not checkbox2.Checked then s4:='1';
if checkbox2.Checked then s4:='0';
if not checkbox3.Checked then s5:='1';
if checkbox3.Checked then s5:='0';
if not checkbox4.Checked then s6:='1';
if checkbox4.Checked then s6:='0';
if not checkbox5.Checked then s7:='1';
if checkbox5.Checked then s7:='0';
if not checkbox6.Checked then s8:='1';
if checkbox6.Checked then s8:='0';
if not checkbox7.Checked then s9:='1';
if checkbox7.Checked then s9:='0';
if not checkbox8.Checked then s10:='1';
if checkbox8.Checked then s10:='0';
if RadioButton9.Checked then s11:='1';
if RadioButton10.Checked then s11:='2';
if RadioButton11.Checked then s11:='3';
if RadioButton21.Checked then s12:='1';
if RadioButton22.Checked then s12:='2';
adoquery.SQL.Text:=' update bid_yushen_defen set ys_js_jg='+trim(s1)+',ys_js_dw='+trim(s2)
+',ys_js_jlqzx='+trim(s3)+',ys_js_jlcishu='+trim(edit7.Text)+',ys_js_jl='
+trim(s4)+',ys_gcs_jlqzx='+trim(s5)+',ys_gcs_jlcishu='+trim(edit8.Text)
+',ys_gcs_jl='+trim(s6)+',ys_js_qtqzx='+trim(s7)+',ys_js_qtgjzc='+trim(edit9.Text)
+',ys_js_qtgcs='+trim(edit10.Text)+',ys_sb_qzx='+trim(s10)+',ys_sb_sl='+trim(edit11.Text)
+',ys_sbqzx='+trim(s8)+',ys_sbfhx='+trim(s9)+', ys_sb_nx='+trim(s11)+',ys_sb_ly='+trim(s12)
+',ys_jishu_ms='''+trim(memo2.Text)+'''' //技术描述
+',ys_jishu='+trim(edt_jishu.Text)+' from bid_yushen_defen a,bid_danwei_xinxi b,bid_xmgczb c where a.dw_id=b.dw_id '
+' and b.dw_name='''+trim(combobox1.Text)+''' and c.xm_isbn='''+trim(xmbdgc.XM_ISBn)
+''' and c.gclx_id='+xmbdgc.gCLX_ID+' and c.zblx_id='+xmbdgc.BDLX_ID+' and a.xmgczb_id=c.xmgczb_id';
end;
if pagecontrol1.ActivePageIndex=2 then
begin
if (trim(edit1.text)='') or (trim(edit2.text)='') or (trim(edit3.text)='') or (trim(edit4.text)='')
or ((not RadioButton5.Checked) and (not RadioButton6.Checked)) then
begin
showmessage('输入信息不完整');
datamodule1.ADOMainConn.RollbackTrans;
freeandnil(adoquery);
exit;
end;
if CheckBox9.Checked then s1:='2'
else s1:='0';
{if checkbox10.Checked then s2:='1'
else s2:='0';
if RadioButton4.Checked then s2:='2';
if radiobutton3.Checked then s2:='3';
if RadioButton5.Checked then s3:='1';
if RadioButton6.Checked then s3:='2';
adoquery.SQL.Text:=' update bid_yushen_defen set ys_jy_htd='+trim(edit3.Text)+',ys_jy_ylp='
+trim(edit2.Text)+',ys_jy_lshtd='+trim(edit1.Text)+',ys_jy_yl='+trim(edit4.Text)
+',ys_jy_sbj='+trim(s1)+',ys_jy_jiang='+trim(s2)+',ys_jy_qydj='+trim(s3)+',ys_jingyan='+trim(edit16.text)
+',ys_jingyan_ms='''+trim(memo3.Text)+'''' //经验描述
+' from bid_yushen_defen a,bid_danwei_xinxi b,bid_xmgczb c where a.dw_id=b.dw_id '
+' and b.dw_name='''+trim(combobox1.Text)+''' and c.xm_isbn='''+trim(xmbdgc.XM_ISBn)
+''' and c.gclx_id='+xmbdgc.gCLX_ID+' and c.zblx_id='+xmbdgc.BDLX_ID+' and a.xmgczb_id=c.xmgczb_id';
end;
adoquery.ExecSQL;
datamodule1.ADOMainConn.CommitTrans;
except
datamodule1.ADOMainConn.RollbackTrans;
end;
finally
FreeAndNil(adoquery);
end; }
end;
procedure TFRM_XIANGXI.GetInfro(SENDER:TOBJECT);
var
adoquery:tadoquery;
begin
adoquery:=tadoquery.Create(nil);
try
adoquery.Connection:=datamodule1.ADOMainConn;
adoquery.Close;
adoquery.SQL.Text:='select dwbm_id from bid_wenjian2 where wj2_leixing=1 and dw_id in (select dw_id from bid_danwei_xinxi '
+' where dw_name='''+trim(combobox1.Text)+''') 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+')';
adoquery.Open;
edit5.Text:=adoquery.fieldbyname('dwbm_Id').AsString;
adoquery.Close;
IF com_zhaobiao.Text='施工' then
begin
adoquery.SQL.Text:='select * from bid_yushen_defen a,bid_danwei_xinxi b,bid_xmgczb c where a.dw_id=b.dw_id '
+' and b.dw_name='''+trim(combobox1.Text)+''' and c.xm_isbn='''+trim(xmbdgc.XM_ISBn)
+''' and c.gclx_id='+xmbdgc.gCLX_ID+' and c.zblx_id='+xmbdgc.BDLX_ID
+' and a.xmgczb_id=c.xmgczb_id and bd_leibie='+getleibie(combobox2.text);
adoquery.Open;
//加载第一页信息
edt_w.Text:=adoquery.fieldbyname('ys_cw_cwsr').AsString;
edt_jzc.Text:=adoquery.fieldbyname('ys_cw_jzc').AsString;
edt_t.Text:=adoquery.fieldbyname('ys_cw_wcgq').AsString;
edt_gsz.Text:=adoquery.fieldbyname('ys_cw_gsz').AsString;
edt_zyzj.Text:=adoquery.fieldbyname('ys_cw_zyzj').AsString;
edt_syjz.Text:=adoquery.fieldbyname('ys_cw_syjz').AsString;
edt_xd.Text:=adoquery.fieldbyname('ys_cw_xdnl').AsString;
memo1.Text:=adoquery.fieldbyname('ys_caiwu_ms').AsString;
//加载第二页信息
if adoquery.fieldbyname('ys_js_jg').AsInteger=3 then RadioButton1.Checked:=true
else if adoquery.fieldbyname('ys_js_jg').AsInteger=1 then RadioButton2.Checked:=true
else
begin
RadioButton1.Checked:=false;
RadioButton2.Checked:=false;
end;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?