unit u_op_open_all; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB,ADODB,bsSkinCtrls, BusinessSkinForm; type Tfrm_op_open_all = class(TForm) bsBusinessSkinForm1: TbsBusinessSkinForm; bsSkinCheckRadioBox1: TbsSkinCheckRadioBox; bsSkinCheckRadioBox2: TbsSkinCheckRadioBox; bsSkinCheckRadioBox3: TbsSkinCheckRadioBox; bsSkinButton1: TbsSkinButton; bsSkinButton5: TbsSkinButton; yewu: TDataSource; accept: TDataSource; pay: TDataSource; procedure bsSkinButton5Click(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure select_open_all(); procedure select_open_op(); procedure select_open_fee(); private { Private declarations } public { Public declarations } end; var frm_op_open_all: Tfrm_op_open_all; implementation uses my_sys_chat, my_sys_function; {$R *.dfm} procedure Tfrm_op_open_all.select_open_all(); var bookmark:tbookmark; begin bookmark:=yewu.dataset.GetBookmark; try yewu.DataSet.First; while not yewu.DataSet.eof do begin if yewu.DataSet.fieldbyname('业务状态').asstring='业务封帐' then begin yewu.DataSet.edit; yewu.DataSet['业务状态']:='接受委托'; yewu.DataSet.post; CloseOpenLog(yewu.DataSet.FieldByName('编号').AsString,yewu.DataSet.FieldByName('业务状态').asstring,''); end; if (yewu.DataSet.fieldbyname('费用状态').asstring='费用封帐') and(yewu.DataSet.fieldbyname('财务').asboolean=false) then begin if yewu.DataSet.FieldByName('会计期间').AsDateTime<=Logininfo.endday then begin MessageDlg('此会计期间已经月末结账,不能解封!',mtWarning,[mbok],0); end else begin yewu.DataSet.edit; if Trim(yewu.DataSet.fieldbyname('费用封帐前状态').asstring)<>'' then yewu.DataSet['费用状态']:=yewu.DataSet.fieldbyname('费用封帐前状态').asstring else yewu.DataSet['费用状态']:='录入状态'; yewu.DataSet['费用封帐日期']:=null; yewu.DataSet['审核人']:=''; yewu.DataSet['审核日期']:=null; yewu.DataSet.post; CloseOpenLog(yewu.DataSet.FieldByName('编号').AsString,'',yewu.DataSet.FieldByName('费用状态').asstring); end; end; yewu.DataSet.next; end; finally TAdoQuery(yewu.DataSet).requery; yewu.DataSet.GotoBookmark(bookmark); end; end; procedure Tfrm_op_open_all.select_open_op(); var bookmark:tbookmark; begin bookmark:=yewu.dataset.GetBookmark; try yewu.DataSet.First; while not yewu.DataSet.eof do begin if yewu.DataSet.fieldbyname('业务状态').asstring='业务封帐' then begin yewu.DataSet.edit; yewu.DataSet['业务状态']:='接受委托'; yewu.DataSet.post; CloseOpenLog(yewu.DataSet.FieldByName('编号').AsString,yewu.DataSet.FieldByName('业务状态').asstring,''); end; yewu.DataSet.next; end; finally TAdoQuery(yewu.DataSet).requery; yewu.DataSet.GotoBookmark(bookmark); end; end; procedure Tfrm_op_open_all.select_open_fee(); var i:integer; bookmark:tbookmark; begin bookmark:=yewu.dataset.GetBookmark; try yewu.DataSet.First; while not yewu.DataSet.eof do begin if (yewu.DataSet.fieldbyname('费用状态').asstring='费用封帐') and(yewu.DataSet.fieldbyname('财务').asboolean=false) then begin if yewu.DataSet.FieldByName('会计期间').AsDateTime<=Logininfo.endday then begin MessageDlg('此会计期间已经月末结账,不能解封!',mtWarning,[mbok],0); end else begin yewu.DataSet.edit; if Trim(yewu.DataSet.FieldByName('费用封帐前状态').asstring)<>'' then yewu.DataSet['费用状态']:=yewu.DataSet.FieldByName('费用封帐前状态').asstring else yewu.DataSet['费用状态']:='录入状态'; yewu.DataSet['费用封帐日期']:=null; yewu.DataSet['审核人']:=''; yewu.DataSet['审核日期']:=null; yewu.DataSet.post; CloseOpenLog(yewu.DataSet.FieldByName('编号').AsString,'',yewu.DataSet.FieldByName('费用状态').asstring); end; end; yewu.DataSet.next; end; finally TAdoQuery(yewu.DataSet).requery; yewu.DataSet.GotoBookmark(bookmark); end; end; procedure Tfrm_op_open_all.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_op_open_all.bsSkinButton1Click(Sender: TObject); begin if bsSkinCheckRadioBox3.Checked then begin frm_op_open_all.select_open_all(); close; exit; end; if bsSkinCheckRadioBox1.Checked then begin frm_op_open_all.select_open_op(); close; exit; end; if bsSkinCheckRadioBox2.Checked then begin frm_op_open_all.select_open_fee(); close; exit; end; end; end.