📄 unit_zishenrenwj.pas
字号:
end;
end;
procedure TFrm_ZiShenRenwj.Com_GclxnameChange(Sender: TObject);
begin
inherited;
Getbiaoduan;
if (com_xmname.Items.IndexOf(com_xmname.Text)>=0) and (com_zhaobiao.Items.IndexOf(com_zhaobiao.Text)>=0) then
begin
getList;
end;
end;
procedure TFrm_ZiShenRenwj.Com_xmnameChange(Sender: TObject);
begin
inherited;
Getbiaoduan;
if (com_xmname.Items.IndexOf(com_xmname.Text)>=0) and (com_zhaobiao.Items.IndexOf(com_zhaobiao.Text)>=0) then
begin
getList;
end;
end;
procedure TFrm_ZiShenRenwj.GetComItem;
var
i:integer;
begin
{ adoquery1:=tadoquery.Create(nil);
try
adoquery1.Close;
adoquery1.Connection:=datamodule1.ADOMainConn;
adoquery1.SQL.Clear;
adoquery1.SQL.Text:='select d.dw_name from bid_xmsqr c,bid_danwei_xinxi d where c.dw_id=d.dw_id and d.dw_id not in (select a.dw_id '
+' from bid_wenjian2 a ,bid_xmgczb b where A.WJ2_LEIXING=1 AND a.xmgczb_id= b.xmgczb_id and b.xm_isbn='''
+trim(xmbdgc.XM_ISBn)+''' and b.gclx_id='+xmbdgc.gCLX_ID
+' and b.zblx_id='+xmbdgc.BDLX_ID+') and dw_name like '''+'%'+trim(combobox2.text)+'%'''
+' and c.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+')' ;
adoquery1.open;
adoquery1.First;
combobox2.Items.Clear;
for i:=0 to adoquery1.RecordCount-1 do
begin
combobox2.Items.Add(adoquery1.fieldbyname('dw_name').AsString);
adoquery1.Next;
end;
finally
freeandnil(adoquery1);
end;}
end;
procedure TFrm_ZiShenRenwj.BitBtn2Click(Sender: TObject);
begin
if assigned(frm_zishenr) then
else
frm_zishenr:=tfrm_zishenr.Create(nil);
frm_zishenr.Show;
end;
procedure TFrm_ZiShenRenwj.BitBtn6Click(Sender: TObject);
var
ni:tlistitem;
begin
inherited;
{ if trim(listview1.Selected.Caption)='' then exit;
datamodule1.ADOMainConn.BeginTrans;
try
adoquery1.Close;
adoquery1.SQL.Text:='delete from bid_wenjian2 where dwbm_id='+trim(listview1.Selected.Caption)+' 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+')'
+';'
+' delete from bid_fhx from bid_fhx a,bid_wenjian2 b where a.dw_id=b.dw_id and b.dwbm_id='+trim(listview1.Selected.Caption)
+' and a.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+')'
+';'
+' delete from bid_qzx from bid_qzx a,bid_wenjian2 b where a.dw_id=b.dw_id and b.dwbm_id='+trim(listview1.Selected.Caption)
+' and a.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+')'
+' delete from bid_yushen_defen from bid_yushen_defen a,bid_wenjian2 b where a.dw_id=b.dw_id and b.dwbm_id='
+trim(listview1.Selected.Caption)+' and a.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+')' ;
adoquery1.ExecSQL;
datamodule1.ADOMainConn.CommitTrans;
getlist;
except
datamodule1.ADOMainConn.RollbackTrans;
end;}
end;
procedure TFrm_ZiShenRenwj.ComboBox2KeyPress(Sender: TObject;
var Key: Char);
var
i:Integer;
begin
inherited;
if Key=#13 then
begin
GetComItem;
dropdown:=1;
end;
end;
procedure TFrm_ZiShenRenwj.ComboBox2DropDown(Sender: TObject);
begin
inherited;
GetComItem;
end;
procedure TFrm_ZiShenRenwj.ComboBox2KeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
inherited;
if dropdown=1 then combobox2.DroppedDown:=true;
dropdown:=0;
end;
procedure TFrm_ZiShenRenwj.FormCreate(Sender: TObject);
begin
GetItems(com_xmname,com_zhaobiao,com_gclxname,1);
inherited;
dropdown:=0;
caption:='资审文件管理';
panel2.Caption:='资审文件管理';
getList;
Getbiaoduan;
end;
procedure TFrm_ZiShenRenwj.BitBtn5Click(Sender: TObject);
var
adoquery:tadoquery;
maxdwbm:string;
begin
inherited;
{ adoquery:=tadoquery.Create(nil);
try
adoquery.Close;
adoquery.Connection:=datamodule1.ADOMainConn;
datamodule1.ADOMainConn.BeginTrans;
try
adoquery.SQL.Clear;
adoquery.SQL.Text:='select max(dwbm_id) as dwbm_id from bid_wenjian2 a,bid_xmgczb b where a.xmgczb_id= b.xmgczb_id and b.xm_isbn='''
+trim(xmbdgc.XM_ISBn)+''' and b.gclx_id='+xmbdgc.gCLX_ID
+' and b.zblx_id='+xmbdgc.BDLX_ID;
adoquery.Open;
maxdwbm:=adoquery.fieldbyname('dwbm_id').AsString;
maxdwbm:=inttostr(strtoint(maxdwbm)+1);
adoquery.SQL.clear;
adoquery.SQL.text:='insert into bid_wenjian2(dwbm_id,WJ2_SHOWNAME,dw_id,wj2_leibie,wj2_qzx,wj2_fhx,wj2_leixing,xmgczb_id,wj2_miaoshu) select '
+trim(maxdwbm)+','''+trim(edt_NAME.text)+''',a.dw_id,'+trim(inttostr(combobox1.Items.IndexOf(combobox1.text)))
+',1,1,1,xmgczb_id,'''+trim(memo2.Text)+''' from bid_danwei_xinxi A,bid_xmgczb b where dw_name='''
+trim(combobox2.Text)+''' and b.xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and b.gclx_id='+xmbdgc.gCLX_ID
+' and b.zblx_id='+xmbdgc.BDLX_ID
+';'
+' insert into bid_fhx(dw_leibie,dw_id,xmgczb_id) select '+trim(inttostr(combobox1.Items.IndexOf(combobox1.text)))
+' ,a.dw_id,b.xmgczb_id from '
+' bid_danwei_xinxi A,bid_xmgczb b where dw_name='''
+trim(combobox2.Text)+''' and b.xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and b.gclx_id='+xmbdgc.gCLX_ID
+' and b.zblx_id='+xmbdgc.BDLX_ID
+' insert into bid_qzx(dw_leibie,dw_id,xmgczb_id) select '+trim(inttostr(combobox1.Items.IndexOf(combobox1.text)))
+',a.dw_id,b.xmgczb_id from '
+' bid_danwei_xinxi A,bid_xmgczb b where dw_name='''
+trim(combobox2.Text)+''' and b.xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and b.gclx_id='+xmbdgc.gCLX_ID
+' and b.zblx_id='+xmbdgc.BDLX_ID
+' insert into bid_yushen_defen(dw_ID,xmgczb_id) select a.dw_id,b.xmgczb_id from '
+' bid_danwei_xinxi A,bid_xmgczb b where dw_name='''
+trim(combobox2.Text)+''' and b.xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and b.gclx_id='+xmbdgc.gCLX_ID
+' and b.zblx_id='+xmbdgc.BDLX_ID;
adoquery.ExecSQL;
getList;
combobox2.text:='';
datamodule1.ADOMainConn.CommitTrans
except
datamodule1.ADOMainConn.RollbackTrans;
end;
finally
freeandnil(adoquery);
end; }
end;
procedure TFrm_ZiShenRenwj.ListView1SelectItem(Sender: TObject;
Item: TListItem; Selected: Boolean);
begin
{inherited;
IF Selected=TRUE THEN
begin
edt_dwname.Text:=listview1.Selected.caption;
edt_wdname.text:=listview1.Selected.SubItems[0];
if com_zhaobiao.text='施工' then
begin
if (listview1.Selected.SubItems[1]='') or(listview1.Selected.SubItems[1]='0') then
com_leibie.ItemIndex:=0
else
com_leibie.ItemIndex:=strtoint(listview1.Selected.SubItems[1]);
end;
if com_zhaobiao.text='监理' then
com_leibie.text:=listview1.Selected.SubItems[1];
end;}
end;
procedure TFrm_ZiShenRenwj.Button2Click(Sender: TObject);
begin
inherited;
if trim(listview1.Selected.Caption)='' then exit;
datamodule1.ADOMainConn.BeginTrans;
try
adoquery1.Close;
adoquery1.SQL.Text:='delete from bid_wenjian2 where wj2_leixing=1 and dw_id in (select dw_Id from bid_danwei_xinxi '
+' where dw_name='''+trim(listview1.Selected.Caption)+''')'
+' 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+')'
+';'
+' delete from bid_fhx from bid_fhx where dw_id in (select dw_Id from bid_danwei_xinxi '
+' where dw_name='''+trim(listview1.Selected.Caption)+''')'
//+' and b.dwbm_id='+trim(listview1.Selected.Caption)
+' 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+')'
+';'
+' delete from bid_qzx from bid_qzx where dw_id in (select dw_Id from bid_danwei_xinxi '
+' where dw_name='''+trim(listview1.Selected.Caption)+''')'// a.dw_id=b.dw_id and b.dwbm_id='+trim(listview1.Selected.Caption)
+' 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+')'
+' delete from bid_yushen_defen from bid_yushen_defen where dw_id in (select dw_Id from bid_danwei_xinxi '
+' where dw_name='''+trim(listview1.Selected.Caption)+''') 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+')' ;
adoquery1.ExecSQL;
datamodule1.ADOMainConn.CommitTrans;
getlist;
except
datamodule1.ADOMainConn.RollbackTrans;
end;
end;
procedure TFrm_ZiShenRenwj.Button3Click(Sender: TObject);
var
adoquery:tadoquery;
maxdwbm:string;
begin
inherited;
adoquery:=tadoquery.Create(nil);
try
adoquery.Connection:=datamodule1.ADOMainConn;
datamodule1.ADOMainConn.BeginTrans;
try
adoquery.SQL.Clear;
adoquery.SQL.Text:='select max(dwbm_id) as dwbm_id from bid_wenjian2 a,bid_xmgczb b where a.xmgczb_id= b.xmgczb_id '
+' and a.WJ2_leixing=1 and b.xm_isbn='''
+trim(xmbdgc.XM_ISBn)+''' and b.gclx_id='+xmbdgc.gCLX_ID
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -