unit p_stocklist2;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  RzButton, ExtCtrls, RzPanel, cxGridLevel, cxGridCustomTableView,
  cxGridCardView, cxGridDBCardView, cxClasses, cxControls,
  cxGridCustomView, cxGrid, StdCtrls, cxStyles, cxPropertiesStore,
  cxGridTableView, cxGridDBTableView, Db, DBTables;

type
  Tf_stocklist2 = class(TForm)
    RzPanel1: TRzPanel;
    RzPanel2: TRzPanel;
    RzBitBtn1: TRzBitBtn;
    RzBitBtn2: TRzBitBtn;
    cxGrid1: TcxGrid;
    cxGrid1Level1: TcxGridLevel;
    Edit1: TEdit;
    cxStyleRepository1: TcxStyleRepository;
    cxStyle1: TcxStyle;
    cxGrid1DBTableView1: TcxGridDBTableView;
    cxStyle2: TcxStyle;
    Query1: TQuery;
    Query1BARCODE: TStringField;
    Query1DESCR1: TStringField;
    Query1PACK: TFloatField;
    Query1PRICE1: TFloatField;
    Query1PRICE2: TFloatField;
    DataSource1: TDataSource;
    cxGrid1DBTableView1BARCODE: TcxGridDBColumn;
    cxGrid1DBTableView1DESCR1: TcxGridDBColumn;
    cxGrid1DBTableView1PACK: TcxGridDBColumn;
    cxGrid1DBTableView1PRICE1: TcxGridDBColumn;
    cxGrid1DBTableView1PRICE2: TcxGridDBColumn;
    procedure Edit1Change(Sender: TObject);
    procedure cxGrid1DBCardView1CellClick(Sender: TcxCustomGridTableView;
      ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
      AShift: TShiftState; var AHandled: Boolean);
    procedure FormShow(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  f_stocklist2: Tf_stocklist2;myenter:integer;

implementation

uses p_posmodule;


{$R *.DFM}

procedure Tf_stocklist2.Edit1Change(Sender: TObject);
begin
try
query1.close;
query1.ParamByName('mydescr').AsString:=edit1.Text;
query1.open;
except
query1.ParamByName('mydescr').AsString:='';
query1.open;
end;
end;

procedure Tf_stocklist2.cxGrid1DBCardView1CellClick(
  Sender: TcxCustomGridTableView;
  ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
  AShift: TShiftState; var AHandled: Boolean);
begin
modalresult:=mrok;
end;

procedure Tf_stocklist2.FormShow(Sender: TObject);
begin
//if myenter=1 then
RzBitBtn2.Default:=true;
edit1.SetFocus;

end;

procedure Tf_stocklist2.FormCreate(Sender: TObject);
begin
myenter:=0;
end;

end.
