public ServiceResult ModifyPIN(ModifyPINModel model) { var result = new ServiceResult(); if (!ModelState.IsValid) { result.Code = ReasonCode.MISSING_REQUIRED_FIELDS; foreach (string error in ModelState.Values.SelectMany(v => v.Errors.Select(b => b.ErrorMessage))) { result.Message += error + Environment.NewLine; } return(result); } if (!PinProcessor.TryParse(model.PIN, out string pin)) { result.Code = ReasonCode.MISSING_REQUIRED_FIELDS; result.Message = Resources.PIN格式不正确; return(result); } new MerchantAccountComponent().ModifyPIN(this.GetMerchantAccountId(), pin); return(result); }
public ServiceResult <bool> ModifyPIN(ModifyPINModel model) { var result = new ServiceResult <bool>(); new InvestorAccountComponent().ModifyPIN(this.GetUser(), model.OldPIN, model.NewPIN); result.Data = true; result.Successful(); return(result); }