unit U_CheJianXS;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData,
  cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB,
  cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses, cxControls,
  cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
  cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter, RM_Dataset, RM_System,
  RM_Common, RM_Class, RM_GridReport, RM_e_Xls, Menus, MovePanel, cxTextEdit,
  cxContainer, cxCurrencyEdit, BtnEdit, RM_e_main, RM_e_htm, RM_e_Graphic,
  RM_e_Jpeg, RM_e_txt, RM_e_csv, RM_E_llPDF, Math, cxPC, cxLookAndFeels,
  cxLookAndFeelPainters, cxNavigator, cxButtonEdit;

type
  TfrmCheJianXS = class(TForm)
    ToolBar1: TToolBar;
    TBRafresh: TToolButton;
    TBClose: TToolButton;
    cxGridPopupMenu1: TcxGridPopupMenu;
    ADOQueryCmd: TADOQuery;
    ADOQueryMain: TADOQuery;
    ADOQueryTemp: TADOQuery;
    DataSource1: TDataSource;
    TBExport: TToolButton;
    Order_Main: TClientDataSet;
    Panel4: TPanel;
    Label11: TLabel;
    Panel10: TPanel;
    Image2: TImage;
    RichEdit1: TRichEdit;
    MovePanel2: TMovePanel;
    Cxgrid1: TcxGrid;
    Tv1: TcxGridDBTableView;
    v1OrdDate: TcxGridDBColumn;
    v1MLOrderNo: TcxGridDBColumn;
    v1MLConNo: TcxGridDBColumn;
    v1Column1: TcxGridDBColumn;
    v1MLCodeName: TcxGridDBColumn;
    v1KHName: TcxGridDBColumn;
    Cxgrid1Level1: TcxGridLevel;
    Panel1: TPanel;
    Label1: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label9: TLabel;
    Label12: TLabel;
    Label5: TLabel;
    Label7: TLabel;
    BegDate: TDateTimePicker;
    EndDate: TDateTimePicker;
    MLOrderNo: TEdit;
    KHNameHZ: TEdit;
    MLConNo: TEdit;
    MPRTKZ: TEdit;
    MLCodeName: TEdit;
    status: TComboBox;
    v1Column3: TcxGridDBColumn;
    ToolButton1: TToolButton;
    RMDBMain: TRMDBDataSet;
    RM1: TRMGridReport;
    ADOQueryPrint: TADOQuery;
    ToolButton2: TToolButton;
    Panel2: TPanel;
    Label6: TLabel;
    SMID: TEdit;
    cxGrid2: TcxGrid;
    Tv2: TcxGridDBTableView;
    v1XHNo: TcxGridDBColumn;
    v1MLColor: TcxGridDBColumn;
    v2Column1: TcxGridDBColumn;
    v2Column4: TcxGridDBColumn;
    v1MLColorNo: TcxGridDBColumn;
    v2Column2: TcxGridDBColumn;
    v1MLHX: TcxGridDBColumn;
    v1Qty: TcxGridDBColumn;
    v1QtyUnit: TcxGridDBColumn;
    cxGridLevel1: TcxGridLevel;
    DataSource2: TDataSource;
    Order_Sub: TClientDataSet;
    Panel3: TPanel;
    Label8: TLabel;
    Label10: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    Label16: TLabel;
    MXGYS2: TBtnEditC;
    DXGYS2: TBtnEditC;
    MXSeHao2: TEdit;
    DXSeHao2: TEdit;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Tv1Column1: TcxGridDBColumn;
    Tv1Column2: TcxGridDBColumn;
    Tv1Column3: TcxGridDBColumn;
    Label2: TLabel;
    Label17: TLabel;
    Label18: TLabel;
    Label19: TLabel;
    DXSeHao: TEdit;
    MXGYS: TEdit;
    DXGYS: TEdit;
    MXSeHao: TEdit;
    ToolButton3: TToolButton;
    ToolButton4: TToolButton;
    Button4: TButton;
    Label20: TLabel;
    Tv1Column4: TcxGridDBColumn;
    Label21: TLabel;
    Filler: TBtnEditC;
    procedure FormDestroy(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCreate(Sender: TObject);
    procedure TBCloseClick(Sender: TObject);
    procedure TBExportClick(Sender: TObject);
    procedure TBRafreshClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure Panel10MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
    procedure Image2Click(Sender: TObject);
    procedure Tv1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
    procedure MLOrderNoKeyPress(Sender: TObject; var Key: Char);
    procedure gangNOKeyPress(Sender: TObject; var Key: Char);
    procedure MLConNoKeyPress(Sender: TObject; var Key: Char);
    procedure TCBNORChange(Sender: TObject);
    procedure MLColorKeyPress(Sender: TObject; var Key: Char);
    procedure BegDateChange(Sender: TObject);
    procedure EndDateChange(Sender: TObject);
    procedure JYTypeChange(Sender: TObject);
    procedure KHNameHZChange(Sender: TObject);
    procedure ToolButton1Click(Sender: TObject);
    procedure ToolButton2Click(Sender: TObject);
    procedure SMIDKeyPress(Sender: TObject; var Key: Char);
    procedure MXGYS2BtnDnClick(Sender: TObject);
    procedure DXGYS2BtnDnClick(Sender: TObject);
    procedure MXGYS2BtnUpClick(Sender: TObject);
    procedure DXGYS2BtnUpClick(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure ToolButton3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure ToolButton4Click(Sender: TObject);
    procedure Tv2FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
    procedure FillerBtnUpClick(Sender: TObject);
  private
    DQdate: TDateTime;
    FLeft, FTop: Integer;
    CurrentPage, RecordsNumber: Integer;
    canshu1, FNewMLID, FNewSubid, FXSID: string;
    procedure InitGrid();
    procedure InitForm();
    { Private declarations }
  public
    FFInt: Integer;
    { Public declarations }
  end;

var
  frmCheJianXS: TfrmCheJianXS;

implementation

uses
  U_DataLink, U_Fun, U_ZDYHelp, U_KHGYSList;

{$R *.dfm}

procedure TfrmCheJianXS.FormDestroy(Sender: TObject);
begin
  frmCheJianXS := nil;
end;

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

procedure TfrmCheJianXS.FormCreate(Sender: TObject);
begin
  cxgrid1.Align := alClient;
  DQdate := SGetServerDate(ADOQueryTemp);
  canshu1 := Trim(DParameters1);
end;

procedure TfrmCheJianXS.TBCloseClick(Sender: TObject);
begin
  Close;
  WriteCxGrid('车间线色设置1', Tv1, '订单管理');
end;

procedure TfrmCheJianXS.InitGrid();
begin

  try
    ADOQueryMain.DisableControls;
    with ADOQueryMain do
    begin
      Filtered := False;
      Close;
      sql.Clear;
      sql.Add('select A.*,B.MLCodeName,B.MLConNo,B.MLOrderNo,C.MLColor ');
      sql.Add(',KHNameJC=(select KHNameJC from  KH_Main KM where KM.KHNO=B.KHNO) ');
      sql.Add(' from CheJianXS A inner join ML_OrderMainNew B on A.NewMLID =B.NewMLID');
      sql.Add('  inner join ML_OrderSubidNew C on A.NewSubid =C.NewSubid');
      sql.Add(' where A.Filltime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.Date)) + '''');
      sql.Add(' and A.Filltime<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.Date + 1)) + '''');
     // ShowMessage(SQL.Text);
      Open;
    end;
    SCreateCDS20(ADOQueryMain, Order_Main);
    SInitCDSData20(ADOQueryMain, Order_Main);
  finally
    ADOQueryMain.EnableControls;
  end;
end;

procedure TfrmCheJianXS.InitForm();
var
  fsj: string;
begin
  ReadCxGrid('车间线色设置1', Tv1, '订单管理');
  BegDate.DateTime := SGetServerDate10(ADOQueryTemp) - 1;
  EndDate.DateTime := SGetServerDate10(ADOQueryTemp);
  InitGrid();
end;

procedure TfrmCheJianXS.TBExportClick(Sender: TObject);
begin
  if ADOQueryMain.IsEmpty then
    Exit;
  SelExportData(Tv1, ADOQueryMain, '车间线色设置');
end;

procedure TfrmCheJianXS.TBRafreshClick(Sender: TObject);
begin
  toolbar1.SetFocus;
  InitGrid();
end;

procedure TfrmCheJianXS.FormShow(Sender: TObject);
begin
  InitForm();
end;

procedure TfrmCheJianXS.Panel10MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  ReleaseCapture;
  TWinControl(Panel4).Perform(WM_SYSCOMMAND, $F012, 0);
end;

procedure TfrmCheJianXS.Image2Click(Sender: TObject);
begin
  Panel4.Visible := False;
end;

procedure TfrmCheJianXS.Tv1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  FLeft := X;
  FTop := Y;
end;

procedure TfrmCheJianXS.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
begin
  Panel4.Left := FLeft;
  Panel4.Top := FTop + 110;
  Panel4.Visible := True;
  Panel4.Refresh;
  Panel10.Caption := Trim(TV1.Controller.FocusedColumn.Caption);
  RichEdit1.Text := Order_Main.fieldbyname(TV1.Controller.FocusedColumn.DataBinding.FilterFieldName).AsString;
end;

procedure TfrmCheJianXS.MLOrderNoKeyPress(Sender: TObject; var Key: Char);
begin
  if Key = #13 then
  begin
    InitGrid();
  end;
end;

procedure TfrmCheJianXS.gangNOKeyPress(Sender: TObject; var Key: Char);
begin
  if Key = #13 then
  begin
    InitGrid();
  end;
end;

procedure TfrmCheJianXS.MLConNoKeyPress(Sender: TObject; var Key: Char);
begin
  if Key = #13 then
  begin
    InitGrid();
  end;
end;

procedure TfrmCheJianXS.TCBNORChange(Sender: TObject);
begin
  InitGrid();
end;

procedure TfrmCheJianXS.MLColorKeyPress(Sender: TObject; var Key: Char);
begin
  InitGrid();
end;

procedure TfrmCheJianXS.BegDateChange(Sender: TObject);
begin
  InitGrid();
end;

procedure TfrmCheJianXS.EndDateChange(Sender: TObject);
begin
  InitGrid();
end;

procedure TfrmCheJianXS.JYTypeChange(Sender: TObject);
begin
  InitGrid();
end;

procedure TfrmCheJianXS.KHNameHZChange(Sender: TObject);
begin
  if ADOQueryMain.Active = False then
    Exit;
  SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
  SCreateCDS20(ADOQueryMain, Order_Main);
  SInitCDSData20(ADOQueryMain, Order_Main);
end;

procedure TfrmCheJianXS.ToolButton1Click(Sender: TObject);
var
  fPrintFile: string;
  Porderno, LBName, SYRName: string;
  i, j: Integer;
  Txt, fImagePath: string;
  Moudle: THandle;
  Makebar: TMakebar;
  Mixtext: TMixtext;
begin
  if Order_Main.IsEmpty then
    Exit;
  with ADOQueryPrint do
  begin
    Close;
    sql.Clear;
    sql.add('select A.*,B.*');
    sql.add(',KHNameJC1=(select KHNameJC  from KH_Main X where X.KHNo= A.KHNo and X.KHFlag=''KH'')');
    sql.Add(',KHConNo=(select TOP 1 X.KHConNo from ML_ConMain X where X.MLConID=A.ConMainId)');
    sql.add(',EWM=cast('''' as varchar(1000)) from ML_OrderMainNew A ');

    sql.Add('inner Join ML_OrderSubidNew B on A.NewMLID=B.NewMLID ');
    sql.Add('where A.NewMLID=' + quotedstr(Trim(Order_Main.fieldbyname('NewMLID').AsString)));
    Open;
  end;

  try
    Moudle := LoadLibrary('MakeQRBarcode.dll');
    @Makebar := GetProcAddress(Moudle, 'Make');
    @Mixtext := GetProcAddress(Moudle, 'MixText');
    Txt := Trim(ADOQueryPrint.fieldbyname('NewMLID').AsString);
    fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp' + inttostr(i) + '.bmp';
    if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
      CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
    if FileExists(fImagePath) then
      DeleteFile(fImagePath);
    Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
  except
    application.MessageBox('条形码生成失败！', '提示信息', MB_ICONERROR);
    exit;
  end;
  fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\生产指示单通用.rmf';
  if FileExists(fPrintFile) then
  begin
    RMVariables['QRBARCODE'] := fImagePath;
    RM1.LoadFromFile(fPrintFile);
    RM1.ShowReport;
  end
  else
  begin
    Application.MessageBox(PChar('没有找' + ExtractFilePath(Application.ExeName) + 'Report\' + Trim(LBName) + '.rmf'), '提示', 0);
  end;
end;

procedure TfrmCheJianXS.ToolButton2Click(Sender: TObject);
begin
  Panel2.Visible := true;
  SMID.SetFocus;
end;

procedure TfrmCheJianXS.SMIDKeyPress(Sender: TObject; var Key: Char);
begin
  if Key = #13 then
  begin
    with ADOQueryMain do
    begin
      Close;
      sql.Clear;
      sql.Add('select * from ML_OrderMainNew where NewMLID =' + quotedstr(Trim(SMID.text)));
      Open;
    end;
    if ADOQueryMain.IsEmpty = true then
    begin
      application.MessageBox('未找到生产单！', '提示信息', MB_ICONERROR);
      SMID.text := '';
      exit;
    end
    else
    begin
      Panel2.Visible := false;
      cxGrid2.Visible := True;
      try
        ADOQueryTemp.DisableControls;
        with ADOQueryTemp do
        begin
          Close;
          sql.Clear;
          sql.Add('select * from ML_OrderMainNew A INNER JOIN ML_OrderSubidNew B on A.NewMLID =B.NewMLID where A.NewMLID =' + quotedstr(Trim(SMID.text)));
          Open;
        end;
        SCreateCDS20(ADOQueryTemp, Order_Sub);
        SInitCDSData20(ADOQueryTemp, Order_Sub);
      finally
        ADOQueryTemp.EnableControls;
      end;
      SMID.text := '';
    end;
  end;

end;

procedure TfrmCheJianXS.MXGYS2BtnDnClick(Sender: TObject);
begin
  TBtnEditC(Sender).Text := '';
  TBtnEditC(Sender).TxtCode := '';
end;

procedure TfrmCheJianXS.DXGYS2BtnDnClick(Sender: TObject);
begin
  TBtnEditC(Sender).Text := '';
  TBtnEditC(Sender).TxtCode := '';
end;

procedure TfrmCheJianXS.MXGYS2BtnUpClick(Sender: TObject);
begin
  try
    frmKHGYSList := TfrmKHGYSList.Create(Application);
    with frmKHGYSList do
    begin
      if ShowModal = 1 then
      begin
        MXGYS2.text := Trim(Order_Main.fieldbyname('KHNameJC').AsString);
      end;
    end;
  finally
    frmKHGYSList.Free;
  end;
end;

procedure TfrmCheJianXS.DXGYS2BtnUpClick(Sender: TObject);
begin
  try
    frmKHGYSList := TfrmKHGYSList.Create(Application);
    with frmKHGYSList do
    begin
      if ShowModal = 1 then
      begin
        DXGYS2.text := Trim(Order_Main.fieldbyname('KHNameJC').AsString);
      end;
    end;
  finally
    frmKHGYSList.Free;
  end;
end;

procedure TfrmCheJianXS.Button1Click(Sender: TObject);
begin
  Panel2.Visible := false;
  SMID.text := '';
end;

procedure TfrmCheJianXS.Button3Click(Sender: TObject);
begin
  Panel3.Visible := False;
  cxGrid2.Visible := false;
  MXGYS2.Text := '';
  DXGYS2.Text := '';
  MXSeHao2.Text := '';
  DXSeHao2.Text := '';
  TBRafresh.Click;
end;

procedure TfrmCheJianXS.Button2Click(Sender: TObject);
var
  maxno: string;
begin
  if GetLSNo(ADOQueryTemp, maxno, 'XS', 'CheJianXS', 3, 1) = False then
  begin
    Application.MessageBox('取最大号失败!', '提示', 0);
    Exit;
  end;

  if trim(Filler.text) = '' then
  begin
    Application.MessageBox('登记人不能为空!', '提示', 0);
    Exit;
  end;

  with ADOQueryTemp do
  begin
    Close;
    sql.Clear;
    sql.Add('insert into CheJianXS(NewMLID,NewSubid,XSID,MXGYS,DXGYS,MXSeHao,DXSeHao,Filler) values( ');
    sql.Add(quotedstr(Trim(FNewMLID)));
    sql.Add(',' + quotedstr(Trim(FNewSubid)));
    sql.Add(',' + quotedstr(Trim(maxno)));
    sql.Add(',' + quotedstr(Trim(MXGYS2.text)));
    sql.Add(',' + quotedstr(Trim(DXGYS2.text)));
    sql.Add(',' + quotedstr(Trim(MXSeHao2.text)));
    sql.Add(',' + quotedstr(Trim(DXSeHao2.text)));
    sql.Add(', ' + quotedstr(trim(Filler.text)));
    sql.Add(')');
    ExecSQL;
  end;

//  Panel3.Visible := False;
//  MXGYS2.Text := '';
//  DXGYS2.Text := '';
//  MXSeHao2.Text := '';
//  DXSeHao2.Text := '';
//  TBRafresh.Click;
end;

procedure TfrmCheJianXS.ToolButton3Click(Sender: TObject);
begin
  Panel3.Visible := true;
  Button2.Visible := false;
  Button4.Visible := true;
  FXSID := Trim(Order_Main.fieldbyname('XSID').AsString);
  with ADOQueryTemp do
  begin
    Close;
    sql.Clear;
    sql.Add('select * from CheJianXS where XSID =' + quotedstr(Trim(FXSID)));
    Open;
  end;
  Label20.Caption := Trim(Order_Main.fieldbyname('MLColor').AsString);
  MXGYS2.Text := Trim(ADOQueryTemp.fieldbyname('MXGYS').AsString);
  DXGYS2.Text := Trim(ADOQueryTemp.fieldbyname('DXGYS').AsString);
  MXSeHao2.Text := Trim(ADOQueryTemp.fieldbyname('MXSeHao').AsString);
  DXSeHao2.Text := Trim(ADOQueryTemp.fieldbyname('DXSeHao').AsString);
  Filler.Text := Trim(ADOQueryTemp.fieldbyname('Filler').AsString);
end;

procedure TfrmCheJianXS.Button4Click(Sender: TObject);
begin
  with ADOQueryTemp do
  begin
    Close;
    sql.Clear;
    sql.Add('update CheJianXS   ');
    sql.Add('set MXGYS =' + quotedstr(Trim(MXGYS2.text)));
    sql.Add(',DXGYS=' + quotedstr(Trim(DXGYS2.text)));
    sql.Add(',MXSeHao=' + quotedstr(Trim(MXSeHao2.text)));
    sql.Add(',DXSeHao=' + quotedstr(Trim(DXSeHao2.text)));
    sql.Add(',Filler=' + quotedstr(Trim(Filler.text)));
    sql.Add(',Editer=' + quotedstr(trim(DName)));
    sql.Add(',Edittime=getdate() ');
    sql.Add('where XSID =' + quotedstr(Trim(FXSID)));
    ExecSQL;
  end;

//  Panel3.Visible := False;
//  MXGYS2.Text := '';
//  DXGYS2.Text := '';
//  MXSeHao2.Text := '';
//  DXSeHao2.Text := '';
//  TBRafresh.Click;
end;

procedure TfrmCheJianXS.ToolButton4Click(Sender: TObject);
begin
  with ADOQueryTemp do
  begin
    Close;
    sql.Clear;
    sql.Add('DELETE from CheJianXS   ');
    sql.Add('where XSID =' + quotedstr(Trim(Order_Main.fieldbyname('XSID').AsString)));
    ExecSQL;
  end;
  Order_Main.Delete;
end;

procedure TfrmCheJianXS.Tv2FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
begin
  Panel3.Visible := true;
//  cxGrid2.Visible := false;
  FNewMLID := Trim(Order_Sub.fieldbyname('NewMLID').AsString);
  FNewSubid := Trim(Order_Sub.fieldbyname('NewSubid').AsString);
  Label20.Caption := Trim(Order_Sub.fieldbyname('MLColor').AsString);

  with ADOQueryTemp do
  begin
    Close;
    sql.Clear;
    sql.Add('select * from CheJianXS where NewSubid =' + quotedstr(Trim(FNewSubid)));
    Open;
  end;

  if ADOQueryTemp.IsEmpty = true then
  begin
    MXGYS2.Text := '';
    DXGYS2.Text := '';
    MXSeHao2.Text := '';
    DXSeHao2.Text := '';
    Filler.Text := '';
    Button4.Visible := False;
    Button2.Visible := true;
  end
  else
  begin
    FXSID := Trim(ADOQueryTemp.fieldbyname('XSID').AsString);
    MXGYS2.Text := Trim(ADOQueryTemp.fieldbyname('MXGYS').AsString);
    DXGYS2.Text := Trim(ADOQueryTemp.fieldbyname('DXGYS').AsString);
    MXSeHao2.Text := Trim(ADOQueryTemp.fieldbyname('MXSeHao').AsString);
    DXSeHao2.Text := Trim(ADOQueryTemp.fieldbyname('DXSeHao').AsString);
    Filler.Text := Trim(ADOQueryTemp.fieldbyname('Filler').AsString);
    Button2.Visible := False;
    Button4.Visible := true;
  end;
end;

procedure TfrmCheJianXS.FillerBtnUpClick(Sender: TObject);
begin
  try
    frmZDYHelp := TfrmZDYHelp.Create(Application);
    with frmZDYHelp do
    begin
      flag := 'XSFiller';
      flagname := '面布';
      if ShowModal = 1 then
      begin
        Filler.text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
      end;
    end;
  finally
    frmZDYHelp.Free;
  end;
end;

end.

