unit p_mynotes;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, DBCtrls, cxGridCustomTableView, cxGridCardView,
  cxGridDBCardView, Db, DBTables, RzButton, ExtCtrls, RzPanel, cxGridLevel,
  cxClasses, cxControls, cxGridCustomView, cxGrid, Buttons, IvDictio,
  IvMulti;

type
  Tf_mynotes = class(TForm)
    cxGrid1: TcxGrid;
    cxGrid1DBCardView1: TcxGridDBCardView;
    cxGrid1Level1: TcxGridLevel;
    RzPanel1: TRzPanel;
    RzPanel2: TRzPanel;
    RzBitBtn1: TRzBitBtn;
    RzBitBtn2: TRzBitBtn;
    Query1: TQuery;
    DataSource1: TDataSource;
    Query1ID: TIntegerField;
    Query1MID: TIntegerField;
    Query1DESCR: TStringField;
    cxGrid1DBCardView1DESCR: TcxGridDBCardViewRow;
    Label1: TLabel;
    DBMemo1: TDBMemo;
    SpeedButton1: TSpeedButton;
    cxGrid1DBCardView1Row1: TcxGridDBCardViewRow;
    cxGrid1DBCardView1Row2: TcxGridDBCardViewRow;
    IvTranslator1: TIvTranslator;
    procedure cxGrid1DBCardView1CellClick(Sender: TcxCustomGridTableView;
      ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
      AShift: TShiftState; var AHandled: Boolean);
    procedure RzBitBtn1Click(Sender: TObject);
    procedure RzBitBtn2Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    procedure SpeedButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  f_mynotes: Tf_mynotes;

implementation

uses p_posmodule;

{$R *.DFM}

procedure Tf_mynotes.cxGrid1DBCardView1CellClick(
  Sender: TcxCustomGridTableView;
  ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
  AShift: TShiftState; var AHandled: Boolean);
begin
posmodule.itemsinfo.edit;
dbmemo1.Lines.Add(query1descr.AsString);
posmodule.itemsinfo.post;
AHandled:=true;
end;

procedure Tf_mynotes.RzBitBtn1Click(Sender: TObject);
begin
posmodule.itemsinfo.ApplyUpdates;
close;
end;

procedure Tf_mynotes.RzBitBtn2Click(Sender: TObject);
begin
posmodule.itemsinfo.cancelUpdates;
close;
end;

procedure Tf_mynotes.FormShow(Sender: TObject);
begin
query1.open;
posmodule.itemsinfo.open
end;

procedure Tf_mynotes.FormCloseQuery(Sender: TObject;
  var CanClose: Boolean);
begin
query1.close;
posmodule.itemsinfo.close;
end;

procedure Tf_mynotes.SpeedButton1Click(Sender: TObject);
begin
 posmodule.itemsinfo.edit;
dbmemo1.Lines.Text:=' ';
posmodule.itemsinfo.post;
end;

end.
