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.

1309 lines
35 KiB
Plaintext

11 months ago
unit u_tmain;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ImgList, bsSkinData, BusinessSkinForm, DB, ADODB, bsSkinCtrls, dxsbar,
ComCtrls, bsSkinTabs, ExtCtrls, StdCtrls, Menus, AppEvnts,dxBar,
jpeg, cxControls, cxContainer, cxEdit, cxTextEdit, cxHyperLinkEdit,
cxDBEdit, cxLookAndFeelPainters, cxButtons, fcLabel, dxExEdtr, dxCntner,
dxTL, dxDBCtrl, dxDBGrid, dxDBTLCl, dxGrClms, Mask, DBCtrls, NMUDP,ShellApi,
RxCombos, bsSkinBoxCtrls, RxMemDS,Winsock, wwdbedit, Wwdotdot, Wwdbcomb,IdFTP,
RxLookup;
type
Tfrm_tmain = class(TForm)
db: TADOConnection;
bsBusinessSkinForm1: TbsBusinessSkinForm;
bsSkinData1: TbsSkinData;
bsStoredSkin1: TbsStoredSkin;
ApplicationEvents1: TApplicationEvents;
imglMain: TImageList;
MainPageControl: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
Panel1: TPanel;
Panel2: TPanel;
dxbar_main: TdxSideBar;
PanelTitle: TPanel;
Image1: TImage;
Image3: TImage;
Panel4: TPanel;
bsSkinGroupBox1: TbsSkinGroupBox;
bsSkinGroupBox2: TbsSkinGroupBox;
bsSkinGroupBox3: TbsSkinGroupBox;
dxDBGrid1: TdxDBGrid;
dxDBGrid2: TdxDBGrid;
dxDBGrid3: TdxDBGrid;
t_info_bulletin: TADOQuery;
t_info_bulletin1: TDataSource;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column2: TdxDBGridMaskColumn;
t_info_plan: TADOQuery;
t_info_plan1: TDataSource;
dxDBGrid2Column1: TdxDBGridMaskColumn;
dxDBGrid2Column2: TdxDBGridDateColumn;
t_info_tell: TADOQuery;
t_info_tell1: TDataSource;
dxDBGrid3Column1: TdxDBGridMaskColumn;
dxDBGrid3Column2: TdxDBGridDateColumn;
Timer1: TTimer;
bsSkinTabSheet2: TbsSkinTabSheet;
bsSkinPanel1: TbsSkinPanel;
ChatMsgRichEdit: TRichEdit;
t_chat_man: TRxMemoryData;
t_chat_man1: TDataSource;
dxDBGrid4: TdxDBGrid;
dxDBGrid4Column1: TdxDBGridMaskColumn;
dxDBGrid4Column2: TdxDBGridMaskColumn;
NMUDP: TNMUDP;
bsSkinGroupBox4: TbsSkinGroupBox;
dxDBGrid5: TdxDBGrid;
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
t_info_leaveword: TADOQuery;
t_info_leaveword1: TDataSource;
dxDBGridDateColumn1: TdxDBGridColumn;
bsSkinPanel4: TbsSkinPanel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Panel3: TPanel;
Image4: TImage;
bsSkinGroupBox5: TbsSkinGroupBox;
dxDBGrid6: TdxDBGrid;
t_sum_ctn: TRxMemoryData;
bsSkinPanel3: TbsSkinPanel;
bsSkinButton1: TbsSkinButton;
bsSkinPanel2: TbsSkinPanel;
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
Memo1: TMemo;
t_sys_message_no: TADOQuery;
t_sys_message_yes: TADOQuery;
t_sys_message_yes1: TDataSource;
dxDBGrid6Column2: TdxDBGridMaskColumn;
dxDBGrid4Column3: TdxDBGridColumn;
t_do_shenhe_fee: TADOQuery;
t_do_shenhe_other: TADOQuery;
Label2: TLabel;
Label3: TLabel;
qryTmp: TADOQuery;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
dxDBGrid4Column4: TdxDBGridCheckColumn;
function SearchTabs(formName:string;formcaption:string):TtabSheet;
procedure freeTabs(formName:string);
procedure dxbar_mainItemClick(Sender: TObject; Item: TdxSideBarItem);
procedure view_momo(DataSource1:TDataSource;fi:string);
procedure FormResize(Sender: TObject);
procedure dxDBGrid1DblClick(Sender: TObject);
procedure dxDBGrid2DblClick(Sender: TObject);
procedure dxDBGrid3DblClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure NMUDPDataReceived(Sender: TComponent; NumberBytes: Integer;
FromIP: String; Port: Integer);
procedure dxDBGrid4Click(Sender: TObject);
procedure dxDBGrid5DblClick(Sender: TObject);
procedure ApplicationEvents1Exception(Sender: TObject; E: Exception);
procedure FormShow(Sender: TObject);
procedure dbBeforeConnect(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure Memo1KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo1KeyPress(Sender: TObject; var Key: Char);
procedure dxDBGrid6DblClick(Sender: TObject);
procedure Panel3Resize(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure dxDBGrid4Exit(Sender: TObject);
private
{ Private declarations }
procedure showRpitem;
public
{ Public declarations }
end;
var
frm_tmain: Tfrm_tmain;
employee,department,subComp:string;
modify_all:boolean;
if_ch_delete_do:boolean;
delete_do_type_num:integer;
con_net:boolean;
if_log:boolean;
LocalIP: String;
BroadCastIP: String;
G_ZWCHK : String; //˰<><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 109:TRUE <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FALSE <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
G_Arrivdate : String; //<2F><><EFBFBD>˼<EFBFBD><CBBC><EFBFBD> 110:true <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>Ϊ<EFBFBD><CEAA> false <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD><DABF><EFBFBD>Ϊ<EFBFBD><CEAA>
backstate,orderState:string ; //<2F><><EFBFBD><EFBFBD> <20>˲<EFBFBD> ҵ<><D2B5>״̬
showprice:booLean ; //<2F>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD>
implementation
uses u_sys_about, my_sys_function, u_sys_company, u_sys_bank, u_sys_dep_emp,
u_sys_employee, u_open_operation, u_open_code, u_sys_limited,
u_data_share, u_op_memo, u_open_info, u_open_report, u_rp_tell,
u_sys_computer, u_sys_ask, u_sys_close, u_sys_leave,
u_info_plan_individual, u_info_tell_manage, u_info_render,
u_info_leaveword_manage, u_sys_report_manage, u_info_bulletin,
u_info_plan, u_info_tell, u_info_leaveword,
u_sys_progress, u_sys_login, u_info_yijian, my_sys_chat,
u_sys_message_pri, u_sys_update;
{$R *.DFM}
procedure Tfrm_tmain.view_momo(DataSource1:TDataSource;fi:string); //<2F><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>
begin
if DataSource1.DataSet.IsEmpty then
exit;
try
frm_op_memo:=Tfrm_op_memo.Create(self);
frm_op_memo.DBMemo1.DataSource:=DataSource1;
frm_op_memo.DBMemo1.DataField:=fi;
frm_op_memo.caption:=fi;
frm_op_memo.ShowModal;
finally
frm_op_memo.free;
end;
end;
function Tfrm_tmain.SearchTabs(formName:string;formcaption:string):TtabSheet; //<2F><><EFBFBD><EFBFBD> <20><>Ӧtab
var
i:integer;
TabSheet: TbsSkinTabSheet;
begin
for i:=0 to MainPageControl.PageCount -1 do
begin
if MainPageControl.Pages[i].Hint=formName then
begin
MainPageControl.ActivePageIndex :=i;
result:=MainPageControl.Pages[ MainPageControl.ActivePageIndex] ;
exit;
end;
end;
TabSheet:=TbsSkinTabSheet.create(self);
TabSheet.PageControl:=MainPageControl;
MainPageControl.ActivePageIndex :=MainPageControl.PageCount-1;
MainPageControl.Pages[MainPageControl.ActivePageIndex].Hint:=formName;
mainPageControl.Pages[MainPageControl.ActivePageIndex].caption:=formcaption;
result:=MainPageControl.Pages[ MainPageControl.ActivePageIndex] ;
end;
procedure Tfrm_tmain.freeTabs(formName:string);
var
i:integer;
begin
for i:=0 to MainPageControl.PageCount -1 do
begin
if MainPageControl.Pages[i].Hint=formName then
begin
MainPageControl.Pages[i].free;
break;
end;
end;
end;
procedure Tfrm_tmain.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 = 'ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>' then
begin
ShellExecute(Application.Handle,nil,PChar(ExtractFilePath(Application.ExeName)+'\Help.chm'),nil,nil,SW_NORMAL);
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;
if Item.Caption = '<27><><EFBFBD>˼ƻ<CBBC><C6BB><EFBFBD><EFBFBD><EFBFBD>' then
begin
if not assigned(frm_info_plan_individual) then
frm_info_plan_individual:=tfrm_info_plan_individual.Create (self);
frm_info_plan_individual.ManualDock(frm_main.SearchTabs('frm_info_plan_individual',frm_info_plan_individual.caption),nil,alClient);
frm_info_plan_individual.show;
exit;
end;
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;
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;
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;
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;
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_tmain.FormResize(Sender: TObject);
var
i:integer;
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 ;
procedure Tfrm_tmain.dxDBGrid1DblClick(Sender: TObject);
begin
if 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;
end;
procedure Tfrm_tmain.dxDBGrid2DblClick(Sender: TObject);
begin
if t_info_plan.IsEmpty then
exit;
try
frm_info_plan:=tfrm_info_plan.Create (self);
frm_info_plan.ShowModal;
finally
frm_info_plan.Free;
end;
t_info_plan.Requery();
end;
procedure Tfrm_tmain.dxDBGrid3DblClick(Sender: TObject);
begin
if 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;
t_info_tell.Requery();
end;
procedure Tfrm_tmain.Timer1Timer(Sender: TObject);
var
now_str,tel_str:string;
get_str,do_str:integer;
begin
if t_info_tell.IsEmpty then
begin
Timer1.enabled:=false;
exit;
end;
do_str:=86400;
t_info_tell.first;
now_str:=FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now);
while not t_info_tell.eof do
begin
tel_str:=FormatDateTime('yyyy',t_info_tell.fieldbyname('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').asdatetime)
+FormatDateTime('mm',t_info_tell.fieldbyname('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').asdatetime)
+FormatDateTime('dd',t_info_tell.fieldbyname('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').asdatetime)
+FormatDateTime('hh',t_info_tell.fieldbyname('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').asdatetime)
+FormatDateTime('nn',t_info_tell.fieldbyname('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').asdatetime);
if tel_str=now_str then
begin
try
Timer1.enabled:=false;
frm_info_tell:=tfrm_info_tell.Create (self);
frm_info_tell.ShowModal;
finally
frm_info_tell.Free;
frm_info_tell:= nil;
Timer1.Interval:=10000;
Timer1.enabled:=true;
end;
end
else
begin
if (FormatDateTime('yyyy',t_info_tell.fieldbyname('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').asdatetime)=FormatDateTime('yyyy',now))
and(FormatDateTime('mm',t_info_tell.fieldbyname('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').asdatetime)=FormatDateTime('mm',now))
and(FormatDateTime('dd',t_info_tell.fieldbyname('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').asdatetime)=FormatDateTime('dd',now)) then
begin
get_str:=(strtoint(FormatDateTime('hh',t_info_tell.fieldbyname('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').asdatetime))-
strtoint(FormatDateTime('hh',now)))*60*60+
(strtoint(FormatDateTime('nn',t_info_tell.fieldbyname('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').asdatetime))-
strtoint(FormatDateTime('nn',now)))*60;
if (get_str<do_str) and (get_str>0) then
do_str:=get_str;
end;
end;
t_info_tell.next;
end;
if do_str=86400 then
begin
Timer1.enabled:=false;
end
else if do_str<>0 then
begin
Timer1.enabled:=false;
Timer1.Interval:=1000*(do_str-1);
Timer1.enabled:=true;
end
else
begin
Timer1.enabled:=false;
end;
end;
procedure Tfrm_tmain.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
try
frm_sys_close:=Tfrm_sys_close.Create(self);
frm_sys_close.ShowModal;
if frm_sys_close.ModalResult = mrOk then
CanClose:=True
else
CanClose:=False;
finally
frm_sys_close.Free;
end;
end;
procedure Tfrm_tmain.NMUDPDataReceived(Sender: TComponent;
NumberBytes: Integer; FromIP: String; Port: Integer);
var
msg:array[1..255] of Char;
from_ip,from_type,from_emp:wideString;
i:integer;
tell_str:string;
begin
if not if_log then
exit;
if employee='' then
exit;
NMUDP.ReadBuffer(msg,i);
from_ip:=Trim(Copy(Msg,1,16));
from_type:=Trim(Copy(Msg,17,2));
from_emp:=Trim(Copy(Msg,19,10));
tell_str:=Copy(Msg,29,i-28);
try
strtoint(from_type);
except
exit;
end;
case strtoint(from_type) of
1:
begin
if (from_ip<>LocalIP) and (from_emp=employee)then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʺ<EFBFBD><CABA>ڱ<EFBFBD><DAB1>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD>ϵ<EFBFBD>½<EFBFBD><C2BD><EFBFBD><EFBFBD><E3BDAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>');
application.Terminate;
exit;
end;
if (from_ip<>LocalIP) and (from_emp<>employee)then
begin
if t_chat_man.locate('<27><><EFBFBD><EFBFBD>ְԱ',from_emp,[]) then
begin
t_chat_man.edit;
t_chat_man['<27><><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>']:=from_ip;
t_chat_man.post;
end
else
begin
t_chat_man.insert;
t_chat_man['<27><><EFBFBD><EFBFBD>ְԱ']:=from_emp;
t_chat_man['<27><><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>']:=from_ip;
t_chat_man['<27><><EFBFBD><EFBFBD>']:=false;
if frm_data_share.t_sys_employee.locate('<27><><EFBFBD><EFBFBD>',from_emp,[]) then
begin
t_chat_man['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_data_share.t_sys_employee.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
end;
t_chat_man.post;
end;
Sendlogtell(from_ip);
exit;
end;
if (from_ip=LocalIP) and (from_emp=employee)then
begin
Sendlogtell(from_ip);
exit;
end;
end;
2:
begin
if t_chat_man.locate('<27><><EFBFBD><EFBFBD>ְԱ',from_emp,[]) then
begin
t_chat_man.edit;
t_chat_man['<27><><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>']:=from_ip;
t_chat_man.post;
end
else
begin
t_chat_man.insert;
t_chat_man['<27><><EFBFBD><EFBFBD>ְԱ']:=from_emp;
if frm_data_share.t_sys_employee.locate('<27><><EFBFBD><EFBFBD>',from_emp,[]) then
begin
t_chat_man['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_data_share.t_sys_employee.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
end;
t_chat_man['<27><><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>']:=from_ip;
t_chat_man.post;
end;
end;
3:
begin
if t_chat_man.locate('<27><><EFBFBD><EFBFBD>ְԱ',from_emp,[]) then
begin
t_chat_man.delete;
end;
end;
4,5:
begin
if from_emp<>employee then
begin
ChatMsgRichEdit.lines.add(from_emp+'<27><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>('+datetimetostr(now)+')'+tell_str);
if bsSkinTabSheet2.Showing then
begin
t_sys_message_no.insert;
t_sys_message_no['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ';
t_sys_message_no['<27><><EFBFBD>ͷ<EFBFBD>']:=from_emp;
t_sys_message_no['<27><><EFBFBD>͵<EFBFBD>ַ']:=from_ip;
t_sys_message_no['<27><><EFBFBD>շ<EFBFBD>']:=employee;
t_sys_message_no['<27>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>']:=tell_str;
t_sys_message_no['<27>Ƿ<EFBFBD>֪<EFBFBD><D6AA>']:=1;
t_sys_message_no['ʱ<><CAB1>']:=now;
t_sys_message_no.post;
end
else
begin
t_sys_message_yes.insert;
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ';
t_sys_message_yes['<27><><EFBFBD>ͷ<EFBFBD>']:=from_emp;
t_sys_message_yes['<27><><EFBFBD>͵<EFBFBD>ַ']:=from_ip;
t_sys_message_yes['<27><><EFBFBD>շ<EFBFBD>']:=employee;
t_sys_message_yes['<27>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>']:=tell_str;
t_sys_message_yes['<27>Ƿ<EFBFBD>֪<EFBFBD><D6AA>']:=0;
t_sys_message_yes['ʱ<><CAB1>']:=now;
t_sys_message_yes.post;
tell_message(from_emp+'<27><><EFBFBD><EFBFBD>˵:'+tell_str);
end;
end;
end;
6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,
21,22,23,24,25,26,27,28,29,30,31,32,33,34,
35,36,37,38,39,40,41,42,43,44,45,46,47,50,61:
begin
t_sys_message_yes.insert;
case strtoint(from_type)of
6:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1BDBB><EFBFBD><EFBFBD>';
end;
7:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>';
end;
8:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>';
end;
9:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>';
end;
10:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD>ύ';
end;
11:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׼<EFBFBD>޸<EFBFBD>';
end;
12:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD>ý<EFBFBD>ֹ<EFBFBD>޸<EFBFBD>';
end;
13:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׼ɾ<D7BC><C9BE>';
end;
14:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD>ý<EFBFBD>ֹɾ<D6B9><C9BE>';
end;
15:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>Ʊ';
end;
16:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD>޸ķ<DEB8>Ʊ';
end;
17:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
end;
18:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>֧<EFBFBD><D6A7>';
end;
19:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><>׼<EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ';
end;
20:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><>׼֧<D7BC><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
end;
21:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><>׼<EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ';
end;
22:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뷢Ʊ';
end;
23:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><>׼<EFBFBD>޸ķ<DEB8>Ʊ';
end;
24:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><>ֹ<EFBFBD>޸ķ<DEB8>Ʊ';
end;
25:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD>뷢Ʊ<EBB7A2><C6B1><EFBFBD><EFBFBD>';
end;
26:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><>׼֧<D7BC><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
end;
27:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>';
end;
28:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><>׼<EFBFBD>޸<EFBFBD>֧<EFBFBD><D6A7>';
end;
29:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><>ֹ<EFBFBD>޸<EFBFBD>֧<EFBFBD><D6A7>';
end;
30:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27>շѺ<D5B7><D1BA><EFBFBD>֪ͨ';
end;
31:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27>շѺ<D5B7><D1BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
end;
32:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27>շѺ<D5B7><D1BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
end;
33:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27>շѺ<D5B7><D1BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
end;
34:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD>Ϳ<EFBFBD><CDBF><EFBFBD>';
end;
35:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD>ȷ<EFBFBD>Ϸ<EFBFBD><CFB7><EFBFBD>';
end;
36:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
end;
37:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɳ<EFBFBD>';
end;
38:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD>ɳ<EFBFBD>';
end;
39:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˰ȷ<CBB0><C8B7>';
end;
40:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>ȷ<EFBFBD><C8B7>';
end;
41:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='ҵ<><D2B5><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>';
end;
42:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>';
end;
43:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='ҵ<><D2B5><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>';
end;
44:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>';
end;
45:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>';
end;
46:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27>ͻ<EFBFBD>ת<EFBFBD><D7AA>ͨ<EFBFBD><CDA8>';
end;
47:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD>ؿͻ<D8BF>ת<EFBFBD><D7AA>';
end;
50:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD>˷<EFBFBD><CBB7>ý<EFBFBD><C3BD><EFBFBD>';
end;
61:
begin
t_sys_message_yes['<27><><EFBFBD><EFBFBD>']:='<27><><EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
end ;
end;
t_sys_message_yes['<27><><EFBFBD>ͷ<EFBFBD>']:=from_emp;
t_sys_message_yes['<27><><EFBFBD>͵<EFBFBD>ַ']:=from_ip;
t_sys_message_yes['<27><><EFBFBD>շ<EFBFBD>']:=employee;
t_sys_message_yes['<27>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>']:=tell_str;
t_sys_message_yes['<27>Ƿ<EFBFBD>֪<EFBFBD><D6AA>']:=0;
t_sys_message_yes['ʱ<><CAB1>']:=now;
t_sys_message_yes.post;
tell_message(from_emp+'<27><><EFBFBD><EFBFBD>˵:'+tell_str);
end;
48:
begin
tell_message(from_emp+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+tell_str);
t_info_bulletin.Requery();
end;
49:
begin
tell_message(from_emp+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+tell_str);
t_info_leaveword.Requery();
end;
51:
begin
if not strtobool(get_parameters_value(4,'false')) then
tell_message(from_emp+'<27><><EFBFBD>Ŀͻ<C4BF>:'+tell_str);
with frm_data_share do
begin
t_crm_client.Requery();
t_crm_client_all.Requery();
t_crm_client_ship.Requery();
t_crm_client_changzhan.Requery();
t_crm_client_truck.Requery();
t_crm_client_hangkong.Requery();
t_crm_client_baoguan.Requery();
t_crm_client_weituo.Requery();
t_crm_client_daili.Requery();
t_crm_client_huodai.Requery();
t_crm_client_shiper.Requery();
t_crm_client_shouhuo.Requery();
t_crm_client_tongzhi.Requery();
t_crm_client_other.Requery();
end;
end;
52:
begin
tell_message(from_emp+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+tell_str);
end;
53:
begin
if not strtobool(get_parameters_value(4,'false')) then
tell_message(from_emp+'<27>ͻ<EFBFBD>ͨ<EFBFBD><CDA8>:'+tell_str);
with frm_data_share do
begin
t_crm_client.Requery();
t_crm_client_all.Requery();
t_crm_client_ship.Requery();
t_crm_client_changzhan.Requery();
t_crm_client_truck.Requery();
t_crm_client_hangkong.Requery();
t_crm_client_baoguan.Requery();
t_crm_client_weituo.Requery();
t_crm_client_daili.Requery();
t_crm_client_huodai.Requery();
t_crm_client_shiper.Requery();
t_crm_client_shouhuo.Requery();
t_crm_client_tongzhi.Requery();
t_crm_client_other.Requery();
end;
end;
54:
begin
with frm_data_share do
begin
t_crm_client.Requery();
t_crm_client_all.Requery();
t_crm_client_ship.Requery();
t_crm_client_changzhan.Requery();
t_crm_client_truck.Requery();
t_crm_client_hangkong.Requery();
t_crm_client_baoguan.Requery();
t_crm_client_weituo.Requery();
t_crm_client_daili.Requery();
t_crm_client_huodai.Requery();
t_crm_client_shiper.Requery();
t_crm_client_shouhuo.Requery();
t_crm_client_tongzhi.Requery();
t_crm_client_other.Requery();
end;
end;
55:
begin
frm_data_share.t_sys_parameters_value.requery;
end;
56:
begin
frm_data_share.t_code_fee.requery;
end;
57:
begin
frm_data_share.t_code_currency.requery;
end;
58:
begin
frm_data_share.t_code_ctn.requery;
frm_data_share.t_code_ctn_de.requery;
frm_data_share.t_code_ctn_kind.requery;
end;
59:
begin
frm_data_share.t_sys_code_emp.Requery();
frm_data_share.t_sys_code_data.Requery();
end;
60:
begin
tell_message(from_emp+'<27>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD>:'+tell_str);
t_sys_message_no.Requery();
end ;
end;
end;
procedure Tfrm_tmain.dxDBGrid4Click(Sender: TObject);
begin
{ if not t_chat_man.IsEmpty then
begin
RxDBLookupCombo1.DisplayValue:=t_chat_man.fieldbyname('<27><><EFBFBD><EFBFBD>ְԱ').asstring;
end
else
begin
RxDBLookupCombo1.ClearValue;
end;
}
end;
procedure Tfrm_tmain.dxDBGrid5DblClick(Sender: TObject);
begin
if 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;
t_info_leaveword.Requery();
end;
procedure Tfrm_tmain.ApplicationEvents1Exception(Sender: TObject;
E: Exception);
begin
if pos('PRIM',UpperCase(E.Message))<>0 then
begin
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><DCB1><EFBFBD><E6A3AC>ˢ<EFBFBD><CBA2><EFBFBD><EFBFBD><EFBFBD>ݺ<EFBFBD><DDBA><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>');
// exit;
end;
if pos('Ψһ<CEA8><D2BB><EFBFBD><EFBFBD>',UpperCase(E.Message))<>0 then
begin
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><DCB1><EFBFBD><E6A3AC>ˢ<EFBFBD><CBA2><EFBFBD><EFBFBD><EFBFBD>ݺ<EFBFBD><DDBA><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>');
// exit;
end;
if pos('NULL',UpperCase(E.Message))<>0 then
begin
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEB2BB>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>ǰ<EFBFBD>޸IJ<DEB8><C4B2>ܱ<EFBFBD><DCB1><EFBFBD>'+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>');
// exit;
end;
if pos('SOME VALUES MAY HAVE BEEN CHANGED',UpperCase(E.Message))<>0 then
begin
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>޸ģ<DEB8><C4A3><EFBFBD>ǰ<EFBFBD>޸IJ<DEB8><C4B2>ܱ<EFBFBD><DCB1><EFBFBD>'+#13#10+'<27><>ˢ<EFBFBD><CBA2><EFBFBD><EFBFBD><EFBFBD>ݺ<EFBFBD><DDBA><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>');
// exit;
end;
if (pos('connection', lowercase(E.Message))<>0) or (pos('dbnmp', lowercase(E.Message))<>0) then
begin
showmessage('<27><><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD>Ӵ<EFBFBD><D3B4><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򣡣<EFBFBD>');
application.Terminate;
// exit;
end;
update_wenti(E);
end;
procedure Tfrm_tmain.FormShow(Sender: TObject);
var i,j:integer ;
begin
// bsSkinData1.LoadFromFile(ExtractFilePath(ParamStr(0))+'skins\skin.ini');
if not if_log then
begin
try
frm_sys_login:=tfrm_sys_login.Create (application);
frm_sys_login.ShowModal;
finally
frm_sys_login.Free;
frm_sys_login:=NIL;
end;
end;
if not if_log then
exit;
try
t_chat_man.open;
t_sys_message_no.open;
t_sys_message_yes.Parameters[0].value:=employee;
t_sys_message_yes.open;
t_do_shenhe_fee.Parameters[0].value:=employee;
t_do_shenhe_fee.open;
t_do_shenhe_other.open;
finally
LocalIp:=GetLocalIP;
SetBroadCastIP;
SendlogIn();
end;
Image4.Picture.LoadFromFile(ExtractFilePath(ParamStr(0))+'wall.jpg');
begin
{ if not if_open('003') then
begin
dxbar_main.Groups[2].Items[0].Enabled:=false;
end;
if not if_open('002') then
begin
dxbar_main.Groups[2].Items[1].Enabled:=false;
end;
if not if_open('001') then
begin
dxbar_main.Groups[2].Items[2].Enabled:=false;
end;
if not if_open('004') then
begin
dxbar_main.Groups[2].Items[3].Enabled:=false;
end;
if not if_open('139') then
begin
dxbar_main.Groups[2].Items[4].Enabled:=false;
end;
}
end;
G_ZWCHK:=get_parameters_value(109,'FALSE') ;
G_Arrivdate:=get_parameters_value(110,'false') ;
orderState:=get_parameters_value(114,'<27><><EFBFBD><EFBFBD>') ;
backstate:=get_parameters_value(113,'<27>˲<EFBFBD>') ;
showRpitem ;
for i:=0 to dxbar_main.GroupCount-1 do
begin
for j:=0 to dxbar_main.Groups[i].ItemCount-1 do
begin
if dxbar_main.Groups[i].Items[j].Caption='<27><>ҵ<EFBFBD><D2B5>Ϣά<CFA2><CEAC>' then
if not if_open('003') then dxbar_main.Groups[i].Items[j].Enabled:=false ;
if dxbar_main.Groups[i].Items[j].Caption='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>' then
if not if_open('002') then dxbar_main.Groups[i].Items[j].Enabled:=false;
if dxbar_main.Groups[i].Items[j].Caption='Ȩ<><C8A8><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>' then
if not if_open('001') then dxbar_main.Groups[i].Items[j].Enabled:=false;
if dxbar_main.Groups[i].Items[j].Caption='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣά<CFA2><CEAC>' then
if not if_open('004') then dxbar_main.Groups[i].Items[j].Enabled:=false;
if dxbar_main.Groups[i].Items[j].Caption='ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
if not if_open('139') then dxbar_main.Groups[i].Items[j].Enabled:=false;
end ;
end ;
end;
procedure Tfrm_tmain.dbBeforeConnect(Sender: TObject);
begin
db.ConnectionString:=connect_string('main.ini');
end;
procedure Tfrm_tmain.bsSkinButton1Click(Sender: TObject);
var i,ChartMan :integer ;
Mybook :TBookmark ;
empMsg:string ;
begin
if trim(Memo1.text)=''then exit;
empmsg:='' ;
MYbook:=t_chat_man.GetBookmark ;
t_chat_man.DisableControls ;
t_chat_man.First ;
while not t_chat_man.Eof do
begin
if t_chat_man.FieldByName('<27><><EFBFBD><EFBFBD>').AsBoolean then
ChartMan:=ChartMan+1 ;
t_chat_man.next ;
end ;
if bsSkinCheckRadioBox1.Checked then
begin
if ChartMan<=0 then
begin
showmessage('<27><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>˽<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>󣡣<EFBFBD>');
t_chat_man.GotoBookmark(myBook);
t_chat_man.FreeBookmark(MyBook);
t_chat_man.EnableControls ;
exit;
end;
t_chat_man.First ;
while not t_chat_man.eof do
begin
if t_chat_man.fieldbyname('<27><><EFBFBD><EFBFBD>').asBoolean then
begin
SendMsg_pri(t_chat_man.fieldbyname('<27><><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>').asstring,trim(Memo1.text));
empmsg:=empmsg+' '+'['+t_chat_man.fieldbyname('<27><><EFBFBD><EFBFBD>ְԱ').asstring+']' ;
end;
t_chat_man.next;
end;
ChatMsgRichEdit.lines.add('<27><><EFBFBD><EFBFBD>'+empmsg+'˵<><CBB5>('
+datetimetostr(now)+')'+trim(Memo1.text));
end
else
begin
SendMsg_all(trim(Memo1.text));
ChatMsgRichEdit.lines.add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>('+datetimetostr(now)+')'+trim(Memo1.text));
end;
t_chat_man.GotoBookmark(myBook);
t_chat_man.FreeBookmark(MyBook);
t_chat_man.EnableControls ;
Memo1.text:='';
end;
procedure Tfrm_tmain.Memo1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
key:=#0;
frm_main.bsSkinButton1Click(Sender);
end;
end;
procedure Tfrm_tmain.RxDBLookupCombo1KeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
begin
key:=#0;
Memo1.SetFocus;
end;
end;
procedure Tfrm_tmain.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_tmain.Panel3Resize(Sender: TObject);
begin
Label2.Top:=Panel3.height-40;
Label3.Top:=Panel3.height-22;
Label2.left:=Panel3.Width-Label2.Width-10;
Label3.left:=Panel3.Width-Label2.Width-10+(Label2.Width-Label3.Width);
end;
procedure Tfrm_tmain.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' ;
end;
procedure Tfrm_tmain.N1Click(Sender: TObject);
var mybook:tbookmark ;
begin
mybook:=t_chat_man.GetBookmark ;
t_chat_man.DisableControls ;
t_chat_man.First ;
while not t_chat_man.Eof do
begin
if t_chat_man.FieldByName('<27><><EFBFBD><EFBFBD>').asboolean=true then
begin
t_chat_man.Edit ;
t_chat_man.FieldByName('<27><><EFBFBD><EFBFBD>').asboolean:=false ;
t_chat_man.Post ;
end ;
t_chat_man.Next ;
end ;
t_chat_man.GotoBookmark(mybook);
t_chat_man.FreeBookmark(mybook);
t_chat_man.EnableControls ;
end;
procedure Tfrm_tmain.N2Click(Sender: TObject);
begin
ChatMsgRichEdit.Text :='' ;
end;
procedure Tfrm_tmain.dxDBGrid4Exit(Sender: TObject);
begin
if t_chat_man.State in [dsedit,dsinsert] then t_chat_man.post ;
end;
end.