public async Task Create() { var user = new UserInfoDetails { EntityName = "Spécial_character_tést", UserId = Guid.NewGuid().ToString(), Email = "[email protected]", LastName = "ORION_LAST_TEST", Profiles = new List<Profile>() }; user.Profiles.Add(new Profile { LoginEntityId = LoginEntityId.Representative, Entity = Entity.Representative, EntityId = 6723, IsUserDefault = true, IsInCurrentDb = true, AlClientId = AlClientId, // Only need these values in testapi. // Sigh. RoleId = 1458, RoleName = "Representative" }); var result = await Client.Security.Users.CreateAsync(user); Assert.True(result.Success); Assert.NotNull(result.Data); }
public async Task <IResult <UserInfoDetails> > CreateAsync(UserInfoDetails user, bool sendEmail = false) { var request = new Request("Security/Users", Method.POST); request.AddParameter("application/json", JsonConvert.SerializeObject(user)); request.AddQueryParameter("sendEmail", sendEmail.ToString()); return(await client.ExecuteTaskAsync <UserInfoDetails>(request)); }
public async Task <IResult <UserInfoDetails> > UpdateAsync(UserInfoDetails user) { var request = new Request("Security/Users/{id}", Method.PUT); request.AddUrlSegment("id", user.Id.ToString()); request.AddParameter("application/json", JsonConvert.SerializeObject(user)); return(await client.ExecuteTaskAsync <UserInfoDetails>(request)); }
public static UserInfoDetails GetUserInfoDetails(string userId) { string url = XindianAppConfig.businessServiceUri + "/user/information?userId=" + userId; string rv = RestCall.httpGetMethod(url); if (string.IsNullOrEmpty(rv)) { return(null); } Result ret = Newtonsoft.Json.JsonConvert.DeserializeObject <Result>(rv); if (ret.resultCode == 0 && ret.data != null) { UserInfoDetails datas = Newtonsoft.Json.JsonConvert.DeserializeObject <UserInfoDetails>(ret.data.ToString()); return(datas); } else { return(null); } //return null; }
public async Task <IResult <UserInfoDetails> > ResetPasswordAsync(UserInfoDetails user, bool sendEmail = false, bool newUser = false) { return(await ResetPasswordAsync(user.Id.Value, user.Password, sendEmail, newUser)); }
public async Task <IResult> Delete(UserInfoDetails user) { return(await DeleteAsync(user.Id.Value)); }
public async Task <IResult <UserInfoDetails> > CreateAsync(UserInfoDetails user) { return(await CreateAsync(user, false)); }
public async Task <IResult <UserInfoDetails> > SetPasswordAsync(UserInfoDetails user) { return(await SetPasswordAsync((long)user.Id, user.Password)); }