public async Task <IHttpActionResult> ResetPin(ResetPinModel model) { try { int valuePin; var checkTry = int.TryParse(model.nuovo_pin, out valuePin); if (!checkTry) { return(BadRequest("Il pin deve contenere solo cifre numeriche")); } if (model.nuovo_pin.Length != 4) { return(BadRequest("Il PIN dev'essere un numero di massimo 4 cifre!")); } await _logicPersone.ResetPin(model); return(Ok("OK")); } catch (Exception e) { Log.Error("ResetPin", e); return(ErrorHandler(e)); } }
public async Task ResetPin(ResetPinModel model) { await _unitOfWork.Persone.SavePin(model.PersonaUId, EncryptString(model.nuovo_pin, AppSettingsConfiguration.masterKey), true); await _unitOfWork.CompleteAsync(); }
/// <summary> ///Method to verify /// </summary> private void VerifiedOk() { ValidateControls(); if (_isValidatedAuth == true && _isValidatedPin == true) { if (Utilities.IsConnectedToNetwork()) { DisplaySignUpPin = App.resetLoginPIN; LoginEmail = App.LoginEmailId; ResetPinModel = new ResetPinModel(this); } else { IsNoInternetPopupOpen = true; HitVisibility = false; } } }