IntraWeb下Model-View-Presenter开发实战--创建篇之三(Model)

来源:互联网 发布:linux下的system头文件 编辑:程序博客网 时间:2024/06/16 14:34

业务逻辑处理MODEL

 

unit IWA.Model.LoginModelIntf;

 

interface

 

uses IWA.DTO.LoginDTOIntf;

 

type
  ILoginModel = interface

  ['{108D4A7F-3EDB-4C72-84BE-AC88515B56EE}']
    procedure CheckLoginInfo(DTO: ILoginDTO);
  end;

implementation

end.

 

unit IWA.Model.LoginModelImpl;

 

interface

 

uses IWA.Model.LoginModelIntf, IWA.DTO.LoginDTOIntf;

 

type
  TLoginModel = class(TInterfacedObject, ILoginModel)
  public
    procedure CheckLoginInfo(DTO: ILoginDTO);
  end;

 

implementation

 

uses SysUtils;

 

{ TLoginModel }

procedure TLoginModel.CheckLoginInfo(DTO: ILoginDTO);
begin
  if LowerCase(DTO.UserID) = 'sanmaotuo' then
    DTO.UserName := DTO.UserID +'-'+ DTO.UserPassword
  else
    DTO.UserName := '用户名错误';
end;

原创粉丝点击