-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainDef.pas
More file actions
151 lines (135 loc) · 4.21 KB
/
MainDef.pas
File metadata and controls
151 lines (135 loc) · 4.21 KB
1
2
3
4
5
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
unit MainDef;
interface
uses
Windows, Messages, Classes, SysUtils, Graphics, Controls, StdCtrls, Forms,
Dialogs, DBCtrls, DB, DBGrids, DBTables, Grids, Mask, ExtCtrls, Variants,
dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxDBGrid, dxCntner, Buttons,BDE,
dxExEdtr, rvNavigator, ShlObj,Registry,ShellAPI;
const
ProgramBilgi : string = 'ARI Personel Takip Sistemi v1.0.0';
ProgramAlias : string = 'ARI';
ProgVersiyonLabel : string ='v1.0.0';
ProgramVersiyon : string ='100';
DatabaseVersiyon : string ='100';
ServerRoot : string = '\Software\ARI\';
CRLF = #13 + #10;
// procedure ComponentArranger(sender : TForm);
function ComputerName : string;
function CheckServer : string;
procedure Send_EMAIL(ToKime,ccKime,Konu,Body,Attachment : string);
implementation
procedure Send_EMAIL(ToKime,ccKime,Konu,Body,Attachment : string);
var
Komut: string;
begin
Komut:='mailto:'+ToKime+'?Subject='+Konu+'&cc='+ccKime+'&body='+Body+'&Attach='+AnsiQuotedstr(Attachment,'"');
ShellExecute(0, nil, PChar(Komut), nil, nil, SW_SHOWDEFAULT);
end;
function ServerAdGir : string;
begin
Result := InputBox('Server Tanýmlama','ServerAdý : (BilgisayarAd)','localhost');
end;
function CheckServer : string;
var
Reg : TRegistry;
ServerName, AliasName : string;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
if not Reg.KeyExists(ServerRoot) then
begin
ServerName := ServerAdGir;
(*** Aldýðýmýz kodu registerye yazýyoruz***)
if Reg.CreateKey(ServerRoot) then
begin
Reg.OpenKey(ServerRoot,False);
Reg.WriteString('ServerName',ServerName);
Reg.WriteString('Alias','ARI');
Result := ServerName +':' +'ARI';
end else
begin
Showmessage('Server tanimlanamadi manuel degisiklik yapiniz...');
end;
end else
begin
Reg.OpenKey(ServerRoot,False);
ServerName := Reg.ReadString('ServerName');
AliasName := Reg.ReadString('Alias');
Result := ServerName+':'+AliasName;
end;
finally
Reg.Free;
end;
if (ParamStr(1) = '/E') or (ParamStr(1) = 'E') then
Result := 'ARI';
if ParamStr(2) <> '' then
Result := ExtractFilePath(ParamStr(0))+ParamStr(2);
end;
function ComputerName: String;
var
Len: DWord;
S: PChar;
begin
Len := MAX_COMPUTERNAME_LENGTH + 1;
GetMem(S, Len);
if GetComputerName(S, Len) then
Result := S
else
raise Exception.Create('Bilgisayar adýna eriþilemiyor');
FreeMem(S, Len);
end;
(*
procedure ComponentArranger(sender : TForm);
var I : Integer;
Temp : TComponent;
begin
with Sender do
begin
for I :=0 to ComponentCount - 1 do
begin
Temp := Components[I];
if (Temp is TTable) then TTable(Components[I]).Close;
if (Temp is TQuery) then TQuery(Components[I]).Close;
end;
for I :=0 to ComponentCount - 1 do
begin
Temp := Components[I];
if (Temp is TrvNavigator) then
begin
if Temp.Name <> 'AnaNav' then
begin
TrvNavigator(Components[I]).Hints := MainForm.AnaNav.Hints;
TrvNavigator(Components[I]).ShowHint := True;
end;
end else
if (Temp is TDBNavigator) then
begin
TDBNavigator(Components[I]).Hints := MainForm.AnaNav.Hints;
TDBNavigator(Components[I]).ShowHint := True;
end else
if (Temp is TTable) then
begin
if TTable(Components[I]).Active then TTable(Components[I]).Active := False;
TTable(Components[I]).DatabaseName := ProgramAlias;
end else
if (Temp is TQuery) then
begin
if TQuery(Components[I]).Active then TQuery(Components[I]).Active := False;
TQuery(Components[I]).DatabaseName := ProgramAlias;
end else
if (Temp is TdxDbGrid) then
begin
TdxDbGrid(Components[I]).PopUpMenu := MainForm.GridPopupMenu;
end;
end;
for I :=0 to ComponentCount - 1 do
begin
Temp := Components[I];
if (Temp is TTable) then TTable(Components[I]).Open;
if (Temp is TQuery) then TQuery(Components[I]).Open;
end;
end;
end;
*)
end.