unit U_InputReceiptType;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, DB, ADODB, cxGraphics, cxControls, cxLookAndFeels,
  cxLookAndFeelPainters, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
  cxDropDownEdit;

type
  TfrmInputReceiptType = class(TForm)
    Panel1: TPanel;
    Button1: TButton;
    cxComboBox1: TcxComboBox;
    FHDBCIONo: TEdit;
    ADOQueryCmd: TADOQuery;
    procedure Button1Click(Sender: TObject);
    procedure FHDBCIONoKeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    FFFIDS: string;
    { Public declarations }
  end;

var
  frmInputReceiptType: TfrmInputReceiptType;

implementation

{$R *.dfm}

procedure TfrmInputReceiptType.Button1Click(Sender: TObject);
begin
  ModalResult := 1;
end;

procedure TfrmInputReceiptType.FHDBCIONoKeyPress(Sender: TObject; var Key: Char);
begin
  if Key = #13 then
  begin
    if trim(FHDBCIONo.Text) = '' then
      exit;

    try
      with ADOQueryCmd do
      begin
        Close;
        sql.Clear;
        sql.Add('update BS_Cloth_IO         ');
        sql.Add(' set ReceiptType=' + quotedstr(frmInputReceiptType.cxComboBox1.Text));
        sql.Add(' where  BCIONo=' + QuotedStr(Trim(FHDBCIONo.text)));
        ExecSQL;
      end;
    except
    end;
    FHDBCIONo.Text := '';
  end;

end;

end.

