unit U_OutPutHelp;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, DB, ADODB,   
      
     
     
     
    
    
    
    
    
    
     
      
    
    
    
     cxGraphics, cxLookAndFeels,
  cxLookAndFeelPainters, Vcl.Menus, cxButtons, cxControls, cxContainer, cxEdit,
  cxTextEdit, cxCurrencyEdit;

type
  TfrmOutPutHelp = class(TForm)
    Panel1: TPanel;
    ADOQueryMain: TADOQuery;
    ADOQueryTemp: TADOQuery;
    ADOQueryCmd: TADOQuery;
    cxButton1: TcxButton;
    Label21: TLabel;
    Price: TcxCurrencyEdit;
    Label1: TLabel;
    Reward: TcxCurrencyEdit;
    Label2: TLabel;
    Fine: TcxCurrencyEdit;
    procedure cxButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    FGOIDS: string;
    { Public declarations }
  end;

var
  frmOutPutHelp: TfrmOutPutHelp;

implementation

{$R *.dfm}

procedure TfrmOutPutHelp.cxButton1Click(Sender: TObject);
begin
  if StrToFloatDef(Fine.Text, 0) = 0 then
    Fine.Text := '0';
  if StrToFloatDef(Reward.Text, 0) = 0 then
    Reward.Text := '0';
  if StrToFloatDef(Price.Text, 0) = 0 then
    Price.Text := '0';
  try
    with ADOQueryCmd do
    begin
      Close;
      sql.Clear;
      sql.Add(' update Tat_Plan_OutPut   ');
      sql.Add(' set  OutMoney=' + Price.Text + '*Qty+' + Reward.Text + '-' + Fine.Text);
      sql.Add(' ,  Price=' + Price.Text);
      sql.Add(' ,  Reward=' + Reward.Text);
      sql.Add(' ,  Fine=' + Fine.Text);
      sql.Add(' where EXISTS(select X.RTValue from [dbo].[F_Tool_SplitString](' + quotedstr(FGOIDS) + ','','')  X where X.RTValue=Tat_Plan_OutPut.GOID) ');

      ExecSQL;
    end;
    ModalResult := 1;
  except
    application.MessageBox(PChar(Exception(ExceptObject).Message), 'ΜαΚΎΠΕΟ’', 0);

  end;
end;

end.

