BatchInsertBillsFrm.pas 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. unit BatchInsertBillsFrm;
  2. interface
  3. uses
  4. BillsCompileDm,
  5. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  6. Dialogs, StdCtrls, ExtCtrls, ZJGrid, sdIDTree, dxBar, sdGridDBA, ComCtrls,
  7. ActnList;
  8. type
  9. TInsertType = (itChild, itNextSibling);
  10. TBatchInsertBillsForm = class(TForm)
  11. pnlButton: TPanel;
  12. btnOK: TButton;
  13. btnCancel: TButton;
  14. dxpmInsertBills: TdxBarPopupMenu;
  15. pnlAllGrid: TPanel;
  16. pnlPositon_Bills: TPanel;
  17. pnlPosition: TPanel;
  18. lblPostion: TLabel;
  19. zgPosition: TZJGrid;
  20. pnlPositionSpr: TPanel;
  21. pnlBills: TPanel;
  22. lblBills: TLabel;
  23. zgBills: TZJGrid;
  24. pnlBillsSpr: TPanel;
  25. pnlDealBills: TPanel;
  26. pnlOther: TPanel;
  27. leBeginCode: TLabeledEdit;
  28. leDrawingCode: TLabeledEdit;
  29. zgDealBills: TZJGrid;
  30. pnlDealBillsSpr: TPanel;
  31. lblDealBills: TLabel;
  32. lblHint: TLabel;
  33. sgdDealBills: TsdGridDBA;
  34. udBeginCode: TUpDown;
  35. alBatchInsertBills: TActionList;
  36. actnInsertCol: TAction;
  37. dxpmBills: TdxBarPopupMenu;
  38. actnDeleteRow: TAction;
  39. actnInsertRow: TAction;
  40. procedure zgPositionCustomPaste(Sender: TObject; ABounds: TRect;
  41. ASourSheet: TZjSheet);
  42. procedure zgBillsCustomPaste(Sender: TObject; ABounds: TRect;
  43. ASourSheet: TZjSheet);
  44. procedure btnOKClick(Sender: TObject);
  45. procedure zgPositionMouseDown(Sender: TObject; Button: TMouseButton;
  46. Shift: TShiftState; X, Y: Integer);
  47. procedure zgBillsCellTextChanged(Sender: TObject; Col, Row: Integer);
  48. procedure zgDealBillsMouseDown(Sender: TObject; Button: TMouseButton;
  49. Shift: TShiftState; X, Y: Integer);
  50. procedure leBeginCodeKeyPress(Sender: TObject; var Key: Char);
  51. procedure zgPositionCellTextChanged(Sender: TObject; Col,
  52. Row: Integer);
  53. procedure dxpmInsertBillsPopup(Sender: TObject);
  54. procedure actnInsertColExecute(Sender: TObject);
  55. procedure zgBillsMouseDown(Sender: TObject; Button: TMouseButton;
  56. Shift: TShiftState; X, Y: Integer);
  57. procedure actnInsertColUpdate(Sender: TObject);
  58. procedure FormResize(Sender: TObject);
  59. procedure actnDeleteRowExecute(Sender: TObject);
  60. procedure actnDeleteRowUpdate(Sender: TObject);
  61. procedure actnInsertRowExecute(Sender: TObject);
  62. procedure actnInsertRowUpdate(Sender: TObject);
  63. private
  64. FInsertType: TInsertType;
  65. FBillsCompileData: TBillsCompileData;
  66. FParentCode: string;
  67. procedure ResetPositionGridHead;
  68. procedure ResetBillsGridHead;
  69. procedure PasteData(AGrid: TZJGrid; ABounds: TRect; ASourSheet: TZjSheet);
  70. procedure SetRowAndColumnCount(AGrid: TZJGrid; ASourSheet: TZjSheet);
  71. procedure LoadParentCode;
  72. function ReplaceLastNum(const ACode: string; ARow: Integer): string;
  73. function GetXmjCode(ARow: Integer): string;
  74. procedure AddXmjNode(ARow, AParentID, ANextSiblingID: Integer);
  75. procedure AddBillsNode(AQtyRow, ARow: Integer; AParent: TsdIDTreeNode);
  76. procedure AddBillsNodes(AQtyRow: Integer; AParent: TsdIDTreeNode);
  77. procedure BatchAddBillsNodes(AParentID, ANextSiblingID: Integer);
  78. public
  79. procedure Init(ABillsCompileData: TBillsCompileData; AInsertType: TInsertType);
  80. procedure Execute;
  81. end;
  82. procedure AddLeafBills(ABillsCompileData: TBillsCompileData; AInsertType: TInsertType);
  83. implementation
  84. uses
  85. sdDB, UtilMethods, ProjectData, MainFrm, Globals, DealBillsDm;
  86. {$R *.dfm}
  87. const
  88. iBwNameCol = 1;
  89. iBwDrawingCodeCol = 2;
  90. iBwBillsQtyCol = 3;
  91. iGclCodeCol = 1;
  92. iGclNameCol = 2;
  93. iGclUnitsCol = 3;
  94. iGclPriceCol = 4;
  95. iGclDrawingCodeCol = 5;
  96. procedure AddLeafBills(ABillsCompileData: TBillsCompileData; AInsertType: TInsertType);
  97. var
  98. InsertBillsForm: TBatchInsertBillsForm;
  99. begin
  100. InsertBillsForm := TBatchInsertBillsForm.Create(nil);
  101. try
  102. InsertBillsForm.Init(ABillsCompileData, AInsertType);
  103. if InsertBillsForm.ShowModal = mrOK then
  104. InsertBillsForm.Execute;
  105. finally
  106. InsertBillsForm.Free;
  107. end;
  108. end;
  109. { TAddLeafBillsForm }
  110. procedure TBatchInsertBillsForm.AddXmjNode(ARow, AParentID, ANextSiblingID: Integer);
  111. var
  112. stnNode: TsdIDTreeNode;
  113. begin
  114. if zgPosition.Cells[1, ARow].Text = '' then Exit;
  115. stnNode := FBillsCompileData.BillsCompileTree.Add(AParentID, ANextSiblingID);
  116. with stnNode.Rec do
  117. begin
  118. ValueByName('Code').AsString := GetXmjCode(ARow);{ReplaceLastNum(leBeginCode.Text, ARow);}
  119. ValueByName('Name').AsString := zgPosition.Cells[iBwNameCol, ARow].Text;
  120. ValueByName('DrawingCode').AsString := zgPosition.Cells[iBwDrawingCodeCol, ARow].Text;
  121. end;
  122. AddBillsNodes(ARow, stnNode);
  123. end;
  124. procedure TBatchInsertBillsForm.BatchAddBillsNodes(AParentID, ANextSiblingID: Integer);
  125. var
  126. iRow: Integer;
  127. begin
  128. for iRow := 1 to zgPosition.RowCount - 1 do
  129. AddXmjNode(iRow, AParentID, ANextSiblingID);
  130. end;
  131. procedure TBatchInsertBillsForm.Execute;
  132. begin
  133. with FBillsCompileData.BillsCompileTree do
  134. begin
  135. if FInsertType = itChild then
  136. begin
  137. if not Assigned(Selected) then Exit;
  138. BatchAddBillsNodes(Selected.ID, -1);
  139. FBillsCompileData.Calculate(Selected.ID);
  140. end
  141. else if FInsertType = itNextSibling then
  142. begin
  143. if not Assigned(Selected.Parent) then Exit;
  144. BatchAddBillsNodes(Selected.ParentID, Selected.NextSiblingID);
  145. FBillsCompileData.Calculate(Selected.ParentID);
  146. end;
  147. end;
  148. end;
  149. procedure TBatchInsertBillsForm.Init(ABillsCompileData: TBillsCompileData;
  150. AInsertType: TInsertType);
  151. begin
  152. ClientHeight := SupportManager.ConfigInfo.BatchInsertFrmHeight;
  153. ClientWidth := SupportManager.ConfigInfo.BatchInsertFrmWidth;
  154. pnlBills.Height := Trunc((pnlPositon_Bills.Height - pnlOther.Height)/22*9);
  155. OnResize := FormResize;
  156. FBillsCompileData := ABillsCompileData;
  157. sgdDealBills.DataView := TProjectData(ABillsCompileData.ProjectData).DealBillsData.sdvDealBills;
  158. FInsertType := AInsertType;
  159. if FInsertType = itChild then
  160. Caption := '批量插入子项'
  161. else if FInsertType = itNextSibling then
  162. Caption := '批量插入后项';
  163. ResetPositionGridHead;
  164. ResetBillsGridHead;
  165. LoadParentCode;
  166. end;
  167. procedure TBatchInsertBillsForm.PasteData(AGrid: TZJGrid; ABounds: TRect;
  168. ASourSheet: TZjSheet);
  169. var
  170. iCol, iRow: Integer;
  171. begin
  172. for iRow := 0 to ASourSheet.RowCount - 1 do
  173. for iCol := 0 to ASourSheet.ColCount - 1 do
  174. begin
  175. with AGrid.Cells[iCol + ABounds.Left , iRow + ABounds.Top] do
  176. if CanEdit then Text := ASourSheet.Values[iCol, iRow];
  177. end;
  178. end;
  179. function TBatchInsertBillsForm.ReplaceLastNum(const ACode: string;
  180. ARow: Integer): string;
  181. var
  182. sgs: TStringList;
  183. begin
  184. sgs := TStringList.Create;
  185. try
  186. sgs.Delimiter := '-';
  187. sgs.DelimitedText := ACode;
  188. sgs[sgs.Count - 1] := IntToStr(StrToInt(sgs[sgs.Count - 1]) + ARow - 1);
  189. Result := sgs.DelimitedText;
  190. finally
  191. sgs.Free;
  192. end;
  193. end;
  194. procedure TBatchInsertBillsForm.ResetPositionGridHead;
  195. var
  196. iCol, iColDiff: Integer;
  197. begin
  198. zgPosition.Cells[iBwNameCol, 0].Text := '部位';
  199. zgPosition.ColWidths[iBwNameCol] := 100;
  200. zgPosition.Cells[iBwDrawingCodeCol, 0].Text := '图(册)号';
  201. zgPosition.ColWidths[iBwDrawingCodeCol] := 100;
  202. iColDiff := iBwBillsQtyCol - 1;
  203. for iCol := iBwBillsQtyCol to zgPosition.ColCount - 1 do
  204. begin
  205. zgPosition.Cells[iCol, 0].Text := '清单' + IntToStr(iCol - iColDiff);
  206. zgPosition.ColWidths[iCol] := 50;
  207. end;
  208. end;
  209. procedure TBatchInsertBillsForm.SetRowAndColumnCount(AGrid: TZJGrid;
  210. ASourSheet: TZjSheet);
  211. begin
  212. if AGrid.ColCount < ASourSheet.ColCount + AGrid.CurCol + 1 then
  213. AGrid.ColCount := ASourSheet.ColCount + AGrid.CurCol + 1;
  214. if AGrid.RowCount < ASourSheet.RowCount + AGrid.CurRow + 1 then
  215. AGrid.RowCount := ASourSheet.RowCount + AGrid.CurRow + 1;
  216. end;
  217. procedure TBatchInsertBillsForm.zgPositionCustomPaste(Sender: TObject;
  218. ABounds: TRect; ASourSheet: TZjSheet);
  219. begin
  220. SetRowAndColumnCount(TZJGrid(Sender), ASourSheet);
  221. ResetPositionGridHead;
  222. PasteData(TZJGrid(Sender), ABounds, ASourSheet);
  223. zgBills.RowCount := zgPosition.ColCount - 1;
  224. ResetBillsGridHead;
  225. end;
  226. procedure TBatchInsertBillsForm.zgBillsCustomPaste(Sender: TObject;
  227. ABounds: TRect; ASourSheet: TZjSheet);
  228. begin
  229. SetRowAndColumnCount(TZJGrid(Sender), ASourSheet);
  230. PasteData(TZJGrid(Sender), ABounds, ASourSheet);
  231. end;
  232. procedure TBatchInsertBillsForm.AddBillsNodes(AQtyRow: Integer;
  233. AParent: TsdIDTreeNode);
  234. var
  235. iRow: Integer;
  236. begin
  237. for iRow := 1 to zgBills.RowCount - 1 do
  238. AddBillsNode(AQtyRow, iRow, AParent);
  239. end;
  240. procedure TBatchInsertBillsForm.AddBillsNode(AQtyRow, ARow: Integer;
  241. AParent: TsdIDTreeNode);
  242. var
  243. stnNode: TsdIDTreeNode;
  244. fQuantity: Double;
  245. begin
  246. if (zgBills.Cells[1, ARow].Text = '') or
  247. (zgPosition.Cells[ARow + iBwBillsQtyCol - 1, AQtyRow].Text = '') or
  248. not TryStrToFloat(zgPosition.Cells[ARow + iBwBillsQtyCol - 1, AQtyRow].Text, fQuantity) then Exit;
  249. stnNode := FBillsCompileData.BillsCompileTree.Add(AParent.ID, -1);
  250. with stnNode.Rec do
  251. begin
  252. ValueByName('B_Code').AsString := zgBills.Cells[iGclCodeCol, ARow].Text;
  253. ValueByName('Name').AsString := zgBills.Cells[iGclNameCol, ARow].Text;
  254. ValueByName('Units').AsString := zgBills.Cells[iGclUnitsCol, ARow].Text;
  255. ValueByName('Price').AsFloat := StrToFloatDef(zgBills.Cells[iGclPriceCol, ARow].Text, 0);
  256. ValueByName('OrgQuantity').AsFloat := StrToFloatDef(zgPosition.Cells[ARow + iBwBillsQtyCol - 1, AQtyRow].Text, 0);
  257. ValueByName('DrawingCode').AsString := zgBills.Cells[iGclDrawingCodeCol, ARow].Text;
  258. end;
  259. end;
  260. procedure TBatchInsertBillsForm.ResetBillsGridHead;
  261. var
  262. iRow: Integer;
  263. begin
  264. zgBills.Cells[iGclCodeCol, 0].Text := '编号';
  265. zgBills.ColWidths[1] := 80;
  266. zgBills.Cells[iGclNameCol, 0].Text := '名称';
  267. zgBills.ColWidths[2] := 120;
  268. zgBills.Cells[iGclUnitsCol, 0].Text := '单位';
  269. zgBills.ColWidths[3] := 60;
  270. zgBills.Cells[iGclPriceCol, 0].Text := '单价';
  271. zgBills.ColWidths[4] := 60;
  272. zgBills.Cells[iGclDrawingCodeCol, 0].Text := '图(册)号';
  273. zgBills.ColWidths[5] := 60;
  274. for iRow := 1 to zgBills.RowCount - 1 do
  275. zgBills.Cells[0, iRow].Text := '清单' + IntToStr(iRow);
  276. end;
  277. procedure TBatchInsertBillsForm.btnOKClick(Sender: TObject);
  278. function CheckGridHasData(AGrid: TZJGrid): Boolean;
  279. var
  280. iRow: Integer;
  281. begin
  282. Result := False;
  283. for iRow := 1 to AGrid.RowCount - 1 do
  284. if AGrid.Cells[1, iRow].Text <> '' then
  285. begin
  286. Result := True;
  287. Break;
  288. end;
  289. end;
  290. function CheckBeginCodeAvailable(const ACode: string): Boolean;
  291. var
  292. sgsCode: TStrings;
  293. iCode: Integer;
  294. begin
  295. sgsCode := TStringList.Create;
  296. try
  297. sgsCode.Delimiter := '-';
  298. sgsCode.DelimitedText := ACode;
  299. Result := TryStrToInt(sgsCode[sgsCode.Count - 1], iCode);
  300. finally
  301. sgsCode.Free;
  302. end;
  303. end;
  304. begin
  305. if not CheckGridHasData(zgPosition) then
  306. ErrorMessage('请输入部位数量复核数据!')
  307. else if not CheckGridHasData(zgBills) then
  308. ErrorMessage('请输入清单编号等数据!')
  309. else if leBeginCode.Text = '' then
  310. ErrorMessage('请输入起始编号!')
  311. else if not CheckBeginCodeAvailable(leBeginCode.Text) then
  312. ErrorMessage('请输入规范的起始部位编号,如1或1-1等。')
  313. else
  314. ModalResult := mrOK;
  315. end;
  316. procedure TBatchInsertBillsForm.zgPositionMouseDown(Sender: TObject;
  317. Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  318. begin
  319. if Button = mbRight then
  320. begin
  321. dxpmInsertBills.Tag := 0;
  322. dxpmInsertBills.PopupFromCursorPos;
  323. end;
  324. end;
  325. procedure TBatchInsertBillsForm.zgBillsCellTextChanged(Sender: TObject;
  326. Col, Row: Integer);
  327. var
  328. sB_Code: string;
  329. Rec: TsdDataRecord;
  330. begin
  331. if (Col = 1) and (Row > 0) then
  332. begin
  333. zgBills.Cells[Col, Row].Align := gaCenterLeft;
  334. sB_Code := zgBills.Cells[Col, Row].Text;
  335. if sB_Code = '' then Exit;
  336. with TProjectData(FBillsCompileData.ProjectData).DealBillsData do
  337. Rec := sddDealBills.Locate('B_Code', sB_Code);
  338. if not Assigned(Rec) then
  339. begin
  340. with FBillsCompileData.BillsData do
  341. Rec := sddBills.Locate('B_Code', sB_Code);
  342. end;
  343. if Assigned(Rec) then
  344. begin
  345. zgBills.Cells[iGclNameCol, Row].Text := Rec.ValueByName('Name').AsString;
  346. zgBills.Cells[iGclNameCol, Row].Align := gaCenterLeft;
  347. zgBills.Cells[iGclUnitsCol, Row].Text := Rec.ValueByName('Units').AsString;
  348. zgBills.Cells[iGclUnitsCol, Row].Align := gaCenterCenter;
  349. zgBills.Cells[iGclPriceCol, Row].Font.Name := 'smartSimSun';
  350. zgBills.Cells[iGclPriceCol, Row].Text := Rec.ValueByName('Price').AsString;
  351. zgBills.Cells[iGclPriceCol, Row].Align := gaCenterRight;
  352. zgBills.Cells[iGclDrawingCodeCol, Row].Align := gaCenterLeft;
  353. end;
  354. end
  355. else if (Col = iGclNameCol) and (Row > 0) then
  356. zgBills.Cells[iGclNameCol, Row].Align := gaCenterLeft
  357. else if (Col = iGclPriceCol) and (Row > 0) then
  358. begin
  359. zgBills.Cells[Col, Row].Value := PriceRoundTo(
  360. StrToFloatDef(zgBills.Cells[Col, Row].Text, 0));
  361. zgBills.Cells[Col, Row].Align := gaCenterRight;
  362. end
  363. else if (Col = iGclDrawingCodeCol) and (Row > 0) then
  364. zgBills.Cells[Col, Row].Align := gaCenterLeft;
  365. end;
  366. procedure TBatchInsertBillsForm.zgDealBillsMouseDown(Sender: TObject;
  367. Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  368. var
  369. i: Integer;
  370. begin
  371. if (Button = mbLeft) and (ssDouble in Shift) then
  372. for i := 1 to 4 do
  373. zgBills.Cells[i, zgBills.CurRow].Text := zgDealBills.Cells[i, zgDealBills.CurRow].Text;
  374. end;
  375. procedure TBatchInsertBillsForm.LoadParentCode;
  376. var
  377. Parent: TsdIDTreeNode;
  378. begin
  379. if FInsertType = itChild then
  380. Parent := FBillsCompileData.BillsCompileTree.Selected
  381. else if FInsertType = itNextSibling then
  382. Parent := FBillsCompileData.BillsCompileTree.Selected.Parent;
  383. FParentCode := Parent.Rec.ValueByName('Code').AsString;
  384. end;
  385. function TBatchInsertBillsForm.GetXmjCode(ARow: Integer): string;
  386. var
  387. iBeginCode: Integer;
  388. begin
  389. iBeginCode := StrToIntDef(leBeginCode.Text, 1);
  390. Result := Format('%s-%d', [FParentCode, iBeginCode + ARow - 1]);
  391. end;
  392. procedure TBatchInsertBillsForm.leBeginCodeKeyPress(Sender: TObject;
  393. var Key: Char);
  394. begin
  395. ValidInteger(Key);
  396. end;
  397. procedure TBatchInsertBillsForm.zgPositionCellTextChanged(Sender: TObject;
  398. Col, Row: Integer);
  399. var
  400. value: Double;
  401. begin
  402. if (Row > 0) then
  403. begin
  404. if (Col >= iBwBillsQtyCol) then
  405. begin
  406. if (TryStrToFloat(zgPosition.Cells[Col, Row].Text, value)) then
  407. begin
  408. zgPosition.Cells[Col, Row].Value := QuantityRoundTo(Value);
  409. zgPosition.Cells[Col, Row].Align := gaCenterRight;
  410. end
  411. else
  412. zgPosition.Cells[Col, Row].Value := '';
  413. end
  414. else if (Col > zgPosition.FixedColCount) then
  415. zgPosition.Cells[Col, Row].Align := gaCenterLeft;
  416. end;
  417. end;
  418. procedure TBatchInsertBillsForm.dxpmInsertBillsPopup(Sender: TObject);
  419. begin
  420. dxpmInsertBills.ItemLinks[7].Visible := (dxpmInsertBills.Tag = 1);
  421. SetDxBtnAction(actnInsertCol, MainForm.dxbtnInsertCol);
  422. SetDxBtnAction(actnDeleteRow, MainForm.dxbtnDeleteRow);
  423. SetDxBtnAction(actnInsertRow, MainForm.dxbtnInsertRow);
  424. end;
  425. procedure TBatchInsertBillsForm.actnInsertColExecute(Sender: TObject);
  426. begin
  427. zgPosition.ColCount := zgPosition.ColCount + 1;
  428. zgPosition.Cells[zgPosition.ColCount-1, 0].Text := '清单' + IntToStr(zgPosition.ColCount - iBwBillsQtyCol);
  429. zgPosition.ColWidths[zgPosition.ColCount-1] := 50;
  430. zgBills.RowCount := zgPosition.ColCount - (iBwBillsQtyCol - 1);
  431. zgBills.Cells[0, zgBills.RowCount-1].Text := '清单' + IntToStr(zgBills.RowCount-1);
  432. end;
  433. procedure TBatchInsertBillsForm.zgBillsMouseDown(Sender: TObject;
  434. Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  435. begin
  436. if Button = mbRight then
  437. begin
  438. dxpmInsertBills.Tag := 1;
  439. dxpmInsertBills.PopupFromCursorPos;
  440. end;
  441. end;
  442. procedure TBatchInsertBillsForm.actnInsertColUpdate(Sender: TObject);
  443. begin
  444. if dxpmInsertBills.Tag = 0 then
  445. TAction(Sender).Caption := '插入一列'
  446. else
  447. TAction(Sender).Caption := '插入一行';
  448. end;
  449. procedure TBatchInsertBillsForm.FormResize(Sender: TObject);
  450. begin
  451. SupportManager.ConfigInfo.BatchInsertFrmHeight := ClientHeight;
  452. SupportManager.ConfigInfo.BatchInsertFrmWidth := ClientWidth;
  453. pnlBills.Height := Trunc((pnlPositon_Bills.Height - pnlOther.Height)/22*9);
  454. end;
  455. procedure TBatchInsertBillsForm.actnDeleteRowExecute(Sender: TObject);
  456. begin
  457. zgPosition.DeleteRow(zgPosition.CurRow);
  458. end;
  459. procedure TBatchInsertBillsForm.actnDeleteRowUpdate(Sender: TObject);
  460. begin
  461. TAction(Sender).Visible := dxpmInsertBills.Tag = 0;
  462. end;
  463. procedure TBatchInsertBillsForm.actnInsertRowExecute(Sender: TObject);
  464. begin
  465. zgPosition.InsertRow(zgPosition.CurRow);
  466. end;
  467. procedure TBatchInsertBillsForm.actnInsertRowUpdate(Sender: TObject);
  468. begin
  469. TAction(Sender).Visible := dxpmInsertBills.Tag = 0;
  470. end;
  471. end.