unit U_GYSelect;

interface

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

type
  TfrmGYSelect = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
    DYNote: TMemo;
    adoquery1: TADOQuery;
    PopupMenu1: TPopupMenu;
    N1: TMenuItem;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormDestroy(Sender: TObject);
    procedure N1Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
    procedure Button3Click(Sender: TObject);
    procedure Button3MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
    procedure Button2Click(Sender: TObject);
    procedure Button2MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
    procedure Button4Click(Sender: TObject);
    procedure Button4MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmGYSelect: TfrmGYSelect;

implementation

uses
  U_DataLink, U_Fun10, U_BPZdy_SH, U_BPZdy_HXK, U_ZDYHelp, U_BPZdy_LRYH,
  U_BPZdy_LRTJ, U_BPZdy_LRGX, U_BPZdy_LRXH;
{$R *.dfm}

procedure TfrmGYSelect.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caFree;
end;

procedure TfrmGYSelect.FormDestroy(Sender: TObject);
begin
  frmGYSelect := nil;
end;

procedure TfrmGYSelect.N1Click(Sender: TObject);
begin
  with ADOQuery1 do
  begin
    close;
    sql.Clear;
    sql.Add('select * from BP_DY where DYID=''HZGYK''');
    open;
  end;
  with ADOQuery1 do
  begin
    if IsEmpty then
    begin
      Append;
      fieldbyname('DYID').value := 'HZGYK';
    end
    else
      edit;
    fieldbyname('DYNote').value := trim(DYNote.Text);
    post;
  end;
  Application.MessageBox('保存成功', '提示');
end;

procedure TfrmGYSelect.Button1Click(Sender: TObject);
begin
  frmBPZDY_LRGX := TfrmBPZDY_LRGX.Create(Application);
  with frmBPZDY_LRGX do
  begin
    flag := 'GXName';
    flagName := '染色';
    CXGrid3.Visible := false;
    if ShowModal = 1 then
    begin

    end;
    Free;
  end;
end;

procedure TfrmGYSelect.Button1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  Panel2.Visible := false;
end;

procedure TfrmGYSelect.Button3Click(Sender: TObject);
begin
  frmBPZDY_LRTJ := TfrmBPZDY_LRTJ.Create(Application);
  with frmBPZDY_LRTJ do
  begin
    flag := 'TJName';
    flagName := '烫金';
    cxGrid3.Visible := false;
    if ShowModal = 1 then
    begin

    end;
    free;
  end;
end;

procedure TfrmGYSelect.Button3MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  with ADOQuery1 do
  begin
    close;
    sql.Clear;
    sql.Add('select * from BP_DY where DYID=''HZGYK''');
    open;
  end;
  DYNote.Text := Trim(ADOQuery1.fieldbyname('DYNote').AsString);
  Panel2.Visible := true;
end;

procedure TfrmGYSelect.Button2Click(Sender: TObject);
begin
  frmBPZdy_LRYH := TfrmBPZdy_LRYH.Create(Application);
  with frmBPZdy_LRYH do
  begin
    flag := 'YHName';
    flagName := '印花';
    cxGrid3.Visible := false;
    if ShowModal = 1 then
    begin

    end;
    Free;
  end;
end;

procedure TfrmGYSelect.Button2MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  Panel2.Visible := false;
end;

procedure TfrmGYSelect.Button4Click(Sender: TObject);
begin
  frmBPZdy_LRXH := TfrmBPZdy_LRXH.Create(Application);
  with frmBPZdy_LRXH do
  begin
    flag := 'XHName';
    flagName := '绣花';
    cxGrid3.Visible := false;
    if ShowModal = 1 then
    begin

    end;
    Free;
  end;
end;

procedure TfrmGYSelect.Button4MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  Panel2.Visible := false;
end;

end.

