WebNewTenderFrm.pas 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. unit WebNewTenderFrm;
  2. interface
  3. uses
  4. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5. Dialogs, StdCtrls;
  6. type
  7. TWebNewTenderForm = class(TForm)
  8. btnOK: TButton;
  9. btnCancel: TButton;
  10. lbl1: TLabel;
  11. edtKey: TEdit;
  12. lbl2: TLabel;
  13. edtTenderName: TEdit;
  14. lblHint: TLabel;
  15. procedure FormCreate(Sender: TObject);
  16. procedure edtKeyKeyDown(Sender: TObject; var Key: Word;
  17. Shift: TShiftState);
  18. procedure btnOKClick(Sender: TObject);
  19. private
  20. { Private declarations }
  21. public
  22. { Public declarations }
  23. end;
  24. implementation
  25. uses ConstUnit;
  26. {$R *.dfm}
  27. procedure TWebNewTenderForm.FormCreate(Sender: TObject);
  28. begin
  29. if G_IsTest then
  30. begin
  31. edtKey.Text := ''; // 本地
  32. edtTenderName.Text := '';
  33. end;
  34. lblHint.Caption := '';
  35. lblHint.Update;
  36. end;
  37. procedure TWebNewTenderForm.edtKeyKeyDown(Sender: TObject; var Key: Word;
  38. Shift: TShiftState);
  39. begin
  40. if Key = 13 then
  41. btnOK.Click;
  42. end;
  43. procedure TWebNewTenderForm.btnOKClick(Sender: TObject);
  44. begin
  45. lblHint.Caption := '';
  46. lblHint.Update;
  47. if Trim(edtKey.Text) = '' then
  48. begin
  49. lblHint.Caption := 'KEY不能为空';
  50. lblHint.Update;
  51. edtKey.SetFocus;
  52. Exit;
  53. end;
  54. if Trim(edtTenderName.Text) = '' then
  55. begin
  56. lblHint.Caption := '标段名称不能为空';
  57. lblHint.Update;
  58. edtTenderName.SetFocus;
  59. Exit;
  60. end;
  61. ModalResult := mrOk;
  62. end;
  63. end.