@SuppressWarnings("unchecked") @Override protected AbstractDataResult<Base> doInBackground(Integer... params) { AbstractDataResult<Base> result = new AbstractDataResult<Base>(); try { if (com.babytree.apps.comm.util.BabytreeUtil.hasNetwork(mActivity)) { pageNo++; DataResult ret = HospitalController.getDoctorDiscuzList(pageNo, mDoctorTag, mGroupId); result.status = ret.status; if (ret.status == P_BabytreeController.SUCCESS_CODE) { ArrayList<Base> values = (ArrayList<Base>) ret.data; result.maxItems = mMaxItems; result.values = values; } else { result.error = ret.error; result.message = ret.message; } } else { result.message = P_BabytreeController.NetworkExceptionMessage; result.status = P_BabytreeController.NetworkExceptionCode; } return result; } catch (Exception ex) { result.message = P_BabytreeController.SystemExceptionMessage; result.status = P_BabytreeController.SystemExceptionCode; return result; } }
@SuppressWarnings("unchecked") @Override protected AbstractDataResult<Base> doInBackground(Void... params) { AbstractDataResult<Base> result = new AbstractDataResult<Base>(); DataResult ret = new DataResult(); try { if (com.babytree.apps.comm.util.BabytreeUtil.hasNetwork(mActivity)) { pageNo = FIRST_START; mValues.clear(); if (mPregMonth == null) { ret = P_BabytreeController.getDiscuzList( loginStr, mGroupId, pageNo, mOrderby, mIsElite, mProvinceId, mCityProvinceId, mBirthday); } else { ret = P_BabytreeController.getDiscuzListByPregMonthOfElite( loginStr, pageNo, Integer.parseInt(mPregMonth), true); } result.status = ret.status; if (ret.status == P_BabytreeController.SUCCESS_CODE) { mMaxItems = ret.totalSize; ArrayList<Base> values = (ArrayList<Base>) ret.data; result.maxItems = mMaxItems; result.values = values; } else { result.error = ret.error; result.message = ret.message; } } else { result.message = P_BabytreeController.NetworkExceptionMessage; result.status = P_BabytreeController.NetworkExceptionCode; } return result; } catch (Exception ex) { result.message = P_BabytreeController.SystemExceptionMessage; result.status = P_BabytreeController.SystemExceptionCode; return result; } }