📄 sibofrm.pas
字号:
begin
if not mmiNavigation.Checked then
begin
navigateForm:=TnavigateForm.create(Application);
navigateForm.Show;
mmiNavigation.Checked:=not mmiNavigation.Checked;
end
else
navigateForm.Close;
end;
procedure TSiBoForm.mmiCascadeClick(Sender: TObject);
begin
Cascade;
end;
procedure TSiBoForm.mmiTileClick(Sender: TObject);
begin
Tile;
end;
procedure TSiBoForm.mmiArrangeClick(Sender: TObject);
begin
ArrangeIcons;
end;
procedure TSiBoForm.mmiCloseAllClick(Sender: TObject);
var
i: integer;
begin
for i := MdiChildCount - 1 downto 0 do
MDIChildren[i].Close;
end;
procedure TSiBoForm.N42Click(Sender: TObject);
var
i: integer;
begin
for i := MdiChildCount - 1 downto 0 do
MDIChildren[i].WindowState := wsMinimized;;
end;
procedure TSiBoForm.FormPaint(Sender: TObject);
begin
if mmiNavigation.Checked and (not Assigned(NavigateForm)) Then
begin
NavigateForm:=TNavigateForm.Create(nil);
NavigateForm.Show;
end;
end;
procedure TSiBoForm.mmiExitClick(Sender: TObject);
var
i:integer;
begin
for i:=0 to MdiChildCount-1 do
MdiChildren[i].Close;
SiBoForm.Close;
end;
procedure TSiBoForm.DepartmentExecute(Sender: TObject);
begin
TDepartmentForm.Create(self);
end;
procedure TSiBoForm.mmiModifyClick(Sender: TObject);
begin
ModiPassForm:=TModiPassForm.Create(self);
ModiPassForm.Edit2.Enabled:=False;
ModiPassForm.Edit3.Enabled:=False;
ModiPassForm.bbtnConfirm.Enabled:=False;
ModiPassForm.ShowModal;
end;
procedure TSiBoForm.FaccreditExecute(Sender: TObject);
begin
AccreditForm:=TaccreditForm.Create(self);
AccreditForm.ShowModal;
end;
procedure TSiBoForm.mmiChangeClick(Sender: TObject);
var
i, laccredit:integer;
begin
ChangeUserForm:=TChangeUserForm.Create(self);
if ChangeUserForm.ShowModal=mrOk then begin
laccredit:=accredit;
for i:=0 to actionlist2.ActionCount-1 do begin
case i of
0:begin
if (laccredit and 1)=1 then
backup.Enabled:=True
else
backup.Enabled:=False;
end;
1:begin
if (laccredit and 1)=1 then
restore.Enabled:=True
else
restore.Enabled:=False;
end;
2:begin
if (laccredit and 1)=1 then
Faccredit.Enabled:=True
else
Faccredit.Enabled:=False;
end;
3:begin
if (laccredit and 1)=1 then
department.Enabled:=True
else
department.Enabled:=False;
end;
4:begin
if (laccredit and 1)=1 then
emptype.Enabled:=True
else
emptype.Enabled:=False;
end;
5:begin
if (laccredit and 1)=1 then
employ.Enabled:=True
else
employ.Enabled:=False;
end;
6:begin
if (laccredit and 1)=1 then
workpro.Enabled:=True
else
workpro.Enabled:=False;
end;
7:begin
if (laccredit and 1)=1 then
expression.Enabled:=True
else
expression.Enabled:=False;
end;
8:begin
if (laccredit and 1)=1 then
makeNo.Enabled:=True
else
makeNo.Enabled:=False;
end;
9:begin
if (laccredit and 1)=1 then
project.Enabled:=True
else
project.Enabled:=False;
end;
10:begin
if (laccredit and 1)=1 then
piecework.Enabled:=True
else
piecework.Enabled:=False;
end;
11:begin
if (laccredit and 1)=1 then
laborage.Enabled:=True
else
laborage.Enabled:=False;
end;
12:begin
if (laccredit and 1)=1 then
Report.Enabled:=True
else
Report.Enabled:=False;
end;
13:begin
if (laccredit and 1)=1 then
GetText:=True
else
GetText:=False
end;
end;
Laccredit:=laccredit shr 1;
end;
end;
end;
procedure TSiBoForm.employExecute(Sender: TObject);
begin
EmployForm:=TEmployForm.Create(Self);
EmployForm.Show;
end;
procedure TSiBoForm.EmpTypeExecute(Sender: TObject);
begin
EmpTypeForm:=TEmpTypeForm.Create(Self);
EmpTypeForm.Show;
end;
procedure TSiBoForm.WorkProExecute(Sender: TObject);
begin
WorkProForm:=TWorkProForm.Create(Self);
WorkProForm.Show;
end;
procedure TSiBoForm.ProjectExecute(Sender: TObject);
begin
ProjectForm:=TProjectForm.Create(Self);
ProjectForm.Show;
end;
procedure TSiBoForm.MakeNoExecute(Sender: TObject);
begin
MakeForm:=TMakeForm.Create(Self);
MakeForm.Show;
end;
procedure TSiBoForm.PieceWorkExecute(Sender: TObject);
begin
if not Assigned(PieceWorkForm) then begin
PieceWorkForm:=TPieceWorkForm.Create(Self);
PieceWorkForm.Show;
end else
PieceWorkForm.BringToFront;
end;
procedure TSiBoForm.ExpressionExecute(Sender: TObject);
begin
ExpressionForm:=TExpressionForm.Create(Self);
ExpressionForm.Show;
end;
procedure TSiBoForm.LaborageExecute(Sender: TObject);
begin
if not Assigned(LaborageForm) then begin
SelectMonthForm := TSelectMonthForm.Create(Self);
SelectMonthForm.Date:=Now;
if SelectMonthForm.ShowModal=mrOK then begin
LaborageForm := TLaborageForm.Create(Self);
LaborageForm.Date:=SelectMonthForm.Date;
LaborageForm.Show;
end;
end else
LaborageForm.BringToFront;
end;
procedure TSiBoForm.N15Click(Sender: TObject);
begin
SelectMonthForm := TSelectMonthForm.Create(Self);
SelectMonthForm.Date:=Now;
if SelectMonthForm.ShowModal=mrOK then begin
DecodeDate(SelectMonthForm.Date,FYear,FMonth,FDay);
DM2.qryLaborage.Close;
DM2.qryLaborage.SQL.Clear;
DM2.qryLaborage.SQL.Add('select * from Laborage where Year1=:year1 and Month1=:Month1');
DM2.qryLaborage.Params[0].AsInteger:=FYear;
DM2.qryLaborage.Params[1].AsInteger:=FMonth;
DM2.qryLaborage.Open;
if DM2.qryLaborage.IsEmpty then
messagedlg(Pchar(sError),mtConfirmation, [mbOK], 0)
else begin
LaborageForm := TLaborageForm.Create(Self);
LaborageForm.Caption:=Pchar(sCaption);
LaborageForm.Label1.Caption:=Pchar(sCaption);
LaborageForm.btDelete.Caption:=Pchar(sFilter);
// LaborageForm.btFilter.Caption:=Pchar(sFilter);
LaborageForm.btReCount.Visible:=False;
LaborageForm.btReport.Caption:=Pchar(sPrinter);
LaborageForm.btDelete.Left:=LaborageForm.btDelete.Left+38;
LaborageForm.btFilter.Left:=LaborageForm.btFilter.Left+38;
LaborageForm.btReport.Left:=LaborageForm.btReport.Left-38;
LaborageForm.btExit.Left:=LaborageForm.btExit.Left-38;
LaborageForm.DBGrid1.ReadOnly:=True;
LaborageForm.Date:=SelectMonthForm.Date;
LaborageForm.Show;
end;
end;
end;
procedure TSiBoForm.N16Click(Sender: TObject);
begin
SelectMonthForm := TSelectMonthForm.Create(Self);
SelectMonthForm.Date:=Now;
if SelectMonthForm.ShowModal=mrOK then begin
DecodeDate(SelectMonthForm.Date,FYear,FMonth,FDay);
DM2.qryLaborage.Close;
DM2.qryLaborage.SQL.Clear;
DM2.qryLaborage.SQL.Add('select * from Laborage where Year1=:year1 and Month1=:Month1');
DM2.qryLaborage.Params[0].AsInteger:=FYear;
DM2.qryLaborage.Params[1].AsInteger:=FMonth;
DM2.qryLaborage.Open;
if DM2.qryLaborage.IsEmpty then
messagedlg(Pchar(sError),mtConfirmation, [mbOK], 0)
else begin
LaborageForm := TLaborageForm.Create(Self);
LaborageForm.Caption:=Pchar(sCaption1);
LaborageForm.Label1.Caption:=Pchar(sCaption1);
LaborageForm.btDelete.Caption:=Pchar(sFilter);
// LaborageForm.btFilter.Caption:=Pchar(sFilter);
LaborageForm.btReCount.Caption:=Pchar(sOption);
LaborageForm.btReport.Caption:=Pchar(sPrinter);
LaborageForm.DBGrid1.ReadOnly:=True;
LaborageForm.Date:=SelectMonthForm.Date;
LaborageForm.Show;
end;
end;
end;
procedure TSiBoForm.N17Click(Sender: TObject);
begin
SelectMonthForm := TSelectMonthForm.Create(Self);
SelectMonthForm.Date:=Now;
if SelectMonthForm.ShowModal=mrOK then begin
DecodeDate(SelectMonthForm.Date,FYear,FMonth,FDay);
DM2.qryLaborage.Close;
DM2.qryLaborage.SQL.Clear;
DM2.qryLaborage.SQL.Add('select * from Laborage where Year1=:year1 and Month1=:Month1');
DM2.qryLaborage.Params[0].AsInteger:=FYear;
DM2.qryLaborage.Params[1].AsInteger:=FMonth;
DM2.qryLaborage.Open;
if DM2.qryLaborage.IsEmpty then
messagedlg(Pchar(sError),mtConfirmation, [mbOK], 0)
else begin
DM2.qryLaborageSum.Close;
DM2.qryLaborageSum.Params[0].AsInteger:=FYear;
DM2.qryLaborageSum.Params[1].AsInteger:=FMonth;
DM2.qryLaborageSum.Open;
LaborageForm := TLaborageForm.Create(Self);
LaborageForm.Caption:=Pchar(sCaption2);
LaborageForm.Label1.Caption:=Pchar(sCaption2);
LaborageForm.btDelete.Visible:=False;
LaborageForm.btFilter.Caption:=Pchar(sFilter);
LaborageForm.btReCount.Caption:=Pchar(sOption);
LaborageForm.btReport.Caption:=Pchar(sPrinter);
LaborageForm.btReCount.Left:=LaborageForm.btReCount.Left-38;
LaborageForm.btFilter.Left:=LaborageForm.btFilter.Left-38;
LaborageForm.btReport.Left:=LaborageForm.btReport.Left-38;
LaborageForm.btExit.Left:=LaborageForm.btExit.Left-38;
LaborageForm.DBGridEh1.DataSource:=DM2.dsLaborageSum;
LaborageForm.dbng.DataSource:=DM2.dsLaborageSum;
LaborageForm.DBGridEh1.ReadOnly:=True;
LaborageForm.Date:=EnCodeDate(Fyear,FMonth,FDay);
LaborageForm.Show;
{
LaborageForm := TLaborageForm.Create(Self);
LaborageForm.Caption:=Pchar(sCaption2);
LaborageForm.Label1.Caption:=Pchar(sCaption2);
LaborageForm.btDelete.Visible:=False;
LaborageForm.btFilter.Caption:=Pchar(sFilter);
LaborageForm.btReCount.Caption:=Pchar(sOption);
LaborageForm.btReport.Caption:=Pchar(sPrinter);
LaborageForm.btReCount.Left:=LaborageForm.btReCount.Left-38;
LaborageForm.btFilter.Left:=LaborageForm.btFilter.Left-38;
LaborageForm.btReport.Left:=LaborageForm.btReport.Left-38;
LaborageForm.btExit.Left:=LaborageForm.btExit.Left-38;
LaborageForm.DBGrid1.ReadOnly:=True;
LaborageForm.Date:=SelectMonthForm.Date;
LaborageForm.Show;
}
end;
end;
end;
procedure TSiBoForm.RestoreExecute(Sender: TObject);
var
I: Integer;
begin
if messagedlg(Pchar(sRestorePrompt),mtConfirmation,[mbYes,mbNo],0)<>mrYes then
Abort
else begin
with SiBoForm do
for I := MDIChildCount-1 downto 0 do
MDIChildren[I].Close;
DataBackupForm:=TDataBackupForm.Create(self);
DataBackupForm.Caption:=Pchar(sRestore);
DataBackupForm.ShowModal;
end;
end;
procedure TSiBoForm.backupExecute(Sender: TObject);
var
I: Integer;
begin
if messagedlg(Pchar(sbackupPrompt),mtConfirmation,[mbYes,mbNo],0)<>mrYes then
Abort
else begin
with SiBoForm do
for I := MDIChildCount-1 downto 0 do
MDIChildren[I].Close;
DataBackupForm:=TDataBackupForm.Create(self);
DataBackupForm.Caption:=Pchar(sBackup);
DataBackupForm.ShowModal;
end;
end;
procedure TSiBoForm.ReportExecute(Sender: TObject);
begin
// DutyForm:=TDutyForm.Create(self);
// DutyForm.Show;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -