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.

486 lines
12 KiB
Plaintext

11 months ago
{$INCLUDE t_main.inc}
unit u_dxbar_main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, dxExEdtr, StdCtrls, dxDBGrid, dxDBTLCl, dxGrClms, dxTL,
dxDBCtrl, dxCntner, bsSkinCtrls, jpeg, ExtCtrls, dxsbar, ComCtrls,
bsSkinTabs;
type
Tfrm_dxbar_main = class(TForm)
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
Panel1: TPanel;
Panel2: TPanel;
dxbar_main: TdxSideBar;
PanelTitle: TPanel;
Image1: TImage;
Image3: TImage;
Panel4: TPanel;
bsSkinGroupBox1: TbsSkinGroupBox;
dxDBGrid3: TdxDBGrid;
dxDBGrid3Column1: TdxDBGridMaskColumn;
dxDBGrid3Column2: TdxDBGridDateColumn;
bsSkinGroupBox2: TbsSkinGroupBox;
dxDBGrid2: TdxDBGrid;
dxDBGrid2Column1: TdxDBGridMaskColumn;
dxDBGrid2Column2: TdxDBGridDateColumn;
bsSkinGroupBox3: TbsSkinGroupBox;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column2: TdxDBGridMaskColumn;
bsSkinGroupBox4: TbsSkinGroupBox;
dxDBGrid5: TdxDBGrid;
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
dxDBGridDateColumn1: TdxDBGridColumn;
bsSkinPanel4: TbsSkinPanel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
bsSkinGroupBox5: TbsSkinGroupBox;
dxDBGrid6: TdxDBGrid;
dxDBGrid6Column2: TdxDBGridMaskColumn;
Panel3: TPanel;
Image4: TImage;
Label8: TLabel;
Label10: TLabel;
procedure dxDBGrid1DblClick(Sender: TObject);
procedure dxDBGrid5DblClick(Sender: TObject);
procedure dxDBGrid3DblClick(Sender: TObject);
procedure dxDBGrid6DblClick(Sender: TObject);
procedure dxbar_mainItemClick(Sender: TObject; Item: TdxSideBarItem);
procedure FormResize(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
procedure showRpitem;
public
{ Public declarations }
function freesheeet: boolean;
end;
var
frm_dxbar_main: Tfrm_dxbar_main;
implementation
uses u_sys_about, my_sys_function, u_sys_company, u_sys_bank, u_sys_dep_emp,
u_sys_employee, u_sys_limited,
u_data_share, u_op_memo, u_rp_tell,
u_sys_close, u_sys_leave,
u_info_tell_manage,
u_info_tell,
u_sys_progress, u_sys_login,
u_sys_message_pri,u_main ;
{$R *.dfm}
procedure Tfrm_dxbar_main.dxDBGrid1DblClick(Sender: TObject);
begin
{$IFDEF BGXITONG}
{
if frm_main.t_info_bulletin.IsEmpty then exit;
try
frm_info_bulletin:=tfrm_info_bulletin.Create (self);
frm_info_bulletin.ShowModal;
finally
frm_info_bulletin.Free;
frm_info_bulletin:=nil;
end;
}
{$ENDIF}
end;
procedure Tfrm_dxbar_main.dxDBGrid5DblClick(Sender: TObject);
begin
{$IFDEF GRXINXI}
{
if frm_main.t_info_leaveword.IsEmpty then exit;
try
frm_info_leaveword:=tfrm_info_leaveword.Create (self);
frm_info_leaveword.ShowModal;
finally
frm_info_leaveword.Free;
frm_info_leaveword:=nil;
end;
frm_main.t_info_leaveword.Requery();
}
{$ENDIF}
end;
procedure Tfrm_dxbar_main.dxDBGrid3DblClick(Sender: TObject);
begin
if frm_main.t_info_tell.IsEmpty then exit;
try
frm_info_tell:=tfrm_info_tell.Create (self);
frm_info_tell.ShowModal;
finally
frm_info_tell.Free;
frm_info_tell:=nil;
end;
frm_main.t_info_tell.Requery();
end;
procedure Tfrm_dxbar_main.dxDBGrid6DblClick(Sender: TObject);
begin
try
frm_sys_message_pri:=tfrm_sys_message_pri.Create (self);
frm_sys_message_pri.ShowModal;
finally
frm_sys_message_pri.Free;
frm_sys_message_pri:=nil;
end;
end;
procedure Tfrm_dxbar_main.dxbar_mainItemClick(Sender: TObject;
Item: TdxSideBarItem);
begin
{
if Item.Caption = 'ҵ<><D2B5><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>' then
begin
if not assigned(frm_open_operation) then
frm_open_operation:=tfrm_open_operation.Create (self);
frm_open_operation.Width:=Panel3.Width;
frm_open_operation.Height:=Panel3.Height;
frm_open_operation.ManualDock(Panel3,nil,alClient);
frm_open_operation.show;
exit;
end;
if Item.Caption = '<27><><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>ά<EFBFBD><CEAC>' then
begin
if not assigned(frm_open_code) then
frm_open_code:=tfrm_open_code.Create (self);
frm_open_code.ManualDock(Panel3,nil,alClient);
frm_open_code.show;
exit;
end;
if Item.Caption = '<27><>Ϣ<EFBFBD><CFA2>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>' then
begin
if not assigned(frm_open_info) then
frm_open_info:=tfrm_open_info.Create (self);
frm_open_info.ManualDock(Panel3,nil,alClient);
frm_open_info.show;
exit;
end;
if Item.Caption = 'ͳ<>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
begin
if not assigned(frm_open_report) then
frm_open_report:=tfrm_open_report.Create (self);
frm_open_report.ManualDock(Panel3,nil,alClient);
frm_open_report.show;
exit;
end;
}
if Item.Caption = 'ҵ<><D2B5><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>' then
begin
if not assigned(frm_rp_tell) then
frm_rp_tell:=tfrm_rp_tell.Create (self);
frm_rp_tell.ManualDock(frm_main.SearchTabs('frm_rp_tell',frm_rp_tell.caption),nil,alClient);
frm_rp_tell.show;
exit;
end;
if Item.Caption = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ' then
begin
{
try
frm_sys_computer:=tfrm_sys_computer.Create (self);
frm_sys_computer.ShowModal;
finally
frm_sys_computer.Free;
end;
}
exit;
end;
if Item.Caption = '<27><><EFBFBD><EFBFBD>ϵͳ' then
begin
if not assigned(frm_sys_about) then
frm_sys_about:=tfrm_sys_about.Create (self);
frm_sys_about.Show;
exit;
end;
if Item.Caption = '<27><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>' then
begin
{
try
frm_sys_update:=Tfrm_sys_update.Create(self);
frm_sys_update.ShowModal;
finally
frm_sys_update.Free;
end;
}
exit;
end;
if Item.Caption = '<27>˳<EFBFBD>ϵͳ' then
begin
try
frm_sys_close:=Tfrm_sys_close.Create(self);
frm_sys_close.ShowModal;
finally
frm_sys_close.Free;
end;
exit;
end;
if Item.Caption = '<27><>ʱ<EFBFBD>뿪' then
begin
try
frm_sys_leave:=Tfrm_sys_leave.Create(self);
frm_sys_leave.ShowModal;
finally
frm_sys_leave.Free;
end;
exit;
end;
if Item.Caption = '<27><>ҵ<EFBFBD><D2B5>Ϣά<CFA2><CEAC>' then
begin
if not if_open('003') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
try
frm_sys_company:=tfrm_sys_company.Create (self);
frm_sys_company.ShowModal;
finally
frm_sys_company.Free;
end;
exit;
end;
if Item.Caption = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>' then
begin
if not if_open('002') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
try
frm_sys_dep_emp:=tfrm_sys_dep_emp.Create (self);
frm_sys_dep_emp.ShowModal;
finally
frm_sys_dep_emp.Free;
end;
exit;
end;
if Item.Caption = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣά<CFA2><CEAC>' then
begin
if not if_open('004') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
try
frm_sys_bank:=tfrm_sys_bank.Create (self);
frm_sys_bank.ShowModal;
finally
frm_sys_bank.Free;
end;
exit;
end;
if Item.Caption = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ά<EFBFBD><CEAC>' then
begin
try
frm_sys_employee:=tfrm_sys_employee.Create (self);
frm_sys_employee.ShowModal;
finally
frm_sys_employee.Free;
end;
exit;
end;
{$IFDEF GRXINXI}
if Item.Caption = '<27><><EFBFBD>˼ƻ<CBBC><C6BB><EFBFBD><EFBFBD><EFBFBD>' then
begin
end;
{$ENDIF}
if Item.Caption = '<27><><EFBFBD>˼<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>' then
begin
if not assigned(frm_info_tell_manage) then
frm_info_tell_manage:=tfrm_info_tell_manage.Create (self);
frm_info_tell_manage.ManualDock(frm_main.SearchTabs('frm_info_tell_manage',frm_info_tell_manage.caption),nil,alClient);
frm_info_tell_manage.show;
exit;
end;
{$IFDEF GZBAOGAO}
if Item.Caption = '<27><><EFBFBD>˹<EFBFBD><CBB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
begin
{
if not assigned(frm_info_render) then
frm_info_render:=tfrm_info_render.Create (self);
frm_info_render.ManualDock(frm_main.SearchTabs('frm_info_render',frm_info_render.caption),nil,alClient);
frm_info_render.show;
exit;
}
end;
{$ENDIF}
{$IFDEF GRXINXI}
if Item.Caption = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Թ<EFBFBD><D4B9><EFBFBD>' then
begin
{
if not assigned(frm_info_leaveword_manage) then
frm_info_leaveword_manage:=tfrm_info_leaveword_manage.Create (self);
frm_info_leaveword_manage.ManualDock(frm_main.SearchTabs('frm_info_leaveword_manage',frm_info_leaveword_manage.caption),nil,alClient);
frm_info_leaveword_manage.show;
exit;
}
end;
{$ENDIF}
{$IFDEF BGXITONG}
if Item.Caption = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
begin
{
try
frm_info_yijian:=tfrm_info_yijian.Create (self);
frm_info_yijian.ShowModal;
finally
frm_info_yijian.Free;
frm_info_yijian:=nil;
end;
}
exit;
end;
{$ENDIF}
if Item.Caption = 'Ȩ<><C8A8><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>' then
begin
if not if_open('001') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
if not assigned(frm_sys_limited) then
frm_sys_limited:=tfrm_sys_limited.Create (self);
frm_sys_limited.ManualDock(frm_main.SearchTabs('frm_sys_limited',frm_sys_limited.caption),nil,alClient);
frm_sys_limited.show;
exit;
end;
if Item.Caption = 'ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
begin
if not if_open('139') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end; {
if not assigned(frm_sys_report_manage) then
frm_sys_report_manage:=tfrm_sys_report_manage.Create (self);
frm_sys_report_manage.ManualDock(frm_main.SearchTabs('frm_sys_report_manage',frm_sys_report_manage.caption),nil,alClient);
frm_sys_report_manage.show;
}
exit;
end;
end;
procedure Tfrm_dxbar_main.FormResize(Sender: TObject);
var
i:integer;
begin
if not t_project then
begin
if G_ZWCHK<>'TRUE' then
begin
i:=round((Panel4.Height-24)/5);
bsSkinGroupBox3.Height:=i;
bsSkinGroupBox4.Height:=i;
bsSkinGroupBox2.Height:=i;
bsSkinGroupBox1.Height:=i;
end
else
begin
i:=round((Panel4.Height-24)/3);
bsSkinGroupBox3.Height:=i;
bsSkinGroupBox4.Height:=i;
bsSkinGroupBox2.Height:=i-10;
bsSkinGroupBox1.Height:=5;
bsSkinGroupBox5.Height:=5;
end;
end ;
end;
procedure Tfrm_dxbar_main.showRpitem;
var
MItem: TdxSideBarItem ;
Mgroup:TdxSideGroup ;
begin
if G_ZWCHK='FALSE' then
try
Mgroup:=dxbar_main.Groups.Items[0] ;
MItem:=Mgroup.Items.Add ;
MItem.Caption:='ͳ<>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' ;
MItem.LargeImage:=36 ;
MItem.Index:=1 ;
Mgroup:=dxbar_main.Groups.Items[0] ;
MItem:=Mgroup.Items.Add ;
MItem.Caption:='ҵ<><D2B5><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>' ;
MItem.LargeImage:=23 ;
MItem.Index:=2 ;
Mgroup:=dxbar_main.Groups.Items[2] ;
MItem:=Mgroup.Items.Add ;
MItem.Caption:='Ȩ<><C8A8><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>' ;
MItem.LargeImage:=24 ;
MItem.Index:=2 ;
Except
showmessage('<27><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD>ͳ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD> ');
end;
bsSkinGroupBox5.Visible:=G_ZWCHK<>'TRUE' ;
bsSkinGroupBox1.Visible:=G_ZWCHK<>'TRUE' ;
{$IFDEF GRXINXI}
{$ELSE}
Mgroup:=dxbar_main.Groups.Items[1] ;
Mgroup.Visible:=false;
{$ENDIF}
end;
procedure Tfrm_dxbar_main.FormShow(Sender: TObject);
begin
Image4.Picture.LoadFromFile(ExtractFilePath(ParamStr(0))+'wall.jpg');
label4.Caption:=employee;
label5.Caption:=FormatDateTime('hh',now)+':'+FormatDateTime('nn',now);
showRpitem ;
{
if not assigned(frm_chart_message) then
frm_chart_message:=tfrm_chart_message.Create (self);
frm_chart_message.ManualDock(frm_main.SearchTabs('frm_chart_message',frm_chart_message.caption),nil,alClient);
frm_chart_message.show ;
}
bsSkinPageControl1.ActivePage:=bsSkinTabSheet1 ;
end;
function Tfrm_dxbar_main.freesheeet: boolean;
var i:integer ;
myform:tform ;
mysheet:TTabSheet ;
begin
result:=true ;
if bsSkinPageControl1.PageCount<=1 then exit ;
try
while bsSkinPageControl1.PageCount>1 do
begin
mysheet:=bsSkinPageControl1.Pages[1];
for i:=0 to mysheet.ControlCount-1 do
if MySheet.controls[i].Name=MySheet.Hint then
Tform(MYSheet.controls[i]).Close ;
end ;
result:=true ;
except
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD>رճ<D8B1><D5B3><EFBFBD>!<21><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!');
result:=false ;
end ;
end;
end.