76 lines
1.7 KiB
ObjectPascal
76 lines
1.7 KiB
ObjectPascal
|
|
unit U_TaxSet;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
|
|||
|
|
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics,
|
|||
|
|
cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxEdit,
|
|||
|
|
dxSkinsCore, dxSkinWXI, Vcl.ComCtrls, Vcl.ToolWin, cxLabel, cxTextEdit,
|
|||
|
|
U_DataLink, Data.DB, Data.Win.ADODB;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmTaxSet = class(TForm)
|
|||
|
|
CGDSL: TcxTextEdit;
|
|||
|
|
CRate: TcxTextEdit;
|
|||
|
|
COrtherRate: TcxTextEdit;
|
|||
|
|
cxLabel1: TcxLabel;
|
|||
|
|
cxLabel2: TcxLabel;
|
|||
|
|
cxLabel3: TcxLabel;
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
ToolButton3: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
ADOQuery1: TADOQuery;
|
|||
|
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmTaxSet: TfrmTaxSet;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmTaxSet.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTaxSet.ToolButton3Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
value: Double;
|
|||
|
|
begin
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
|
|||
|
|
for var i := 0 to ControlCount - 1 do
|
|||
|
|
begin
|
|||
|
|
if Controls[i] is TcxTextEdit then
|
|||
|
|
begin
|
|||
|
|
if TcxTextEdit(Controls[i]).Text <> '' then
|
|||
|
|
begin
|
|||
|
|
if not TryStrToFloat(TcxTextEdit(Controls[i]).Text, value) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
SQL.Add(' update sy_tax set value=' + QuotedStr(TcxTextEdit(Controls[i]).Text) + ' where type =' + QuotedStr(TcxTextEdit(Controls[i]).Name));
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
ModalResult := 1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|