UpFileSelectOnLineFrm.pas 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. unit UpFileSelectOnLineFrm;
  2. interface
  3. uses
  4. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5. Dialogs, StdCtrls, DB, DBClient, ZjGridDBA, ZJGrid;
  6. type
  7. TUpFileSelectOnLineForm = class(TForm)
  8. ZJGrid1: TZJGrid;
  9. ZjGridDBA1: TZjGridDBA;
  10. cdsFiles: TClientDataSet;
  11. btnOK: TButton;
  12. btnCancel: TButton;
  13. cdsFilesID: TStringField;
  14. cdsFilesName: TStringField;
  15. cdsFilesUper: TStringField;
  16. cdsFilesSelect: TBooleanField;
  17. private
  18. { Private declarations }
  19. public
  20. { Public declarations }
  21. procedure InitData(AList: TList);
  22. procedure UpOnlineFiles;
  23. end;
  24. implementation
  25. uses UpFileManageUnit, Math, PHPWebDm;
  26. {$R *.dfm}
  27. { TUpFileSelectOnLineForm }
  28. procedure TUpFileSelectOnLineForm.InitData(AList: TList);
  29. var i: Integer;
  30. vFile: TUpFile;
  31. begin
  32. if AList.Count = 0 then Exit;
  33. if cdsFiles.RecordCount > 0 then
  34. cdsFiles.EmptyDataSet;
  35. for i := 0 to AList.Count - 1 do
  36. begin
  37. vFile := TUpFile(AList[i]);
  38. cdsFiles.Append;
  39. cdsFilesID.AsInteger := vFile.ID;
  40. cdsFilesName.AsString := vFile.DisplayName;
  41. cdsFilesUper.AsString := vFile.UperName;
  42. cdsFiles.Post;
  43. end;
  44. end;
  45. procedure TUpFileSelectOnLineForm.UpOnlineFiles;
  46. var L: Integer;
  47. vA: array of string;
  48. begin
  49. if cdsFiles.RecordCount = 0 then Exit;
  50. L := 0;
  51. cdsFiles.First;
  52. while not cdsfiles.Eof do
  53. begin
  54. if cdsFilesSelect.AsBoolean = True then
  55. begin
  56. Inc(L);
  57. SetLength(vA, L);
  58. vA[L - 1] := cdsFilesID.AsString;
  59. end;
  60. cdsFiles.Next;
  61. end;
  62. // if L > 0 then AAAAA
  63. // PHPWeb.UpAttachment(PHPWeb.UserID, );
  64. end;
  65. end.