unit U_YPTypeHelpCP;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit,
  cxInplaceContainer, cxDBTL, cxControls, cxTLData, DB, ADODB, cxLookAndFeels,
  cxLookAndFeelPainters, cxTLdxBarBuiltInMenu, 
  dxSkinsDefaultPainters;

type
  TfrmYPTypeHelpCP = class(TForm)
    ADOConnection1: TADOConnection;
    cxDBTreeList1: TcxDBTreeList;
    cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn;
    DataSource1: TDataSource;
    ADOQueryHelp: TADOQuery;
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure cxDBTreeList1DblClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmYPTypeHelpCP: TfrmYPTypeHelpCP;

implementation

uses
  U_DataLink;
{$R *.dfm}

procedure TfrmYPTypeHelpCP.FormCreate(Sender: TObject);
begin
  cxDBTreeList1.Align := alclient;
  try
    with ADOConnection1 do
    begin
      Connected := false;
      ConnectionString := DConString;
      //ConnectionString:='';
      Connected := true;
    end;
  except
  end;
end;

procedure TfrmYPTypeHelpCP.FormShow(Sender: TObject);
begin
  with ADOQueryHelp do
  begin
    Close;
    SQL.Clear;
    SQL.Add('select * from BS_Cloth_Type order by CTlevel,CTOrder,CTName');
    Open;
  end;
  cxDBTreeList1.Items[0].Expand(false);

end;

procedure TfrmYPTypeHelpCP.cxDBTreeList1DblClick(Sender: TObject);
begin
  if ADOQueryHelp.IsEmpty then
    exit;
  ModalResult := 1;
end;

end.

