public AppReturnObject Register(UserAccount userRegistration) { var _user = new AppUser() { UserName = userRegistration.UserName, Email = userRegistration.Email, FirstName = userRegistration.FirstName, LastName = userRegistration.LastName, Country = userRegistration.Country, Address = userRegistration.Address, Password = userRegistration.Password }; var _serviceResult = new UserRegistrationService().Register(_user); AppReturnObject _retval = new AppReturnObject() { Succeeded = _serviceResult.Succeeded, Errors = _serviceResult.Errors.ToList() }; if (_serviceResult.Succeeded) { userRegistration.Id = _user.Id; userRegistration.CurrentBalance = _user.CurrentBalance; _retval.UserAccount = userRegistration; } return(_retval); }
public AppReturnObject Block(string userID) { var _serviceResult = new UserService().BlockOrUnBlock(userID, true); AppReturnObject _retval = new AppReturnObject() { Succeeded = _serviceResult.Succeeded, Errors = _serviceResult.Errors.ToList() }; if (_serviceResult.Succeeded) { _retval.UserAccount = new UserAccount() { Id = userID } } ; return(_retval); }
public AppReturnObject MakeTransaction(UserFunds userFunds) { var _serviceResult = new UserFundsService().MakeTransaction(userFunds.UserID, userFunds.Amount); AppReturnObject _retval = new AppReturnObject() { Succeeded = _serviceResult.Succeeded, Errors = _serviceResult.Errors.ToList() }; if (_serviceResult.Succeeded) { _retval.UserAccount = new UserAccount() { Id = userFunds.UserID, CurrentBalance = _serviceResult.AppUser.CurrentBalance } } ; return(_retval); }
public AppReturnObject GetBalance(UserGetBalance userGetBalance) { var _serviceResult = new UserFundsService().GeteBalance(userGetBalance.UserID, userGetBalance.ExchangeRate); AppReturnObject _retval = new AppReturnObject() { Succeeded = _serviceResult.Succeeded, Errors = _serviceResult.Errors.ToList() }; if (_serviceResult.Succeeded) { _retval.UserAccount = new UserAccount() { Id = userGetBalance.UserID, CurrentBalanceForeignCurrency = _serviceResult.AppUser.CurrentBalanceForeignCurrency, CurrentBalance = _serviceResult.AppUser.CurrentBalance } } ; return(_retval); } }