unit U_ProcessTypeEdit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, DB, ADODB, Vcl.DBCtrls;

type
  TfrmProcessEdit = class(TForm)
    Panel1: TPanel;
    Button1: TButton;
    Label1: TLabel;
    Button2: TButton;
    ADOQueryMain: TADOQuery;
    ADOQueryTemp: TADOQuery;
    ADOQueryCmd: TADOQuery;
    ProcessType: TComboBox;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    FFFIDS: string;
    { Public declarations }
  end;

var
  frmProcessEdit: TfrmProcessEdit;

implementation

{$R *.dfm}

procedure TfrmProcessEdit.Button2Click(Sender: TObject);
begin
  Close;
end;

procedure TfrmProcessEdit.Button1Click(Sender: TObject);
begin
  if ProcessType.Text = '' then
  begin
    Application.MessageBox('请选择处理情况!', '提示', 0);
    Exit;
  end;

  try
    with ADOQueryCmd do
    begin
      Close;
      sql.Clear;
      sql.Add(' update Trade_Cloth_Inspect   ');
      sql.Add(' set  ProcessType=' + QuotedStr(ProcessType.Text));
      sql.Add(' where EXISTS(select X.RTValue from [dbo].[F_Tool_SplitString](' + quotedstr(FFFIDS) + ','','')  X where X.RTValue=Trade_Cloth_Inspect.CIID) ');
//      showmessage(sql.text);
      ExecSQL;
    end;
    ModalResult := 1;
  except
    application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0);

  end;
end;

end.

