/// <summary> /// Change current user's password /// </summary> /// <param name="currentPassword"></param> /// <param name="newPassword"></param> /// <returns></returns> public MethodResponse <ErrorCode> ChangePassword(string currentPassword, string newPassword) { MethodResponse <ErrorCode> response = new MethodResponse <ErrorCode>(); try { UserPersistence.ChangePassword(currentPassword, newPassword); response.Result = ErrorCode.Success; } catch (Exception ex) { EventLog.Error(ex); response.AddError(ex, 0); response.Result = ErrorCode.NoJoy; } return(response); }
public string ChangePassword(int id, string password) { try { if (Check()) { return(db.ChangePassword(id, password)); } } catch (UnCheckException ex) { throw ex; } catch (FindException) { throw new FindException(); } catch (GenericException ex) { throw ex; } return("No tienes permisos de administrador"); }