unit U_BPZdy_PanelXZHT;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
  cxDataStorage, cxEdit, DB, cxDBData, ToolWin, ComCtrls,
  cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
  cxClasses, cxControls, cxGridCustomView, cxGrid, DBClient, ADODB, ImgList,
  StdCtrls, ExtCtrls, cxTextEdit, cxGridCustomPopupMenu, cxGridPopupMenu,
  cxButtonEdit, BtnEdit, cxTL, cxMaskEdit, cxInplaceContainer, cxDBTL,
  cxTLData, cxContainer, cxCurrencyEdit, cxCheckBox, cxSplitter,jpeg,U_SLT_PBSK,U_SLT_BF1,Math, Menus, cxCalendar,
  cxPC, Buttons;

type
  TfrmBPZDY_PanelXZHT = class(TForm)
    ADOQueryMain: TADOQuery;
    ADOQueryTemp: TADOQuery;
    ADOQueryCmd: TADOQuery;
    ADOQuery6: TADOQuery;
    cxGridPopupMenu2: TcxGridPopupMenu;
    adoqueryPicture: TADOQuery;
    ScrollBox2: TScrollBox;
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    ScrollBox1: TScrollBox;
    Panel2: TPanel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Panel3: TPanel;
    Label9: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    Panel4: TPanel;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    Label16: TLabel;
    Panel5: TPanel;
    Label17: TLabel;
    Label18: TLabel;
    Label19: TLabel;
    Label20: TLabel;
    Panel6: TPanel;
    Label21: TLabel;
    Label22: TLabel;
    Label23: TLabel;
    Label24: TLabel;
    Panel7: TPanel;
    Label25: TLabel;
    Label26: TLabel;
    Label27: TLabel;
    Label28: TLabel;
    Panel8: TPanel;
    Label29: TLabel;
    Label30: TLabel;
    Label31: TLabel;
    Label32: TLabel;
    Panel9: TPanel;
    Label33: TLabel;
    Label34: TLabel;
    Label35: TLabel;
    Label36: TLabel;
    Panel10: TPanel;
    Label37: TLabel;
    Label38: TLabel;
    Label39: TLabel;
    Label40: TLabel;
    Panel11: TPanel;
    Label41: TLabel;
    Label42: TLabel;
    Label43: TLabel;
    Label44: TLabel;
    Panel12: TPanel;
    Label45: TLabel;
    Label46: TLabel;
    Label47: TLabel;
    Label48: TLabel;
    Panel13: TPanel;
    Label49: TLabel;
    Label50: TLabel;
    Label51: TLabel;
    Label52: TLabel;
    Panel14: TPanel;
    Label53: TLabel;
    Label54: TLabel;
    Label55: TLabel;
    Label56: TLabel;
    Panel15: TPanel;
    Label57: TLabel;
    Label58: TLabel;
    Label59: TLabel;
    Label60: TLabel;
    Panel16: TPanel;
    Label61: TLabel;
    Label62: TLabel;
    Label63: TLabel;
    Label64: TLabel;
    Panel17: TPanel;
    Label65: TLabel;
    Label66: TLabel;
    Label67: TLabel;
    Label68: TLabel;
    Panel18: TPanel;
    Label69: TLabel;
    Label70: TLabel;
    Label71: TLabel;
    Label72: TLabel;
    Panel19: TPanel;
    Label73: TLabel;
    Label74: TLabel;
    Label75: TLabel;
    Label76: TLabel;
    Panel20: TPanel;
    Label77: TLabel;
    Label78: TLabel;
    Label79: TLabel;
    Label80: TLabel;
    Panel21: TPanel;
    Label81: TLabel;
    Label82: TLabel;
    Label83: TLabel;
    Label84: TLabel;
    Panel22: TPanel;
    Label85: TLabel;
    Label86: TLabel;
    Label87: TLabel;
    Label88: TLabel;
    Panel23: TPanel;
    Label89: TLabel;
    Label90: TLabel;
    Label91: TLabel;
    Label92: TLabel;
    Panel24: TPanel;
    Label93: TLabel;
    Label94: TLabel;
    Label95: TLabel;
    Label96: TLabel;
    Panel25: TPanel;
    Label97: TLabel;
    Label98: TLabel;
    Label99: TLabel;
    Label100: TLabel;
    Panel26: TPanel;
    Label101: TLabel;
    Label102: TLabel;
    Label103: TLabel;
    Label104: TLabel;
    Panel27: TPanel;
    Label105: TLabel;
    Label106: TLabel;
    Label107: TLabel;
    Label108: TLabel;
    Panel28: TPanel;
    Label109: TLabel;
    Label110: TLabel;
    Label111: TLabel;
    Label112: TLabel;
    Panel29: TPanel;
    Label113: TLabel;
    Label114: TLabel;
    Label115: TLabel;
    Label116: TLabel;
    Panel30: TPanel;
    Label117: TLabel;
    Label118: TLabel;
    Label119: TLabel;
    Label120: TLabel;
    Panel31: TPanel;
    Label121: TLabel;
    Label122: TLabel;
    Label123: TLabel;
    Label124: TLabel;
    Panel32: TPanel;
    Label125: TLabel;
    Label126: TLabel;
    Label127: TLabel;
    Label128: TLabel;
    Panel33: TPanel;
    Label129: TLabel;
    Label130: TLabel;
    Label131: TLabel;
    Label132: TLabel;
    Panel34: TPanel;
    Label133: TLabel;
    Label134: TLabel;
    Label135: TLabel;
    Label136: TLabel;
    Panel35: TPanel;
    Label137: TLabel;
    Label138: TLabel;
    Label139: TLabel;
    Label140: TLabel;
    Panel36: TPanel;
    Label141: TLabel;
    Label142: TLabel;
    Label143: TLabel;
    Label144: TLabel;
    Panel37: TPanel;
    Label145: TLabel;
    Label146: TLabel;
    Label147: TLabel;
    Label148: TLabel;
    Panel38: TPanel;
    Label149: TLabel;
    Label150: TLabel;
    Label151: TLabel;
    Label152: TLabel;
    Panel39: TPanel;
    Label153: TLabel;
    Label154: TLabel;
    Label155: TLabel;
    Label156: TLabel;
    Panel40: TPanel;
    Label157: TLabel;
    Label158: TLabel;
    Label159: TLabel;
    Label160: TLabel;
    Panel41: TPanel;
    Label161: TLabel;
    Label162: TLabel;
    Label163: TLabel;
    Label164: TLabel;
    Panel42: TPanel;
    Label165: TLabel;
    Label166: TLabel;
    Label167: TLabel;
    Label168: TLabel;
    Panel43: TPanel;
    Label169: TLabel;
    Label170: TLabel;
    Label171: TLabel;
    Label172: TLabel;
    Panel44: TPanel;
    Label173: TLabel;
    Label174: TLabel;
    Label175: TLabel;
    Label176: TLabel;
    Panel45: TPanel;
    Label177: TLabel;
    Label178: TLabel;
    Label179: TLabel;
    Label180: TLabel;
    Panel46: TPanel;
    Label181: TLabel;
    Label182: TLabel;
    Label183: TLabel;
    Label184: TLabel;
    Panel47: TPanel;
    Label185: TLabel;
    Label186: TLabel;
    Label187: TLabel;
    Label188: TLabel;
    Panel48: TPanel;
    Label189: TLabel;
    Label190: TLabel;
    Label191: TLabel;
    Label192: TLabel;
    Panel49: TPanel;
    Label193: TLabel;
    Label194: TLabel;
    Label195: TLabel;
    Label196: TLabel;
    Panel50: TPanel;
    Label197: TLabel;
    Label198: TLabel;
    Label199: TLabel;
    Label200: TLabel;
    Panel51: TPanel;
    Label201: TLabel;
    Label202: TLabel;
    Label203: TLabel;
    Label204: TLabel;
    Panel52: TPanel;
    Label205: TLabel;
    Label206: TLabel;
    Label207: TLabel;
    Label208: TLabel;
    Panel53: TPanel;
    Label209: TLabel;
    Label210: TLabel;
    Label211: TLabel;
    Label212: TLabel;
    Panel54: TPanel;
    Label213: TLabel;
    Label214: TLabel;
    Label215: TLabel;
    Label216: TLabel;
    Panel55: TPanel;
    Label217: TLabel;
    Label218: TLabel;
    Label219: TLabel;
    Label220: TLabel;
    Panel56: TPanel;
    Label221: TLabel;
    Label222: TLabel;
    Label223: TLabel;
    Label224: TLabel;
    Panel57: TPanel;
    Label225: TLabel;
    Label226: TLabel;
    Label227: TLabel;
    Label228: TLabel;
    Panel58: TPanel;
    Label229: TLabel;
    Label230: TLabel;
    Label231: TLabel;
    Label232: TLabel;
    Panel59: TPanel;
    Label233: TLabel;
    Label234: TLabel;
    Label235: TLabel;
    Label236: TLabel;
    Panel60: TPanel;
    Label237: TLabel;
    Label238: TLabel;
    Label239: TLabel;
    Label240: TLabel;
    Panel61: TPanel;
    Label241: TLabel;
    Label242: TLabel;
    Label243: TLabel;
    Label244: TLabel;
    Panel62: TPanel;
    Label245: TLabel;
    Label246: TLabel;
    Label247: TLabel;
    Label248: TLabel;
    Panel63: TPanel;
    Label249: TLabel;
    Label250: TLabel;
    Label251: TLabel;
    Label252: TLabel;
    Panel64: TPanel;
    Label253: TLabel;
    Label254: TLabel;
    Label255: TLabel;
    Label256: TLabel;
    Panel65: TPanel;
    Label257: TLabel;
    Label258: TLabel;
    Label259: TLabel;
    Label260: TLabel;
    Panel66: TPanel;
    Label261: TLabel;
    Label262: TLabel;
    Label263: TLabel;
    Label264: TLabel;
    Panel67: TPanel;
    Label265: TLabel;
    Label266: TLabel;
    Label267: TLabel;
    Label268: TLabel;
    Panel68: TPanel;
    Label269: TLabel;
    Label270: TLabel;
    Label271: TLabel;
    Label272: TLabel;
    Panel69: TPanel;
    Label273: TLabel;
    Label274: TLabel;
    Label275: TLabel;
    Label276: TLabel;
    Panel70: TPanel;
    Label277: TLabel;
    Label278: TLabel;
    Label279: TLabel;
    Label280: TLabel;
    Panel71: TPanel;
    Label281: TLabel;
    Label282: TLabel;
    Label283: TLabel;
    Label284: TLabel;
    Panel72: TPanel;
    Label285: TLabel;
    Label286: TLabel;
    Label287: TLabel;
    Label288: TLabel;
    Panel73: TPanel;
    Label289: TLabel;
    Label290: TLabel;
    Label291: TLabel;
    Label292: TLabel;
    Panel74: TPanel;
    Label293: TLabel;
    Label294: TLabel;
    Label295: TLabel;
    Label296: TLabel;
    Panel75: TPanel;
    Label297: TLabel;
    Label298: TLabel;
    Label299: TLabel;
    Label300: TLabel;
    Panel76: TPanel;
    Label301: TLabel;
    Label302: TLabel;
    Label303: TLabel;
    Label304: TLabel;
    Panel77: TPanel;
    Label305: TLabel;
    Label306: TLabel;
    Label307: TLabel;
    Label308: TLabel;
    Panel78: TPanel;
    Label309: TLabel;
    Label310: TLabel;
    Label311: TLabel;
    Label312: TLabel;
    Panel79: TPanel;
    Label313: TLabel;
    Label314: TLabel;
    Label315: TLabel;
    Label316: TLabel;
    Panel80: TPanel;
    Label317: TLabel;
    Label318: TLabel;
    Label319: TLabel;
    Label320: TLabel;
    Panel81: TPanel;
    Label321: TLabel;
    Label322: TLabel;
    Label323: TLabel;
    Label324: TLabel;
    Panel82: TPanel;
    Label325: TLabel;
    Label326: TLabel;
    Label327: TLabel;
    Label328: TLabel;
    Panel83: TPanel;
    Label329: TLabel;
    Label330: TLabel;
    Label331: TLabel;
    Label332: TLabel;
    Panel84: TPanel;
    Label333: TLabel;
    Label334: TLabel;
    Label335: TLabel;
    Label336: TLabel;
    Panel85: TPanel;
    Label337: TLabel;
    Label338: TLabel;
    Label339: TLabel;
    Label340: TLabel;
    Panel86: TPanel;
    Label341: TLabel;
    Label342: TLabel;
    Label343: TLabel;
    Label344: TLabel;
    Panel87: TPanel;
    Label345: TLabel;
    Label346: TLabel;
    Label347: TLabel;
    Label348: TLabel;
    Panel88: TPanel;
    Label349: TLabel;
    Label350: TLabel;
    Label351: TLabel;
    Label352: TLabel;
    Panel89: TPanel;
    Label353: TLabel;
    Label354: TLabel;
    Label355: TLabel;
    Label356: TLabel;
    Panel90: TPanel;
    Label357: TLabel;
    Label358: TLabel;
    Label359: TLabel;
    Label360: TLabel;
    Panel91: TPanel;
    Label361: TLabel;
    Label362: TLabel;
    Label363: TLabel;
    Label364: TLabel;
    Panel92: TPanel;
    Label365: TLabel;
    Label366: TLabel;
    Label367: TLabel;
    Label368: TLabel;
    Panel93: TPanel;
    Label369: TLabel;
    Label370: TLabel;
    Label371: TLabel;
    Label372: TLabel;
    Panel94: TPanel;
    Label373: TLabel;
    Label374: TLabel;
    Label375: TLabel;
    Label376: TLabel;
    Panel95: TPanel;
    Label377: TLabel;
    Label378: TLabel;
    Label379: TLabel;
    Label380: TLabel;
    Panel96: TPanel;
    Label381: TLabel;
    Label382: TLabel;
    Label383: TLabel;
    Label384: TLabel;
    Panel97: TPanel;
    Label385: TLabel;
    Label386: TLabel;
    Label387: TLabel;
    Label388: TLabel;
    Panel98: TPanel;
    Label389: TLabel;
    Label390: TLabel;
    Label391: TLabel;
    Label392: TLabel;
    Panel99: TPanel;
    Label393: TLabel;
    Label394: TLabel;
    Label395: TLabel;
    Label396: TLabel;
    Panel100: TPanel;
    Label397: TLabel;
    Label398: TLabel;
    Label399: TLabel;
    Label400: TLabel;
    PopupMenu1: TPopupMenu;
    N1: TMenuItem;
    Ord_SH: TClientDataSet;
    Panel102: TPanel;
    Panel103: TPanel;
    Label405: TLabel;
    Edit2: TEdit;
    Edit3: TEdit;
    Label450: TLabel;
    Label451: TLabel;
    Panel101: TPanel;
    Label401: TLabel;
    Label402: TLabel;
    Panel104: TPanel;
    Label403: TLabel;
    Edit4: TEdit;
    Edit5: TEdit;
    Panel105: TPanel;
    Label404: TLabel;
    Label406: TLabel;
    Panel106: TPanel;
    Label407: TLabel;
    Edit6: TEdit;
    Edit7: TEdit;
    Panel107: TPanel;
    Label408: TLabel;
    Label409: TLabel;
    Panel108: TPanel;
    Label410: TLabel;
    Edit8: TEdit;
    Edit9: TEdit;
    Panel109: TPanel;
    Label411: TLabel;
    Label412: TLabel;
    Panel110: TPanel;
    Label413: TLabel;
    Edit10: TEdit;
    Edit11: TEdit;
    Panel111: TPanel;
    Label414: TLabel;
    Label415: TLabel;
    Panel112: TPanel;
    Label416: TLabel;
    Edit12: TEdit;
    Edit13: TEdit;
    Panel113: TPanel;
    Label417: TLabel;
    Label418: TLabel;
    Panel114: TPanel;
    Label419: TLabel;
    Edit14: TEdit;
    Edit15: TEdit;
    Panel115: TPanel;
    Label420: TLabel;
    Label421: TLabel;
    Panel116: TPanel;
    Label422: TLabel;
    Edit16: TEdit;
    Edit17: TEdit;
    Panel117: TPanel;
    Label423: TLabel;
    Label424: TLabel;
    Panel118: TPanel;
    Label425: TLabel;
    Edit18: TEdit;
    Edit19: TEdit;
    Panel119: TPanel;
    Label426: TLabel;
    Label427: TLabel;
    Panel120: TPanel;
    Label428: TLabel;
    Edit20: TEdit;
    Edit21: TEdit;
    Panel121: TPanel;
    Label429: TLabel;
    Label430: TLabel;
    Panel122: TPanel;
    Label431: TLabel;
    Edit22: TEdit;
    Edit23: TEdit;
    Panel123: TPanel;
    Label432: TLabel;
    Label433: TLabel;
    Panel124: TPanel;
    Label434: TLabel;
    Edit24: TEdit;
    Edit25: TEdit;
    Panel125: TPanel;
    Label435: TLabel;
    Label436: TLabel;
    Panel126: TPanel;
    Label437: TLabel;
    Edit26: TEdit;
    Edit27: TEdit;
    Panel127: TPanel;
    Label438: TLabel;
    Label439: TLabel;
    Panel128: TPanel;
    Label440: TLabel;
    Edit28: TEdit;
    Edit29: TEdit;
    Panel129: TPanel;
    Label441: TLabel;
    Label442: TLabel;
    Panel130: TPanel;
    Label443: TLabel;
    Edit30: TEdit;
    Edit31: TEdit;
    Panel131: TPanel;
    Label444: TLabel;
    Label445: TLabel;
    Panel132: TPanel;
    Label446: TLabel;
    Edit32: TEdit;
    Edit33: TEdit;
    Panel133: TPanel;
    Label447: TLabel;
    Label448: TLabel;
    Panel134: TPanel;
    Label449: TLabel;
    Edit34: TEdit;
    Edit35: TEdit;
    Panel135: TPanel;
    Label452: TLabel;
    Label453: TLabel;
    Panel136: TPanel;
    Label454: TLabel;
    Edit36: TEdit;
    Edit37: TEdit;
    Panel137: TPanel;
    Label455: TLabel;
    Label456: TLabel;
    Panel138: TPanel;
    Label457: TLabel;
    Edit38: TEdit;
    Edit39: TEdit;
    Panel139: TPanel;
    Label458: TLabel;
    Label459: TLabel;
    Panel140: TPanel;
    Label460: TLabel;
    Edit40: TEdit;
    Edit41: TEdit;
    Panel141: TPanel;
    Label461: TLabel;
    Label462: TLabel;
    Panel142: TPanel;
    Label463: TLabel;
    Edit42: TEdit;
    Edit43: TEdit;
    Panel143: TPanel;
    Label464: TLabel;
    Label465: TLabel;
    Panel144: TPanel;
    Label466: TLabel;
    Edit44: TEdit;
    Edit45: TEdit;
    Panel145: TPanel;
    Label467: TLabel;
    Label468: TLabel;
    Panel146: TPanel;
    Label469: TLabel;
    Edit46: TEdit;
    Edit47: TEdit;
    Panel147: TPanel;
    Label470: TLabel;
    Label471: TLabel;
    Panel148: TPanel;
    Label472: TLabel;
    Edit48: TEdit;
    Edit49: TEdit;
    Panel149: TPanel;
    Label473: TLabel;
    Label474: TLabel;
    Panel150: TPanel;
    Label475: TLabel;
    Edit50: TEdit;
    Edit51: TEdit;
    Panel151: TPanel;
    Label476: TLabel;
    Label477: TLabel;
    Panel152: TPanel;
    Label478: TLabel;
    Edit52: TEdit;
    Edit53: TEdit;
    Panel153: TPanel;
    Label479: TLabel;
    Label480: TLabel;
    Panel154: TPanel;
    Label481: TLabel;
    Edit54: TEdit;
    Edit55: TEdit;
    Panel155: TPanel;
    Label482: TLabel;
    Label483: TLabel;
    Panel156: TPanel;
    Label484: TLabel;
    Edit56: TEdit;
    Edit57: TEdit;
    Panel157: TPanel;
    Label485: TLabel;
    Label486: TLabel;
    Panel158: TPanel;
    Label487: TLabel;
    Edit58: TEdit;
    Edit59: TEdit;
    Panel159: TPanel;
    Label488: TLabel;
    Label489: TLabel;
    Panel160: TPanel;
    Label490: TLabel;
    Edit60: TEdit;
    Edit61: TEdit;
    Panel161: TPanel;
    Label491: TLabel;
    Label492: TLabel;
    Panel162: TPanel;
    Label493: TLabel;
    Edit62: TEdit;
    Edit63: TEdit;
    Panel163: TPanel;
    Label494: TLabel;
    Label495: TLabel;
    Panel164: TPanel;
    Label496: TLabel;
    Edit64: TEdit;
    Edit65: TEdit;
    Panel165: TPanel;
    Label497: TLabel;
    Label498: TLabel;
    Panel166: TPanel;
    Label499: TLabel;
    Edit66: TEdit;
    Edit67: TEdit;
    Panel167: TPanel;
    Label500: TLabel;
    Label501: TLabel;
    Panel168: TPanel;
    Label502: TLabel;
    Edit68: TEdit;
    Edit69: TEdit;
    Panel169: TPanel;
    Label503: TLabel;
    Label504: TLabel;
    Panel170: TPanel;
    Label505: TLabel;
    Edit70: TEdit;
    Edit71: TEdit;
    Panel171: TPanel;
    Label506: TLabel;
    Label507: TLabel;
    Panel172: TPanel;
    Label508: TLabel;
    Edit72: TEdit;
    Edit73: TEdit;
    Panel173: TPanel;
    Label509: TLabel;
    Label510: TLabel;
    Panel174: TPanel;
    Label511: TLabel;
    Edit74: TEdit;
    Edit75: TEdit;
    Panel175: TPanel;
    Label512: TLabel;
    Label513: TLabel;
    Panel176: TPanel;
    Label514: TLabel;
    Edit76: TEdit;
    Edit77: TEdit;
    Panel177: TPanel;
    Label515: TLabel;
    Label516: TLabel;
    Panel178: TPanel;
    Label517: TLabel;
    Edit78: TEdit;
    Edit79: TEdit;
    Panel179: TPanel;
    Label518: TLabel;
    Label519: TLabel;
    Panel180: TPanel;
    Label520: TLabel;
    Edit80: TEdit;
    Edit81: TEdit;
    Panel181: TPanel;
    Label523: TLabel;
    Label524: TLabel;
    Panel182: TPanel;
    Label525: TLabel;
    Edit82: TEdit;
    Edit83: TEdit;
    Panel183: TPanel;
    Label526: TLabel;
    Label527: TLabel;
    Panel184: TPanel;
    Label528: TLabel;
    Edit84: TEdit;
    Edit85: TEdit;
    Panel185: TPanel;
    Label529: TLabel;
    Label530: TLabel;
    Panel186: TPanel;
    Label531: TLabel;
    Edit86: TEdit;
    Edit87: TEdit;
    Panel187: TPanel;
    Label532: TLabel;
    Label533: TLabel;
    Panel188: TPanel;
    Label534: TLabel;
    Edit88: TEdit;
    Edit89: TEdit;
    Panel189: TPanel;
    Label535: TLabel;
    Label536: TLabel;
    Panel190: TPanel;
    Label537: TLabel;
    Edit90: TEdit;
    Edit91: TEdit;
    Panel191: TPanel;
    Label538: TLabel;
    Label539: TLabel;
    Panel192: TPanel;
    Label540: TLabel;
    Edit92: TEdit;
    Edit93: TEdit;
    Panel193: TPanel;
    Label541: TLabel;
    Label542: TLabel;
    Panel194: TPanel;
    Label543: TLabel;
    Edit94: TEdit;
    Edit95: TEdit;
    Panel195: TPanel;
    Label544: TLabel;
    Label545: TLabel;
    Panel196: TPanel;
    Label546: TLabel;
    Edit96: TEdit;
    Edit97: TEdit;
    Panel197: TPanel;
    Label547: TLabel;
    Label548: TLabel;
    Panel198: TPanel;
    Label549: TLabel;
    Edit98: TEdit;
    Edit99: TEdit;
    Panel199: TPanel;
    Label550: TLabel;
    Label551: TLabel;
    Panel200: TPanel;
    Label552: TLabel;
    Edit100: TEdit;
    Edit101: TEdit;
    Panel201: TPanel;
    ScrollBox3: TScrollBox;
    Label521: TLabel;
    Label522: TLabel;
    BTLP: TButton;
    BTNP: TButton;
    Button1: TButton;
    PTID: TEdit;
    ColName: TEdit;
    Edit1: TEdit;
    ScrollBox4: TScrollBox;
    Button2: TButton;
    SY: TButton;
    XY: TButton;
    LBCPAP: TLabel;
    Label553: TLabel;
    Label554: TLabel;
    Label555: TLabel;
    Label556: TLabel;
    ColNameKH: TEdit;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure TBCloseClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure BTLPClick(Sender: TObject);
    procedure BTNPClick(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure N1Click(Sender: TObject);
    procedure Panel1DblClick(Sender: TObject);
    procedure Panel101DblClick(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Panel102MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Edit2Exit(Sender: TObject);
    procedure Edit3Exit(Sender: TObject);
    procedure XYClick(Sender: TObject);
    procedure SYClick(Sender: TObject);
    procedure ColNameKeyPress(Sender: TObject; var Key: Char);
  private
    FSKID,FCPID,FCPNo,FCPName:string;
    FPTID,FColNameEng,FColName,FColNameKH:string;
    FColor:TColor;
    y,Z,my,mz:integer;
    procedure SaveData();
    procedure InitSHByOrdBP_SH();
    { Private declarations }
  public
    flag,flagname,snote,MainType,FGYName,Fint,FColorFlag:string;
    fnote,fnote1,forderno,fZdyFlag,ViewFlag,fHelpType:Boolean;
    PPSTE:integer;
    procedure initimageSH();
    procedure initimageSHSql();
    procedure initPanel();
    procedure initPL();
    { Public declarations }
  end;
var
  frmBPZDY_PanelXZHT: TfrmBPZDY_PanelXZHT;
implementation
uses
  U_DataLink,U_Fun10,U_BPZdy_YT;

{$R *.dfm}
procedure TfrmBPZDY_PanelXZHT.InitSHByOrdBP_SH();
var
  i,j,z,q:Integer;
begin
  with Ord_SH do
  begin
    First;
    i:=0;
    q:=1;
    while not Eof do
    begin
      if (q>50*(my-1)) and (q<=50*my) then
      begin
        with ScrollBox1 do
        begin
          TPanel(Controls[i]).Visible:=True;
          TPanel(Controls[i]).Hint:=Trim(Ord_SH.Fieldbyname('PTID').AsString);
          TPanel(Controls[i]).Color:=StrToInt('$'+Trim(Ord_SH.Fieldbyname('ColDaiMa').AsString));
          with TPanel(Controls[i]) do
          begin
            TLabel(Controls[0]).Caption:=Trim(Ord_SH.Fieldbyname('PTID').AsString);
            TLabel(Controls[1]).Caption:=Trim(Ord_SH.Fieldbyname('ColNameEng').AsString);
            for j:=0 to ControlCount-1 do
            begin
              if Controls[j] is TPanel then
              begin
                with TPanel(Controls[j]) do
                begin
                  for z:=0 to ControlCount-1 do
                  begin
                    if Controls[z] is TEdit then
                    begin
                      if TEdit(Controls[z]).Tag=1 then
                      begin
                        TEdit(Controls[z]).Text:=Trim(Ord_SH.Fieldbyname('ColNo').AsString);
                        TEdit(Controls[z]).Hint:=Trim(Ord_SH.Fieldbyname('PTID').AsString);
                      end else
                      begin
                        TEdit(Controls[z]).Text:=Trim(Ord_SH.Fieldbyname('ColNameKH').AsString);
                        TEdit(Controls[z]).Hint:=Trim(Ord_SH.Fieldbyname('PTID').AsString);
                      end;
                    end;
                  end;
                end;
              end;
            end;
          end;
        end;
        i:=i+1;
      end;
      q:=q+1;
      Next;
    end;
  end;
end;

procedure TfrmBPZDY_PanelXZHT.initPL();
var i,j,x:Integer;
begin
  {with ADOQueryTemp do
  begin
    Close;
    sql.Clear;
    sql.Add('select * from BP_ColZDY A');
    sql.Add(' inner join RT_PTColor B on A.PTID=B.PTID');
    sql.Add(' where A.SKID='''+Trim(FColorFlag)+'''');
    sql.Add(' and isnull(A.SKID,'''')<>'''' ');
    sql.Add(' order by cast(A.ColNo as int)');
    Open;
  end;
  SCreateCDS20(ADOQueryTemp,Ord_SH);
  SInitCDSData20(ADOQueryTemp,Ord_SH);}
  with Self.ScrollBox1 do
  begin
    for i:=0 to Self.ScrollBox1.ControlCount-1 do
    begin
      if Controls[i] is TPanel then
      begin
        if TPanel(Controls[i]).Ctl3D=False then
        begin
          TPanel(Controls[i]).Visible:=false;
          Self.ScrollBox1.Refresh;
        end;
      end;
    end;
  end;
  Self.ScrollBox1.Refresh;
  Self.InitSHByOrdBP_SH();
end;

procedure TfrmBPZDY_PanelXZHT.initPanel();
var i:integer;
begin
  with ScrollBox1 do
  begin
    for i:=0 to ScrollBox1.ControlCount-1 do
    begin
      if TPanel(Controls[i]).Visible=False then
      begin
        TPanel(Controls[i]).Visible:=True;
        TPanel(Controls[i]).Color:=FColor;
        TPanel(Controls[i]).Hint:=FPTID;
        with TPanel(Controls[i]) do
        begin
          TLabel(Controls[0]).Caption:=Trim(FPTID);
          TLabel(Controls[1]).Caption:=Trim(FColNameEng);
          TLabel(Controls[2]).Caption:=Trim(FColName);
          TLabel(Controls[3]).Caption:=Trim(FColNameKH);
          TLabel(Controls[0]).Visible:=False;
          TLabel(Controls[1]).Visible:=False;
          TLabel(Controls[2]).Visible:=False;
          TLabel(Controls[3]).Visible:=False;
        end;
        Exit;
      end;
    end;
  end;
end;

procedure TfrmBPZDY_PanelXZHT.initimageSH();
var
  i,j,x:Integer;
begin
  {with ScrollBox2 do
  begin
    for x:=0 to ScrollBox2.ControlCount-1 do
    begin
      TPanel(Controls[x]).Visible:=false;
    end;
  end;}
  with ADOQueryTemp do
  begin
    Close;
    sql.Clear;
    sql.Add('select * from RT_PTColor ');
    sql.Add('where 1=1 ');
    if PTID.Text<>'' then
    begin
      sql.Add(' and PTID='''+trim(PTID.Text)+'''');
    end;
    if ColName.Text<>'' then
    begin
      sql.Add(' and ColName='''+trim(ColName.Text)+'''');
    end;
    if ColNameKH.Text<>'' then
    begin
      sql.Add(' and ColNameKH like'''+'%'+trim(ColNameKH.Text)+'%'+'''');
    end;
    if (PTID.Text='') and (ColName.Text='') then
    begin
      sql.Add(' and PTInt>'''+trim(IntToStr((y-1)*100))+'''');
      sql.Add(' and PTInt<='''+trim(IntToStr(y*100))+'''');
    end;
    sql.Add(' order by PTID ');
    Open;
  end;
  if ADOQueryTemp.IsEmpty then
  begin
    Application.MessageBox('数据不存在！','提示',0);
    Exit;
  end;
  ADOQueryTemp.DisableControls;
  with ADOQueryTemp do
  begin
    First;
    i:=0;
    while not Eof do
    begin
      with ScrollBox2 do
      begin
        TPanel(Controls[i]).Visible:=True;
        TPanel(Controls[i]).Hint:=Trim(ADOQueryTemp.Fieldbyname('PTID').AsString);
        TPanel(Controls[i]).Color:=StrToInt('$'+Trim(ADOQueryTemp.Fieldbyname('ColDaiMa').AsString));
        with TPanel(Controls[i]) do
        begin
          TLabel(Controls[0]).Caption:=Trim(ADOQueryTemp.Fieldbyname('PTID').AsString);
          TLabel(Controls[1]).Caption:=Trim(ADOQueryTemp.Fieldbyname('ColNameEng').AsString);
          TLabel(Controls[2]).Caption:=Trim(ADOQueryTemp.Fieldbyname('ColName').AsString);
          TLabel(Controls[3]).Caption:=Trim(ADOQueryTemp.Fieldbyname('ColNameKH').AsString);
          TLabel(Controls[0]).Visible:=False;
          TLabel(Controls[1]).Visible:=False;
          TLabel(Controls[2]).Visible:=False;
          TLabel(Controls[3]).Visible:=False;
        end;
      end;
      i:=i+1;
      Next;
    end;
  end;
  ADOQueryTemp.EnableControls;
  LBCPAP.Caption:=IntToStr(y)+'/'+inttostr(Z);
end;

procedure TfrmBPZDY_PanelXZHT.initimageSHSql();
var
  i,j,x:Integer;
begin
  with ScrollBox2 do
  begin
    for x:=0 to ScrollBox2.ControlCount-1 do
    begin
      TPanel(Controls[x]).Visible:=false;
    end;
  end;
  with ADOQueryTemp do
  begin
    Close;
    sql.Clear;
    sql.Add('select * from RT_PTColor ');
    sql.Add('where 1=1 ');
    if Trim(PTID.Text)<>'' then
    begin
      sql.Add(' and PTID='''+trim(PTID.Text)+'''');
    end;
    if Trim(ColName.Text)<>'' then
    begin
      sql.Add(' and ColName='''+trim(ColName.Text)+'''');
    end;
    if Trim(ColNameKH.Text)<>'' then
    begin
      sql.Add(' and ColNameKH like'''+'%'+trim(ColNameKH.Text)+'%'+'''');
    end;
    if (PTID.Text='') and (ColName.Text='') and (ColNameKH.Text='') then
    begin
      sql.Add(' and PTInt>'''+trim(IntToStr((y-1)*100))+'''');
      sql.Add(' and PTInt<='''+trim(IntToStr(y*100))+'''');
    end;
    sql.Add(' order by PTID ');
    Open;
  end;
  if ADOQueryTemp.IsEmpty then
  begin
    Application.MessageBox('数据不存在！','提示',0);
    Exit;
  end;
  ADOQueryTemp.DisableControls;
  with ADOQueryTemp do
  begin
    First;
    i:=0;
    while not Eof do
    begin
      with ScrollBox2 do
      begin
        TPanel(Controls[i]).Visible:=True;
        TPanel(Controls[i]).Hint:=Trim(ADOQueryTemp.Fieldbyname('PTID').AsString);
        TPanel(Controls[i]).Color:=StrToInt('$'+Trim(ADOQueryTemp.Fieldbyname('ColDaiMa').AsString));
        with TPanel(Controls[i]) do
        begin
          TLabel(Controls[0]).Caption:=Trim(ADOQueryTemp.Fieldbyname('PTID').AsString);
          TLabel(Controls[1]).Caption:=Trim(ADOQueryTemp.Fieldbyname('ColNameEng').AsString);
          TLabel(Controls[2]).Caption:=Trim(ADOQueryTemp.Fieldbyname('ColName').AsString);
          TLabel(Controls[3]).Caption:=Trim(ADOQueryTemp.Fieldbyname('ColNameKH').AsString);
          TLabel(Controls[0]).Visible:=False;
          TLabel(Controls[1]).Visible:=False;
          TLabel(Controls[2]).Visible:=False;
          TLabel(Controls[3]).Visible:=False;
        end;
      end;
      i:=i+1;
      Next;
    end;
  end;
  ADOQueryTemp.EnableControls;
  LBCPAP.Caption:=IntToStr(y)+'/'+inttostr(Z);
end;

procedure TfrmBPZDY_PanelXZHT.SaveData();
var
  maxno,FColID:string;
  j,i:Integer;
begin
  ScrollBox3.SetFocus;
  try
    ADOQueryCmd.Connection.BeginTrans;
    Ord_SH.DisableControls;
    with Ord_SH do
    begin
      First;
      while not Eof do
      begin
        FColID:=Trim(fieldbyname('ColID').AsString);
        if Trim(FColID)='' then
        begin
          if GetLSNo(ADOQueryCmd,maxno,'CL','BP_ColZDY',3,1)=False then
          begin
            Application.MessageBox('取最大号失败!','提示',0);
            Exit;
          end;
        end else
        begin
          maxno:=Trim(FColID);
        end;
        with ADOQueryCmd do
        begin
          Close;
          sql.Clear;
          sql.Add('select * from BP_ColZDY where ColID='''+Trim(maxno)+'''');
          Open;
        end;
        with ADOQueryCmd do
        begin
          if Trim(FColID)='' then
          begin
            Append;
          end else
          begin
            Edit;
          end;
          FieldByName('ColID').Value:=Trim(maxno);
          FieldByName('PTID').Value:=Trim(Ord_SH.fieldbyname('PTID').AsString);
          if Ord_SH.fieldbyname('ColNo').AsString='' then
          begin
            FieldByName('ColNo').Value:=Ord_SH.RecordCount+1;
          end
          else
          FieldByName('ColNo').Value:=Trim(Ord_SH.fieldbyname('ColNo').AsString);
          FieldByName('ColNameKH').Value:=Trim(Ord_SH.fieldbyname('ColNameKH').AsString);
          FieldByName('SKID').Value:=Trim(FColorFlag);
          Post;
        end;
        Edit;
        FieldByName('ColID').Value:=Trim(maxno);
        with ADOQueryCmd do
        begin
          close;
          sql.Clear;
          SQL.Add('update RT_PTColor set ColNameKH='''+trim(Ord_SH.fieldbyname('ColNameKH').AsString)+''' ');
          sql.Add(' where PTID='''+trim(Ord_SH.fieldbyname('PTID').AsString)+'''');
          ExecSQL;
        end;
        Next;
      end;
    end;
    Ord_SH.EnableControls;
    with ADOQueryCmd do
    begin
      close;
      sql.Clear;
      sql.Add('update BP_ZDY set SKID='''+trim(FColorFlag)+''' ');
      sql.Add('where BPCode='''+trim(FColorFlag)+'''');
      ExecSQL;
    end;
    ADOQueryCmd.Connection.CommitTrans;
    Application.MessageBox('保存成功。','提示');
  except
    Ord_SH.EnableControls;
    ADOQueryCmd.Connection.RollbackTrans;
    Application.MessageBox('保存异常!','提示');
  end;
end;

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

procedure TfrmBPZDY_PanelXZHT.TBCloseClick(Sender: TObject);
begin
  Close;
end;

procedure TfrmBPZDY_PanelXZHT.FormShow(Sender: TObject);
var
  x:Integer;
begin
  my:=1;
  with ADOQueryCmd do
  begin
    close;
    sql.Clear;
    sql.Add('select Count(PTID) GS from RT_PTColor');
    open;
  end;
  y:=1;
  z:=ceil(ADOQueryCmd.fieldbyname('GS').AsInteger/100);
  LBCPAP.Caption:='1/'+inttostr(z);
  if Trim(FColorFlag)='' then
  begin
    with ADOQueryTemp do
    begin
      Close;
      sql.Clear;
      sql.Add('select A.*,B.* ');
      SQL.Add(',MXGS=(select count(C.PTID) from BP_ColZDY C where C.SKID=B.SKID and isnull(C.SKID,'''')<>'''') ');
      sql.Add('from RT_PTColor A ');
      sql.Add('inner join BP_ColZDY B on B.PTID=A.PTID ');
      sql.Add('where 1=2');
      sql.Add(' order by cast(B.ColNo as int)');
      Open;
    end;
    SCreateCDS20(ADOQueryTemp,Ord_SH);
    SInitCDSData20(ADOQueryTemp,Ord_SH);
  end else
  begin
    with ScrollBox1 do
    begin
      for x:=0 to ScrollBox1.ControlCount-1 do
      begin
        TPanel(Controls[x]).Visible:=false;
      end;
    end;
    with ADOQueryTemp do
    begin
      Close;
      sql.Clear;
      sql.Add('select A.*,B.* ');
      SQL.Add(',MXGS=(select count(C.PTID) from BP_ColZDY C where C.SKID=B.SKID and isnull(C.SKID,'''')<>'''') ');
      sql.Add('from RT_PTColor A ');
      sql.Add('inner join BP_ColZDY B on B.PTID=A.PTID ');
      sql.Add('where B.SKID='''+trim(FColorFlag)+''' and isnull(B.SKID,'''')<>''''');
      sql.Add(' order by cast(B.ColNo as int)');
      //showmessage(sql.text);
      Open;
    end;
    mz:=ceil(ADOQueryTemp.fieldbyname('MXGS').AsInteger/50);
    label554.Caption:=inttostr(my)+'/'+inttostr(mz);
    SCreateCDS20(ADOQueryTemp,Ord_SH);
    SInitCDSData20(ADOQueryTemp,Ord_SH);
    InitSHByOrdBP_SH();
  end;
  initimageSH();
end;

procedure TfrmBPZDY_PanelXZHT.BTLPClick(Sender: TObject);
begin
  if y=1 then exit;
  if y<z then
  begin
    BTNP.Enabled:=true;
  end
  else
  begin
    BTNP.Enabled:=False;
  end;
  y:=y-1;
  initimageSH();
end;

procedure TfrmBPZDY_PanelXZHT.BTNPClick(Sender: TObject);
begin
  if y=z then exit;
  BTNP.Enabled:=False;
  if y>0 then
  begin
    BTLP.Enabled:=True;
  end
  else
  begin
    BTLP.Enabled:=False;
  end;
  y:=y+1;
  initimageSH();
  BTNP.Enabled:=true;
end;

procedure TfrmBPZDY_PanelXZHT.Button1Click(Sender: TObject);
begin
  y:=1;
  if (y<0) or (y>z) then
  begin
    application.MessageBox('输入页数无效','提示');
    exit;
  end;
  button1.Enabled:=False;
  if y>1 then
  begin
    BTLP.Enabled:=True;
  end
  else
  begin
    BTLP.Enabled:=False;
  end;
  initimageSH();
  button1.Enabled:=true;

end;

procedure TfrmBPZDY_PanelXZHT.Panel1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
  i:Integer;
begin
  FColor:=TPanel(Sender).Color;
  with TPanel(Sender) do
  begin
    for i:=0 to 3 do
    begin
      if TLabel(Controls[i]).Visible=false then
        TLabel(Controls[i]).Visible:=True
      else
        TLabel(Controls[i]).Visible:=false;
      TLabel(Controls[i]).Color:=clWhite;
    end;
    FPTID:=Trim(TLabel(Controls[0]).Caption);
    FColNameEng:=Trim(TLabel(Controls[1]).Caption);
    FColName:=Trim(TLabel(Controls[2]).Caption);
    FColNameKH:=Trim(TLabel(Controls[3]).Caption);
  end;
end;

procedure TfrmBPZDY_PanelXZHT.N1Click(Sender: TObject);
begin
  FrmBPZdy_YT:=TFrmBPZdy_YT.create(Self);
  with FrmBPZdy_YT do
  begin
    BJFlag:='Y';
    Panel1.Color:=FColor;
    Label1.Caption:=FPTID;
    Label2.Caption:=FColNameEng;
    Label3.Caption:=FColName;
    Label4.Caption:=FColNameKH;
    if showmodal=1 then
    begin

    end;
    free;
  end;
end;

procedure TfrmBPZDY_PanelXZHT.Panel1DblClick(Sender: TObject);
var i:Integer;
begin
  with TPanel(Sender) do
  begin
    FPTID:=Trim(TLabel(Controls[0]).Caption);
    FColNameEng:=Trim(TLabel(Controls[1]).Caption);
    FColName:=Trim(TLabel(Controls[2]).Caption);
    FColNameKH:=Trim(TLabel(Controls[3]).Caption);
  end;
  if Ord_SH.Locate('PTID',FPTID,[])=False then
  begin
    with ADOQueryTemp do
    begin
      Close;
      sql.Clear;
      sql.Add('select * from RT_PTColor where PTID='''+Trim(FPTID)+'''');
      Open;
    end;
    with Ord_SH do
    begin
      Append;
      FieldByName('ColDaiMa').Value:=Trim(ADOQueryTemp.fieldbyname('ColDaiMa').AsString);
      FieldByName('PTID').Value:=FPTID;
      FieldByName('ColNo').Value:=Ord_SH.RecordCount+1;
      FieldByName('ColNameEng').Value:=FColNameEng;
      FieldByName('ColName').Value:=FColName;
      FieldByName('ColNameKH').Value:=FColNameKH;
      post;
    end;
    i:=Ord_SH.RecordCount;
    mz:=ceil(i/50);
    Label554.Caption:=inttostr(my)+'/'+inttostr(mz);
  end;
  InitSHByOrdBP_SH();
end;

procedure TfrmBPZDY_PanelXZHT.Panel101DblClick(Sender: TObject);
var i:Integer;
begin
  if application.MessageBox('确定要删除吗','提示',1)=2 then Exit;
  FColor:=clBtnFace;
  TPanel(Sender).Visible:=false;
  with TPanel(Sender) do
  begin
    for i:=0 to 1 do
    begin
      TLabel(Controls[i]).Visible:=false;
    end;
    Ord_SH.Locate('PTID',TLabel(Controls[0]).Caption,[]);
    with ADOQueryCmd do
    begin
      Close;
      sql.Clear;
      sql.Add('delete from BP_ColZDY where ColID='''+Trim(Ord_SH.fieldbyname('ColID').AsString)+'''');
      ExecSQL;
    end;
    Ord_SH.Delete;
    FPTID:='';
    FColNameEng:='';
    FColName:='';
    FColNameKH:='';
    if Ord_SH.IsEmpty then
    begin
      with ADOQueryCmd do
      begin
        Close;
        sql.Clear;
        sql.Add('update BP_Zdy set SKID='''' where SKID='''+Trim(FColorFlag)+'''');
        ExecSQL;
      end;
    end;
  end;
  Self.initPL();
end;

procedure TfrmBPZDY_PanelXZHT.Button2Click(Sender: TObject);
begin
  if Ord_SH.IsEmpty then exit;
  PTID.SetFocus;
  savedata();
  ModalResult:=1;
end;

procedure TfrmBPZDY_PanelXZHT.Panel102MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
  i:Integer;
  FPT:string;
begin
  FColor:=TPanel(Sender).Color;
  with TPanel(Sender) do
  begin
    for i:=0 to 1 do
    begin
      if TLabel(Controls[i]).Visible=false then
        TLabel(Controls[i]).Visible:=True
      else
        TLabel(Controls[i]).Visible:=false;
      TLabel(Controls[i]).Color:=clWhite;
    end;
    FPT:=Trim(TLabel(Controls[0]).Caption);
    Ord_SH.Locate('PTID',FPT,[]);
    FPTID:=Trim(Ord_SH.fieldbyname('PTID').AsString);
    FColNameEng:=Trim(Ord_SH.fieldbyname('ColNameEng').AsString);
    FColName:=Trim(Ord_SH.fieldbyname('ColName').AsString);
    FColNameKH:=Trim(Ord_SH.fieldbyname('ColNameKH').AsString);
  end;
end;

procedure TfrmBPZDY_PanelXZHT.Edit2Exit(Sender: TObject);
var
  FPT,FTEX:string;
begin
  FPT:=Trim(TEdit(Sender).Hint);
  FTEX:=Trim(TEdit(Sender).Text);
  if FTEX<>'0' then
  begin
    if StrToIntDef(FTEX,0)=0 then
    begin
      application.MessageBox('色号必须是数字','提示');
      FTEX:='';
      TEdit(Sender).Text:='';
      exit;
    end;
  end;
  //ShowMessage(FPT);
  with Ord_SH do
  begin
    if Locate('PTID',FPT,[]) then
    begin
      Edit;
      FieldByName('ColNo').value:=Trim(FTEX);
      Post;
    end;
  end;
end;

procedure TfrmBPZDY_PanelXZHT.Edit3Exit(Sender: TObject);
var FPT,FTEX:string;
begin
  FPT:=Trim(TEdit(Sender).Hint);
  FTEX:=Trim(TEdit(Sender).Text);
  with Ord_SH do
  begin
    if Locate('PTID',FPT,[]) then
    begin
      Edit;
      FieldByName('ColNameKH').value:=Trim(FTEX);
      Post;
    end;
  end;
end;

procedure TfrmBPZDY_PanelXZHT.XYClick(Sender: TObject);
var x:integer;
begin
  if my=mz then exit;
  XY.Enabled:=False;
  my:=my+1;
  if my>0 then
  begin
    SY.Enabled:=True;
  end
  else
  begin
    SY.Enabled:=False;
  end;
  with ScrollBox1 do
  begin
    for x:=0 to ScrollBox1.ControlCount-1 do
    begin
      TPanel(Controls[x]).Visible:=false;
    end;
  end;
  label554.Caption:=inttostr(my)+'/'+inttostr(mz);
  InitSHByOrdBP_SH();
  XY.Enabled:=true;
end;

procedure TfrmBPZDY_PanelXZHT.SYClick(Sender: TObject);
var x:integer;
begin
  if my=1 then exit;
  SY.Enabled:=False;
  my:=my-1;
  if my<mz then
  begin
    XY.Enabled:=True;
  end
  else
  begin
    XY.Enabled:=False;
  end;
  with ScrollBox1 do
  begin
    for x:=0 to ScrollBox1.ControlCount-1 do
    begin
      TPanel(Controls[x]).Visible:=false;
    end;
  end;
  label554.Caption:=inttostr(my)+'/'+inttostr(mz);
  InitSHByOrdBP_SH();
  SY.Enabled:=true;
end;

procedure TfrmBPZDY_PanelXZHT.ColNameKeyPress(Sender: TObject; var Key: Char);
begin
  if Key=#13 then
  begin
    initimageSHSql();
  end;
end;

end.
