-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathuChangeRate.pas
142 lines (120 loc) · 2.59 KB
/
uChangeRate.pas
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
unit uChangeRate;
(*
121207 - checked for ww - OK
130206 - Jóel
Breytti textum sjá excel skjal
*)
interface
uses
Windows
, Messages
, SysUtils
, Variants
, Classes
, Graphics
, Controls
, Forms
, Dialogs
, StdCtrls
, Buttons
, ExtCtrls
, Menus
, hdata
, uAppglobal
, ug
, ud
, _glob
, cxGraphics
, cxControls
, cxLookAndFeels
, cxLookAndFeelPainters
, cxContainer
, cxEdit
, cxTextEdit
, cxMaskEdit
, cxLabel, Vcl.Mask, sMaskEdit, sCustomComboEdit, sCurrEdit, sButton, sPanel, sLabel
;
type
TfrmChangeRate = class(TForm)
Panel1: TsPanel;
edRate: TsCalcEdit;
btnSave: TsButton;
btnGetFromWeb: TsButton;
cxButton1: TsButton;
cxLabel1: TsLabel;
cxLabel2: TsLabel;
cxLabel3: TsLabel;
labCurrency: TsLabel;
btnOK: TsButton;
btnCancel: TsButton;
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure btnSaveClick(Sender: TObject);
procedure btnGetFromWebClick(Sender: TObject);
procedure cxButton1Click(Sender: TObject);
procedure cxButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
zCurrency : string;
zRate : double;
end;
var
frmChangeRate: TfrmChangeRate;
implementation
{$R *.dfm}
uses
PrjConst
,uDImages
, uUtils
, UITypes
;
procedure TfrmChangeRate.btnGetFromWebClick(Sender: TObject);
begin
showmessage(GetTranslatedText('shTx_UnderDevelopment'));
end;
procedure TfrmChangeRate.FormCreate(Sender: TObject);
begin
RoomerLanguage.TranslateThisForm(self);
glb.PerformAuthenticationAssertion(self);
PlaceFormOnVisibleMonitor(self);
//**
zRate := 0.000 ;
zCurrency := '';
end;
procedure TfrmChangeRate.FormShow(Sender: TObject);
begin
//**
edRate.text := floatTostr(zRate);
labCurrency.caption := zCurrency ;
end;
procedure TfrmChangeRate.btnSaveClick(Sender: TObject);
var
Rate : double;
begin
if MessageDlg(GetTranslatedText('shTx_SaveToCurrencytable')+zCurrency,
mtConfirmation, [mbYes, mbNo], 0) = mrYes then
begin
Rate := _strToFloat(edRate.text);
if not hdata.UPD_currencyRate(zCurrency,rate) then
begin
showmessage(GetTranslatedText('shTx_CurrencyUpdateError'))
end else
begin
glb.ForceTableRefresh;
end;
end;
end;
procedure TfrmChangeRate.cxButton1Click(Sender: TObject);
var
rate : double;
begin
rate := GetRate(zCurrency);
edRate.text := floatTostr(rate);
end;
procedure TfrmChangeRate.cxButton2Click(Sender: TObject);
begin
zRate := _strToFloat(edRate.Text);
end;
end.