rpgZoneGatherControl.pas 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. unit rpgZoneGatherControl;
  2. interface
  3. uses
  4. rpgGatherControl, ReportManager, ADODB, ProjectData, rpgGatherData;
  5. type
  6. TrpgZoneGatherControl = class(TrpgGatherControl)
  7. private
  8. FHistoryBeginPhase: Integer;
  9. FHistoryEndPhase: Integer;
  10. FBeginPhase: Integer;
  11. FEndPhase: Integer;
  12. protected
  13. function SelectProject: Boolean; override;
  14. function SameSelect: Boolean; override;
  15. procedure RefreshGather; override;
  16. public
  17. constructor Create(AProjectData: TProjectData); override;
  18. end;
  19. implementation
  20. uses
  21. rpgZoneProjGatherSelectFrm, ProjGather, Forms, Controls, Globals, ZhAPI;
  22. { TrpgZoneGatherControl }
  23. constructor TrpgZoneGatherControl.Create(AProjectData: TProjectData);
  24. begin
  25. inherited;
  26. FBeginPhase := 0;
  27. FEndPhase := 0;
  28. end;
  29. procedure TrpgZoneGatherControl.RefreshGather;
  30. var
  31. Gather: TZoneProjGather;
  32. begin
  33. Screen.Cursor := crHourGlass;
  34. Gather := TZoneProjGather.Create(GatherData.WriteGatherData,
  35. ReportConfig.XmjCompare, ReportConfig.GclCompare);
  36. try
  37. Gather.Gather(FSelectProjs, FBeginPhase, FEndPhase);
  38. GatherData.LoadRelaData(ProjectData.ProjectID);
  39. ClearObjects(FHistroyProjs);
  40. FHistroyProjs.Assign(FSelectProjs);
  41. FHistoryBeginPhase := FBeginPhase;
  42. FHistoryEndPhase := FEndPhase;
  43. finally
  44. Gather.Free;
  45. Screen.Cursor := crDefault;
  46. end;
  47. end;
  48. function TrpgZoneGatherControl.SameSelect: Boolean;
  49. begin
  50. Result := inherited SameSelect;
  51. Result := Result and (FHistoryBeginPhase = FBeginPhase) and (FHistoryEndPhase = FEndPhase);
  52. end;
  53. function TrpgZoneGatherControl.SelectProject: Boolean;
  54. begin
  55. Result := SelectGatherProject(ProjectData.ProjectID, FSelectProjs, FBeginPhase, FEndPhase);
  56. end;
  57. end.