public LoginResult Login(User user)
        {
            using (var command = new GetPayKindCommand(_settingService.GetServerIP(), _settingService.GetPort(), user))
            {
                command.Execute();
                if (!command.Success)
                {
                    return(new LoginResult {
                        Message = command.ErrorMessage, Success = false
                    });
                }
                else
                {
                    PaymentService.InitData(command.Vendors, command.VendorServices);
                    user.PostIndex             = command.PostIndex;
                    SettingService.WorkingPort = command.WorkingPort;
                }
            }

            _currentUser = user;


            return(new LoginResult {
                Message = "", Success = true
            });
        }
示例#2
0
 public AccountInfo CheckPay(CheckPayCommandParams param)
 {
     using (var command = new CheckPayCommand(_settingService.GetServerIP(), SettingService.WorkingPort, _currentUser, param))
     {
         command.Execute();
         if (!command.Success)
         {
             throw new CheckPayException(command.ErrorMessage);
         }
         else
         {
             return(command.AccountInfo);
         }
     }
 }