|
|
@@ -471,8 +471,9 @@ public class ResultPresenter implements ResultAdapter.ApexResultAdapterDataSourc
|
|
|
getDelegate().onStartLoading();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
JSONObject json = RAUtil.Bundle2Json(mParams);
|
|
|
- if (mFields != null) {
|
|
|
+ if (!TextUtils.isEmpty(mFields)) {
|
|
|
try {
|
|
|
json.put("columns", mFields);
|
|
|
} catch (JSONException e) {
|
|
|
@@ -481,47 +482,59 @@ public class ResultPresenter implements ResultAdapter.ApexResultAdapterDataSourc
|
|
|
}
|
|
|
|
|
|
|
|
|
- final String paramStr = json.toString();
|
|
|
- final String module_name = mParams.getString("module_name");
|
|
|
-
|
|
|
- OperationQueue.sharedQueue().addOperationTask(new OperationQueue.OperationBackgroundCallBack() {
|
|
|
- @Override
|
|
|
- public Object operationDoInBackground() {
|
|
|
- return RADataProvider.saveSearchParametersForModuleWithName(intentStr, paramStr, module_name, name);
|
|
|
- }
|
|
|
- }, new OperationQueue.OperationCompletionCallBack() {
|
|
|
- @Override
|
|
|
- public void operationCompletion(Object object) {
|
|
|
-
|
|
|
- if (getDelegate() != null) {
|
|
|
-
|
|
|
- getDelegate().onStopLoading();
|
|
|
-
|
|
|
- JSONObject json = (JSONObject)object;
|
|
|
-
|
|
|
- int result = OnlineDataProvider.RESULT_FALSE;
|
|
|
- String msg = "Sorry, something is wrong.";
|
|
|
- if (json != null) {
|
|
|
+// final String paramStr = json.toString();
|
|
|
|
|
|
- result = json.optInt("result", OnlineDataProvider.RESULT_FALSE);
|
|
|
- if (result != OnlineDataProvider.RESULT_TRUE) {
|
|
|
- String err_msg = json.optString("err_msg");
|
|
|
- if (!TextUtils.isEmpty(err_msg)) {
|
|
|
- msg = err_msg;
|
|
|
- }
|
|
|
- }
|
|
|
- } // json
|
|
|
+ final String module_name = mParams.getString("sub_type");
|
|
|
|
|
|
- if (result != OnlineDataProvider.RESULT_TRUE) {
|
|
|
- getDelegate().onFailed(msg);
|
|
|
- }
|
|
|
+ boolean bsuccessful=RADataProvider.saveSearchParametersForModuleWithName(intentStr, json, module_name, name);
|
|
|
|
|
|
- } // != null
|
|
|
+ getDelegate().onStopLoading();
|
|
|
|
|
|
+ if(!bsuccessful)
|
|
|
+ getDelegate().onFailed("Sorry, something is wrong.");
|
|
|
|
|
|
|
|
|
- }
|
|
|
- }, null);
|
|
|
+//
|
|
|
+// OperationQueue.sharedQueue().addOperationTask(new OperationQueue.OperationBackgroundCallBack() {
|
|
|
+// @Override
|
|
|
+// public Object operationDoInBackground() {
|
|
|
+// return
|
|
|
+// }
|
|
|
+// }, new OperationQueue.OperationCompletionCallBack() {
|
|
|
+// @Override
|
|
|
+// public void operationCompletion(Object object) {
|
|
|
+//
|
|
|
+//
|
|
|
+// boolean b=object;
|
|
|
+// if (getDelegate() != null) {
|
|
|
+//
|
|
|
+// getDelegate().onStopLoading();
|
|
|
+//
|
|
|
+// JSONObject json = (JSONObject)object;
|
|
|
+//
|
|
|
+// int result = OnlineDataProvider.RESULT_FALSE;
|
|
|
+// String msg = "Sorry, something is wrong.";
|
|
|
+// if (json != null) {
|
|
|
+//
|
|
|
+// result = json.optInt("result", OnlineDataProvider.RESULT_FALSE);
|
|
|
+// if (result != OnlineDataProvider.RESULT_TRUE) {
|
|
|
+// String err_msg = json.optString("err_msg");
|
|
|
+// if (!TextUtils.isEmpty(err_msg)) {
|
|
|
+// msg = err_msg;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// } // json
|
|
|
+//
|
|
|
+// if (result != OnlineDataProvider.RESULT_TRUE) {
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// } // != null
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+// }
|
|
|
+// }, null);
|
|
|
}
|
|
|
|
|
|
// endregion
|