Merge pull request #58 from CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/final_y

T2P upload data newss
This commit is contained in:
YadavendraSinghYaduvanshi
2017-01-13 20:49:35 +05:30
committed by GitHub
3 changed files with 8 additions and 28 deletions
@@ -538,7 +538,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
values1.put(CommonString.KEY_COVERAGE_STATUS, status); values1.put(CommonString.KEY_COVERAGE_STATUS, status);
db.update(CommonString.KEY_JOURNEY_PLAN, values, CommonString.KEY_STORE_ID + "='" + id + "'", null); db.update(CommonString.KEY_JOURNEY_PLAN, values, CommonString.KEY_STORE_ID + "='" + id + "'", null);
db.update(CommonString.TABLE_COVERAGE_DATA, values1, CommonString.KEY_STORE_ID + "='" + id + "'", null); //db.update(CommonString.TABLE_COVERAGE_DATA, values1, CommonString.KEY_STORE_ID + "='" + id + "'", null);
} catch (Exception ex) { } catch (Exception ex) {
@@ -2925,15 +2925,16 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
} }
//update out time //update out time
public void updateCheckoutOuttime(String id, String out_time) { public void updateCheckoutOuttime(String id, String out_time, String status) {
ContentValues values = new ContentValues(); ContentValues values = new ContentValues();
try { try {
values.put(CommonString.KEY_OUT_TIME, out_time); values.put(CommonString.KEY_OUT_TIME, out_time);
values.put(CommonString.KEY_COVERAGE_STATUS, status);
db.update(CommonString.KEY_JOURNEY_PLAN, values, CommonString.KEY_STORE_ID + "='" + id + "'", null); db.update(CommonString.TABLE_COVERAGE_DATA, values, CommonString.KEY_STORE_ID + "='" + id + "'", null);
} catch (Exception ex) { } catch (Exception ex) {
@@ -392,7 +392,7 @@ public class MainActivity extends AppCompatActivity
public boolean isStoreCheckedIn() { public boolean isStoreCheckedIn() {
boolean result_flag = true; boolean result_flag = true;
/*for (int i = 0; i < coverageList.size(); i++) { for (int i = 0; i < coverageList.size(); i++) {
String status = coverageList.get(i).getStatus(); String status = coverageList.get(i).getStatus();
if (status.equals(CommonString.KEY_INVALID) || status.equals(CommonString.KEY_VALID)) { if (status.equals(CommonString.KEY_INVALID) || status.equals(CommonString.KEY_VALID)) {
@@ -400,7 +400,7 @@ public class MainActivity extends AppCompatActivity
error_msg = getResources().getString(R.string.title_store_list_checkout_current); error_msg = getResources().getString(R.string.title_store_list_checkout_current);
break; break;
} }
}*/ }
return result_flag; return result_flag;
} }
@@ -170,27 +170,6 @@ public class CheckoutActivity extends AppCompatActivity {
envelope); envelope);
Object result = (Object) envelope.getResponse(); Object result = (Object) envelope.getResponse();
//temporary------------
db.updateCheckoutOuttime(store_id, getCurrentTime());
SharedPreferences.Editor editor = preferences.edit();
editor.putString(CommonString.KEY_STORE_ID, "");
editor.putString(CommonString.KEY_STORE_NAME, "");
editor.putString(CommonString.KEY_VISIT_DATE, "");
editor.putString(CommonString.KEY_CAMERA_ALLOW, "");
editor.putString(CommonString.KEY_CHECKOUT_STATUS, "");
editor.putString(CommonString.KEY_CLASS_ID, "");
editor.putString(CommonString.KEY_EMP_ID, "");
editor.putString(CommonString.KEY_GEO_TAG, "");
editor.putString(CommonString.KEY_KEYACCOUNT_ID, "");
editor.putString(CommonString.KEY_STORETYPE_ID, "");
editor.putString(CommonString.KEY_UPLOAD_STATUS, "");
editor.commit();
db.updateCheckoutStatus(store_id, CommonString.KEY_C);
if (!result.toString().equalsIgnoreCase( if (!result.toString().equalsIgnoreCase(
CommonString.KEY_SUCCESS)) { CommonString.KEY_SUCCESS)) {
return "Upload_Store_ChecOut_Status"; return "Upload_Store_ChecOut_Status";
@@ -214,9 +193,9 @@ public class CheckoutActivity extends AppCompatActivity {
if (result.toString() if (result.toString()
.equalsIgnoreCase(CommonString.KEY_SUCCESS)) { .equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
db.updateCheckoutOuttime(store_id, getCurrentTime()); db.updateCheckoutOuttime(store_id, getCurrentTime(),CommonString.KEY_C);
editor = preferences.edit(); SharedPreferences.Editor editor = preferences.edit();
editor.putString(CommonString.KEY_STORE_ID, ""); editor.putString(CommonString.KEY_STORE_ID, "");
editor.putString(CommonString.KEY_STORE_NAME, ""); editor.putString(CommonString.KEY_STORE_NAME, "");
editor.putString(CommonString.KEY_VISIT_DATE, ""); editor.putString(CommonString.KEY_VISIT_DATE, "");