//Public Methods public UserIdentity UpdateUserIdentity(UserIdentity updatedUserIdentity) { if (!string.IsNullOrEmpty(updatedUserIdentity.UserId)) { UserIdentity currentUserIdentity = _dynamo.GetItem <UserIdentity>(updatedUserIdentity.UserId); if (currentUserIdentity != null) { try { _dynamo.UpdateItem(updatedUserIdentity); } catch (Exception) { throw new FaildToConnectDbException(); } } else { CreateUserIdentity(updatedUserIdentity); } updatedUserIdentity.UserId = null; return(updatedUserIdentity); } else { throw new NotMatchException("UserId"); } }
public void ResetPassword(ResetPasswordDTO resetPasswordDTO) { User foundUser = GetUser(resetPasswordDTO.Email); if (foundUser == null) { throw new NotMatchException("Email"); } if (foundUser.Password != resetPasswordDTO.OldPassword) { throw new NotMatchException("Old password"); } foundUser.Password = resetPasswordDTO.NewPassword; try { _dynamo.UpdateItem(foundUser); } catch (Exception) { throw new FaildToConnectDbException(); } }
/// <summary> /// ModifySample tries to load an existing Sample, modifies and saves it back. If the Item doesn’t exist, it raises an exception /// </summary> /// <param name="sample"></param> public void ModifySample(Sample sample) { _dynamoService.UpdateItem(sample); }
/// <summary> /// ModifyDVD tries to load an existing DVD, modifies and saves it back. If the Item doesn’t exist, it raises an exception /// </summary> /// <param name="dvd"></param> public void ModifyDvd(DVD dvd) { _dynamoService.UpdateItem(dvd); }
public void ModifyRes(Reservation res) { _dynamoService.UpdateItem(res); }