📄 sfc_mnin_c.pas
字号:
unit Sfc_MnIn_C;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Condition, StdCtrls, ExtEdit, Db, AdODB;
Type
TFrm_Sfc_MnIn_C = Class(TFrm_Base_Condition)
Cmbx_MoFinishShift: TComboBox;
Label2: TLabel;
Label4: TLabel;
cmbbx_DeptCode: TComboBox;
procedure btn_okClick(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
procedure initcmbbx_DeptCode(userCode:string);
public
procedure SetDBConnect(AdOConnection:TAdOConnection);Override;
{ Public declarations }
end;
var
Frm_Sfc_MnIn_C: TFrm_Sfc_MnIn_C;
implementation
uses Sys_Global, Sfc_MnIn;
{$R *.DFM}
procedure TFrm_Sfc_MnIn_C.btn_okClick(Sender: TObject);
begin
inherited;
Condition:='';
Condition:='MO.DeptCode='''+getCode(cmbbx_DeptCode.text)+'''';
Condition:='(mo.DeptCode in ('''+getCode(cmbbx_DeptCode.text)+''','''+copy(getCode(cmbbx_DeptCode.text),1,length(getCode(cmbbx_DeptCode.text))-2)+'''))';
ConditionHint:=ConditionHint+'生产部门:'+getName(cmbbx_DeptCode.text);
Frm_Sfc_MnIn.SetFormParam(cmbx_MoFinishshift.text,cmbbx_DeptCode.text,'','','','');
modalResult:=mrok;
end;
procedure TFrm_Sfc_MnIn_C.SetDBConnect(AdOConnection:TAdOConnection);
begin
inherited;
InitShiftCmBx(AdoQry_tmp,Cmbx_MoFinishShift,True);
end;
procedure TFrm_Sfc_MnIn_C.FormActivate(Sender: TObject);
begin
inherited;
initcmbbx_DeptCode(userCode);
end;
procedure TFrm_Sfc_MnIn_C.initcmbbx_DeptCode(userCode:string);
var
DeptCode:string;
begin
if CmBbx_DeptCode.Items.Count=0 then
begin
AdoQry_Tmp.Close;
AdoQry_Tmp.SQL.Text:='Select DeptCode From Employee'
+' Where EmployeeCode='''+UserCode+'''';
AdoQry_Tmp.Open;
DeptCode:=AdoQry_Tmp.fieldbyname('DeptCode').AsString;
AdoQry_Tmp.Close;
AdoQry_Tmp.SQL.Text:='Select DeptCode+'' ''+DeptName As DeptCodeName'
+' From Dept'
+' Where DeptCode Like '''+DeptCode+'%''';
AdoQry_Tmp.Open;
while not AdoQry_Tmp.Eof do
begin
CmBbx_DeptCode.Items.Add(AdoQry_Tmp.fieldbyname('DeptCodeName').AsString);
AdoQry_Tmp.Next;
end;
CmBbx_DeptCode.ItemIndex:=0;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -