Prvni verze
This commit is contained in:
64
frmAktSarze.pas
Normal file
64
frmAktSarze.pas
Normal file
@ -0,0 +1,64 @@
|
||||
unit frmAktSarze;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
||||
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, ddPlugin_TLB,
|
||||
Vcl.StdCtrls, Vcl.Mask;
|
||||
|
||||
type
|
||||
TformAktSarze = class(TForm)
|
||||
Panel1: TPanel;
|
||||
edtSmena: TLabeledEdit;
|
||||
edtVyrDen: TLabeledEdit;
|
||||
edtSarze: TLabeledEdit;
|
||||
edtSpotreba: TLabeledEdit;
|
||||
procedure FormShow(Sender: TObject);
|
||||
private
|
||||
public
|
||||
Helios: IHelios;
|
||||
vyrDen: TDateTime;
|
||||
smena: integer;
|
||||
idKmen: integer;
|
||||
end;
|
||||
|
||||
var
|
||||
formAktSarze: TformAktSarze;
|
||||
|
||||
implementation
|
||||
uses System.StrUtils, System.Math, System.DateUtils,
|
||||
helUtils;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TformAktSarze.FormShow(Sender: TObject);
|
||||
var zarukaTyp: integer;
|
||||
zarukaNum: extended;
|
||||
d: TDateTime;
|
||||
begin
|
||||
edtVyrDen.Text:= FormatDateTime('dd.mm.yyyy', vyrDen);
|
||||
edtSmena.Text:= smena.ToString;
|
||||
edtSarze.Text:= helUtils.getHeliosStrVal(Helios, '', 'SELECT dbo.ef_Vyroba_VratCisloSarze (default, default, 0)');
|
||||
edtSpotreba.Text:= '';
|
||||
|
||||
if (idKmen>0) then
|
||||
begin
|
||||
zarukaNum:= helUtils.getHeliosFloatVal(Helios, 0, 'SELECT ZarukaVystup FROM ' + tblKZ + ' WHERE ID=' + idKmen.ToString);
|
||||
zarukaTyp:= helUtils.getHeliosIntVal(Helios, 0, 'SELECT TypZarukaVystup FROM ' + tblKZ + ' WHERE ID=' + idKmen.ToString); // 0-Den, 1-Mesic, 2-Rok
|
||||
d:= vyrDen;
|
||||
if (zarukaTyp=0) then
|
||||
d:= IncDay(Now, Floor(zarukaNum));
|
||||
if (zarukaTyp=1) then
|
||||
d:= IncMonth(Now, Floor(zarukaNum));
|
||||
if (zarukaTyp=2) then
|
||||
d:= IncYear(Now, Floor(zarukaNum));
|
||||
d:= EndOfTheMonth(d);
|
||||
|
||||
edtSpotreba.Text:= FormatDateTime('dd.mm.yyyy', d);
|
||||
end;
|
||||
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
Reference in New Issue
Block a user