unit U_CLNoteEdit;

interface

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

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

var
  frmCLNoteEdit: TfrmCLNoteEdit;

implementation

{$R *.dfm}

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

procedure TfrmCLNoteEdit.FormCreate(Sender: TObject);
begin
  CLNote.text:='';
end;

procedure TfrmCLNoteEdit.Button1Click(Sender: TObject);
begin

  try
    with ADOQueryCmd do
    begin
      Close;
      sql.Clear;
      sql.Add(' update Claims_Main   ');
      sql.Add(' set  CLNote=''' + Trim(CLNote.text) + '''');
      sql.Add(' where  EXISTS(select X.RTValue from [dbo].[F_Tool_SplitString](' + quotedstr(FFFIDS) + ','','')  X where X.RTValue=Claims_Main.ClaMid) ');
      ExecSQL;
    end;
    ModalResult := 1;
  except
    application.MessageBox(PChar(Exception(ExceptObject).Message), 'ΜαΚΎΠΕΟ’', 0);

  end;
end;

end.

