Advertisement
filhotecmail

Dica Mvcbr

Oct 27th, 2017
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 2.90 KB | None | 0 0
  1. uses System.SysUtils,{$ifdef FMX} FMX.Forms,{$else} VCL.Forms,{$endif} System.Classes, MVCBr.Interf, MVCBr.PersistentModel,
  2. SenMailModel.PersistentModel.Interf, //%Interf,
  3. MVCBr.Controller;
  4. Type
  5. TSenMailModelPersistentModel = class(TPersistentModelFactory,ISenMailModelPersistentModel, IThisAs<TSenMailModelPersistentModel>)
  6. protected
  7. private
  8. FFrom: string;
  9. FFromName: string;
  10. FHost: string;
  11. FUsername: string;
  12. FPassword: string;
  13. FPort: integer;
  14. FSetTLS: Boolean;
  15. FSetSSL: Boolean;
  16. function getFrom: string;
  17. function getFromName: string;
  18. function getHost: string;
  19. function getPassword: string;
  20. function getPorta: Integer;
  21. function getSetTLS: Boolean;
  22. function getUserName: string;
  23. procedure setFrom(const Value: string);
  24. procedure setFromname(const Value: string);
  25. procedure SetPassword(const Value: string);
  26. procedure setPorta(const Value: Integer);
  27. procedure setSetTLS(const Value: Boolean);
  28. procedure SetUsername(const Value: string);
  29. procedure setHost(const Value: string);
  30. public
  31. Constructor Create; override;
  32. Destructor Destroy; override;
  33. class function new():ISenMailModelPersistentModel; overload;
  34. class function new(const AController:IController):ISenMailModelPersistentModel; overload;
  35. function ThisAs:TSenMailModelPersistentModel;
  36. // implementaçoes
  37. property From: string read getFrom write setFrom;
  38. property FromName: string read getFromName write setFromname;
  39. property Host: string read getHost write setHost;
  40. Property UserName: string read getUserName write SetUsername;
  41. property Password: string read getPassword write SetPassword;
  42. property Porta: Integer read getPorta write setPorta;
  43. property SetTLS: Boolean read getSetTLS write setSetTLS;
  44. Na interface..
  45. uses System.SysUtils,{$ifdef FMX} FMX.Forms,{$else} VCL.Forms,{$endif} System.Classes, MVCBr.Interf, MVCBr.PersistentModel,
  46. //%Interf,
  47. MVCBr.Controller;
  48. Type
  49. // Interface de acesso ao model
  50. ISenMailModelPersistentModel = interface( IPersistentModel )
  51. ['{9BA0B924-6279-4E5A-B0C3-D40306C419B9}']
  52. // incluir aqui as especializações
  53. function getFrom: string;
  54. function getFromName: string;
  55. function getHost: string;
  56. function getPassword: string;
  57. function getPorta: Integer;
  58. function getSetTLS: Boolean;
  59. function getUserName: string;
  60. procedure setFrom(const Value: string);
  61. procedure setFromname(const Value: string);
  62. procedure SetPassword(const Value: string);
  63. procedure setPorta(const Value: Integer);
  64. procedure setSetTLS(const Value: Boolean);
  65. procedure SetUsername(const Value: string);
  66. procedure setHost(const Value: string);
  67. property From: string read getFrom write setFrom;
  68. property FromName: string read getFromName write setFromname;
  69. property Host: string read getHost write setHost;
  70. Property UserName: string read getUserName write SetUsername;
  71. property Password: string read getPassword write SetPassword;
  72. property Porta: Integer read getPorta write setPorta;
  73. property SetTLS: Boolean read getSetTLS write setSetTLS;
  74. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement