unit frmUnit11; interface uses Windows, Variants, Classes, Controls, Forms, SysUtils, ddPlugin_TLB, StdCtrls, RzEdit, RzBtnEdt, Vcl.Mask; type TformStavSklHromZmeny = class(TForm) btnOK: TButton; btnStorno: TButton; GroupBox1: TGroupBox; Label1: TLabel; Label2: TLabel; Label3: TLabel; cbJedenRadek: TCheckBox; Label4: TLabel; Label5: TLabel; cbMin: TComboBox; edtMin: TRzNumericEdit; edtMax: TRzNumericEdit; cbMax: TComboBox; Label6: TLabel; cbBlokVal: TComboBox; cbBlok: TComboBox; cbVCVal: TComboBox; cbVC: TComboBox; Label7: TLabel; Label8: TLabel; cbKontace: TComboBox; selKontace: TRzButtonEdit; Label9: TLabel; edtPrumer: TRzNumericEdit; cbPrumer: TComboBox; procedure btnStornoClick(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure selKontaceButtonClick(Sender: TObject); procedure FormShow(Sender: TObject); procedure btnOKClick(Sender: TObject); private public Helios : IHelios; arrId: TArray; end; var formStSklHrZmen: TformStavSklHromZmeny; oVar1, oVar2: OleVariant; implementation uses helUtils; {$R *.dfm} procedure TformStavSklHromZmeny.btnOKClick(Sender: TObject); var i: integer; lSQL: WideString; id: ShortString; begin if Length(arrId)>0 then begin for i:=Low(arrId) to High(arrId) do begin id:= IntToStr(arrId[i]); lSQL:= ''; if cbMin.ItemIndex=0 then lSQL:= lSQL + 'Minimum=' + StringReplace(FloatToStr(edtMin.Value),'','',[rfReplaceAll]) + ','; if cbMax.ItemIndex=0 then lSQL:= lSQL + 'Maximum=' + StringReplace(FloatToStr(edtMax.Value),'','',[rfReplaceAll]) + ','; if cbPrumer.ItemIndex=0 then lSQL:= lSQL + 'PrumerZadany=' + StringReplace(FloatToStr(edtPrumer.Value),'','',[rfReplaceAll]) + ','; if cbBlok.ItemIndex=0 then lSQL:= lSQL + 'Blokovano=' + IntToStr(cbBlokVal.ItemIndex) + ','; if cbVC.ItemIndex=0 then begin lSQL:= lSQL + 'KontrolaVC=N'''; case cbVCVal.ItemIndex of 0: lSQL:= lSQL + 'N'; 1: lSQL:= lSQL + 'A'; 2: lSQL:= lSQL + 'B'; end; lSQL:= lSQL + ''','; end; if cbKontace.ItemIndex=0 then lSQL:= lSQL + 'UKod=' + Trim(selKontace.Text) + ','; if (lSQL<>'') then SetLength(lSQL,Length(lSQL)-1); lSQL:= 'UPDATE ' + tblSS + ' SET ' + lSQL + ' WHERE id=' + id; try Helios.ExecSQL(lSQL); except on E:Exception do Helios.ExecSQL('INSERT #TabExtKom VALUES (N' + QuotedStr('Nelze aktualizovat záznam id ' + id + ' : ' + E.ClassName + ' : ' + E.Message) + ')'); end; end; end; end; procedure TformStavSklHromZmeny.btnStornoClick(Sender: TObject); begin Close; end; procedure TformStavSklHromZmeny.FormClose(Sender: TObject; var Action: TCloseAction); begin Action:= caFree; end; procedure TformStavSklHromZmeny.FormShow(Sender: TObject); var lSQL: WideString; edtCol, idx: integer; begin Self.Icon.Handle:= Helios.MainApplicationIconHandle; {$REGION 'Nastav FontSize a edit Col'} edtCol:= $FFFF; // clYellow with Helios.OpenSQL('SELECT BarvaPodbarveni FROM ' + tblUziv + ' WHERE BarevnePodbarveni=1 AND LoginName=N' + QuotedStr(Helios.LoginName)) do if RecordCount>0 then edtCol:= StrToInt(VarToStr(FieldValues(0))); Self.Font.Name:= Helios.Font; Self.Font.Height:= Helios.FontHeight; idx:= 0; while idx