You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

204 lines
5.1 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

unit workflow;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, dxExEdtr, dxCntner, dxTL, dxDBCtrl,dxGrClms, dxDBGrid, DB, ADODB,
dxDBTLCl, Mask, wwdbedit, Wwdotdot, Wwdbcomb, StdCtrls, wwdblook, Grids,
Wwdbigrd, Wwdbgrid, bsSkinCtrls;
type
Tfrm_workflow = class(TForm)
t_workflow1: TDataSource;
t_workflow: TADOQuery;
t_workflow_step1: TDataSource;
t_workflow_step: TADOQuery;
t_workflow_step_emp: TADOQuery;
t_workflow_step_emp1: TDataSource;
dxDBGrid2: TdxDBGrid;
dxDBGrid3: TdxDBGrid;
dxDBGrid2Column1: TdxDBGridColumn;
dxDBGrid2Column2: TdxDBGridColumn;
dxDBGrid2Column3: TdxDBGridCheckColumn;
dxDBGrid3Column1: TdxDBGridColumn;
wwDBGrid1: TwwDBGrid;
wwDBLookupCombo1: TwwDBLookupCombo;
wwDBComboBox1: TwwDBComboBox;
bsSkinButton8: TbsSkinButton;
bsSkinButton12: TbsSkinButton;
bsSkinButton13: TbsSkinButton;
bsSkinButton14: TbsSkinButton;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
procedure t_workflow_step_empAfterInsert(DataSet: TDataSet);
procedure t_workflow_stepAfterInsert(DataSet: TDataSet);
procedure t_workflowAfterInsert(DataSet: TDataSet);
procedure t_workflowBeforeDelete(DataSet: TDataSet);
procedure t_workflow_stepBeforeDelete(DataSet: TDataSet);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton8Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinButton12Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure bsSkinButton13Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton14Click(Sender: TObject);
procedure t_workflow_step_empBeforePost(DataSet: TDataSet);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_workflow: Tfrm_workflow;
implementation
uses u_main, my_sys_function,u_data_share;
{$R *.dfm}
procedure Tfrm_workflow.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
frm_workflow.Hide;
frm_workflow.ManualFloat(frm_workflow.BoundsRect );
frm_main.freeTabs('frm_workflow');
action:=cafree;
frm_workflow:=nil;
end;
procedure Tfrm_workflow.FormShow(Sender: TObject);
begin
//
t_workflow.Close;
t_workflow.Open;
t_workflow_step.Close;
t_workflow_step.Open;
t_workflow_step_emp.Close;
t_workflow_step_emp.Open;
end;
procedure Tfrm_workflow.t_workflow_step_empAfterInsert(DataSet: TDataSet);
begin
DataSet['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
DataSet['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=Date;
t_workflow_step_emp['W_ID']:=t_workflow_step['W_ID'];
t_workflow_step_emp['WI_ID']:=t_workflow_step['WI_ID'];
end;
procedure Tfrm_workflow.t_workflow_stepAfterInsert(DataSet: TDataSet);
begin
DataSet['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
DataSet['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=Date;
end;
procedure Tfrm_workflow.t_workflowAfterInsert(DataSet: TDataSet);
begin
DataSet['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
DataSet['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=Date;
DataSet['·<><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='';
DataSet['ҵ<><D2B5><EFBFBD><EFBFBD>ʽ']:='<27><>ͨ';
DataSet['<27><><EFBFBD>ѷ<EFBFBD>ʽ']:='';
DataSet['<27><><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD>']:=0;
DataSet['<27><><EFBFBD><EFBFBD>']:=0;
DataSet['<27><><EFBFBD><EFBFBD>ֹ']:=50;
DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='<=';
end;
procedure Tfrm_workflow.t_workflowBeforeDelete(DataSet: TDataSet);
begin
if (t_workflow_step.RecordCount>=1) or (t_workflow_step_emp.RecordCount>=1) then
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>,<2C><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ');
abort;
end;
end;
procedure Tfrm_workflow.t_workflow_stepBeforeDelete(DataSet: TDataSet);
begin
if (t_workflow_step_emp.RecordCount>=1) then
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>,<2C><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ');
abort;
end;
end;
procedure Tfrm_workflow.bsSkinButton1Click(Sender: TObject);
begin
t_workflow_step.Append;
end;
procedure Tfrm_workflow.bsSkinButton8Click(Sender: TObject);
begin
t_workflow_step_emp.Append;
end;
procedure Tfrm_workflow.bsSkinButton2Click(Sender: TObject);
begin
if t_workflow_step.IsEmpty then
exit;
table_post(t_workflow_step);
end;
procedure Tfrm_workflow.bsSkinButton12Click(Sender: TObject);
begin
if t_workflow_step_emp.IsEmpty then
exit;
table_post(t_workflow_step_emp);
end;
procedure Tfrm_workflow.bsSkinButton3Click(Sender: TObject);
begin
t_workflow_step.delete;
end;
procedure Tfrm_workflow.bsSkinButton13Click(Sender: TObject);
begin
t_workflow_step_emp.delete;
end;
procedure Tfrm_workflow.bsSkinButton4Click(Sender: TObject);
begin
table_cancel(t_workflow_step);
end;
procedure Tfrm_workflow.bsSkinButton14Click(Sender: TObject);
begin
table_cancel(t_workflow_step_emp);
end;
procedure Tfrm_workflow.t_workflow_step_empBeforePost(DataSet: TDataSet);
begin
table_before_post(t_workflow_step_emp,'<27><><EFBFBD><EFBFBD>');
if not frm_data_share.t_sys_employee.Locate('<27><><EFBFBD><EFBFBD>',trim(t_workflow_step_emp.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring),[]) then
begin
showmessage('ϵͳ<CFB5>в<EFBFBD><D0B2><EFBFBD><EFBFBD>ڸ<EFBFBD>'+t_workflow_step_emp.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+',<2C><><EFBFBD>˶<EFBFBD>');
abort;
end;
end;
end.