Repository navigation
Expand file tree
/
Copy pathMyUtils.pas
More file actions
107 lines (95 loc) · 1.91 KB
/
Copy pathMyUtils.pas
File metadata and controls
107 lines (95 loc) · 1.91 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
unit MyUtils;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls,DB,
CommCtrl;
Function Kodesatker(satker:string): String;
procedure IsiJabatan(cmb:TComboBox);
procedure IsiPangkat(cmdpangkat:TComboBox);
procedure isiSatker(tcombo:TCombobox);
implementation
uses Modulsrc;
procedure IsiSatker(tcombo:TCombobox);
var
i:integer;
begin
tcombo.Items.Clear;
tcombo.Text:='';
with dm,qtemp do
begin
close;
sql.Clear;
sql.Text:='select nama_satker from tbl_satker order by id_satker asc';
prepare;
Open;
while not Eof do
begin
tcombo.Items.Add(fields.Fields[0].AsString);
Next;
end;
end;
end;
Function Kodesatker(Satker:string):string;
var
i:integer;
begin
with Dm,Qexec do
begin
close;
sql.Clear;
sql.Text:='Select id_satker Where Nama_satker=:ast';
prepare;
parambyname('ast').Value:=Satker;
Open;
result:=Fields[0].AsString;
end;
end;
Procedure IsiJabatan(cmb:TComboBox);
var
i:integer;
maxi:integer;
begin
with Dm do
begin
for i := 1 to 17 do
begin
if tbljabatanjabatan.AsString<>'-' then
begin
cmb.Items.Add(tbljabatanjabatan.AsString);
end;
tbljabatan.Next;
end;
end;
end;
procedure isiPangkat(cmdpangkat:TCombobox);
var
i:integer;
maxi:integer;
begin
cmdpangkat.Items.Clear;
with Dm do
begin
for i := 1 to 17 do
begin
cmdpangkat.Items.Add(tbljabatanpangkat.AsString);
tbljabatan.Next;
end;
end;
end;
{
procedure SelCombo(sql:ansiString;Q:TSQLQuery; var Combo:TComboBox);
var i: integer;
begin
Q.Close;
Q.SQL.Text:='';
Q.Open(sql);
Combo.Text:='';
while not Q.Eof do begin
Combo.Items.Add(Q.Fields.Fields[0].AsString);
Q.Next;
end;
Q.Close;
end;
}
end.