public async Task<StatusData<AccountInternal>> SignUpPerson(SignUpRequestPerson request)
        {
            var user = new User
                  {
                      UserName = request.UserName,
                      Password = request.Password,
                      Email = request.Email,
                      // UsernameEmail = request.Email,
                      UserInfoPerson = new UserInfoPerson
                      {
                          FirstName = request.FirstName,
                          LastName = request.LastName,
                          Gender = ((byte)request.Gender).ToString(),
                          BirthDate = request.DateOfBirth.ToString("yyyy-MM-dd")
                      },
                      UserInfo = new UserInfo { CountryCode = request.CountryCode }
                  };

            var result = new StatusData<AccountInternal> { Status = SystemDbStatus.Inserted };

            var response = await Task.Factory.StartNew(() => Client.UserService.RegisterUser(user)).ConfigureAwait(false);

            result.Status = (SystemDbStatus)response.DbStatusCode;
            result.Data = new AccountInternal { UserGuid = response.UserGUID, UserId = Convert.ToInt32(response.UserId) };
            result.Message = response.DbStatusMsg;

            return result;
        }
        private async Task<HttpResponseMessage> SignUpPerson(SignUpRequestPerson request)
        {
            var response = await _accountService.SignUpPerson(request);
            if (response.Status.IsOperationSuccessful())
            {
                var registration = new AccountInternal
                {
                    Email = request.Email,
                    FirstName = request.FirstName,
                    UserName = request.UserName,
                    ImageServerAddress = SystemConstants.ImageServerAddress.ToString(),
                    UrlRegistrationLink =
                        new Uri(new Uri(SystemConstants.WebUrl.Value),
                            "index.html#/activation/" +
                            HttpUtility.UrlEncode(Convert.ToBase64String(Encoding.UTF8.GetBytes(request.UserName))) + "/" +
                            HttpUtility.UrlEncode((Convert.ToBase64String(Encoding.UTF8.GetBytes(response.Data.UserGuid)))))
                            .ToString(),
                    UrlVerificationLink =
                        new Uri(new Uri(SystemConstants.WebUrl.Value),
                            "index.html#/activation/" +
                            HttpUtility.UrlEncode(Convert.ToBase64String(Encoding.UTF8.GetBytes(request.UserName))) + "/")
                            .ToString(),
                    UserGuid = response.Data.UserGuid,
                    UserId = response.Data.UserId
                };

                var html = ViewRenderer.RenderView("~/Views/Home/OutMail/_RegistrationTemplatePartial.cshtml",
                        registration);
                Helper.SendMail(registration.Email, "Activation Mail", html,
                    bodyImages: new List<string> { "~/Images/iLoop.png" });
            }
            return Request.SystemResponse<string>(response.Status);
        }
 public Task<StatusData<AccountInternal>> SignUpPerson(SignUpRequestPerson request)
 {
     return _jUnitOfWork.Account.SignUpPerson(request);
 }