private void onLoadRecommendItem(final boolean silent) { String tag = "tag_request_RecommendItem"; NetRequest.getInstance(this) .post( new Callback() { @Override public void onSuccess(BaseResponse response) {} @Override public void onPreExecute() { // toShowProgressMsg("正在获取数据..."); } @Override public void onFinished() { // toCloseProgressMsg(); mPullRefreshListView.onRefreshComplete(); } @Override public void onFailed(String msg) { // showToast( msg ); } @Override public Map<String, String> getParams() { Map<String, String> params = new HashMap<String, String>(); params.put("UserID", mSpUtil.getLoginId()); params.put("Password", mSpUtil.getPassword()); params.put("Method", "GetEmployeeList"); params.put("JobID", jobId); return params; } }, tag); }
/** 请求数据 */ private void reqJobList() { String tag = "tag_request_GetJobList"; NetRequest.getInstance(mContext) .post( new Callback() { @Override public void onSuccess(BaseResponse response) { mRefreshDataRequired = false; List<Job> list = response.getListResponse(new TypeToken<List<Job>>() {}); totalCount = response.getSimpleInt("TotalCount"); curPage = response.getSimpleInt("PageNum"); if (curPage <= 1) { // mSpUtil.setMessageRefreshTime(); // mSpUtil.setNewMsgCount(0);// 新消息数清零 mItems.clear(); } if (list != null && list.size() > 0) { mItems.addAll(list); } else { // mListView.setEmptyView(emptyView); } if (mItems.size() < response.TotalCount) { mPullRefreshListView.setOnLastItemVisibleListener(JobFragment.this); } else { // 数据加载完了 mPullRefreshListView.setOnLastItemVisibleListener(null); } mAdapter.notifyDataSetChanged(); mSpUtil.checkOnlineParams(getActivity()); } @Override public void onPreExecute() { // toShowProgressMsg("正在获取数据..."); } @Override public void onFinished() { // toCloseProgressMsg(); mPullRefreshListView.onRefreshComplete(); } @Override public void onFailed(String msg) { // showToast( msg ); } @Override public Map<String, String> getParams() { Map<String, String> params = new HashMap<String, String>(); params.put("UserID", mSpUtil.getLoginId()); params.put("Password", mSpUtil.getPassword()); params.put("Method", "GetJobList"); if (curStoreFilter != null && !curStoreFilter.getId().equals("-1")) { params.put("StoreID", curStoreFilter.getId()); } if (curJobFilter != null && !curJobFilter.getId().equals("-1")) { params.put("JobID", curJobFilter.getId()); } if (curPage >= 1) { params.put("PageNum", String.valueOf(curPage)); } return params; } }, tag); }
/** 请求数据 */ private void onLoad() { String tag = "tag_request_GetJobList"; NetRequest.getInstance(this) .post( new Callback() { @Override public void onSuccess(BaseResponse response) { mRefreshDataRequired = false; List<Clerk> list = response.getListResponse(new TypeToken<List<Clerk>>() {}); if (mIndex == 1) { // mSpUtil.setMessageRefreshTime(); // mSpUtil.setNewMsgCount(0);// 新消息数清零 mItems.clear(); } if (list != null && list.size() > 0) { mItems.addAll(list); } else { // mListView.setEmptyView(emptyView); } if (mItems.size() < response.TotalCount) { mPullRefreshListView.setOnLastItemVisibleListener(EmployeeActivity.this); } else { // 数据加载完了 mPullRefreshListView.setOnLastItemVisibleListener(null); } mAdapter.notifyDataSetChanged(); } @Override public void onPreExecute() { // toShowProgressMsg("正在获取数据..."); } @Override public void onFinished() { // toCloseProgressMsg(); mPullRefreshListView.onRefreshComplete(); } @Override public void onFailed(String msg) { // showToast( msg ); } @Override public Map<String, String> getParams() { Map<String, String> params = new HashMap<String, String>(); params.put("UserID", mSpUtil.getLoginId()); params.put("Password", mSpUtil.getPassword()); params.put("Method", "GetEmployeeList"); params.put("JobID", jobId); if (curSexFilter != null) { params.put("Sex", curSexFilter.getName()); } if (curEducationFilter != null) { params.put("Education", curEducationFilter.getName()); } if (curAgeFilter != null) { params.put("Age", curAgeFilter.getName()); } if (mIndex >= 1) { params.put("PageNum", String.valueOf(mIndex)); } return params; } }, tag); }