Merge pull request #17 from CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/GG_StockFacing_No_Camera_Icon

//language change
This commit is contained in:
gagangoel290
2017-02-23 16:14:17 +05:30
committed by GitHub
2 changed files with 33 additions and 5 deletions
@@ -4574,4 +4574,29 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
"store_id='" + storeId + "' And category_id='" + categoryId + "' ", null);
}
public boolean isPlanogramAddShelfSaveData(String store_id, String category_id) {
boolean filled = false;
Cursor dbcursor = null;
try {
dbcursor = db.rawQuery("Select * from Stock_Facing_Planogram_Header_Data " +
"where Store_id='" + store_id + "' and category_id='" + category_id + "'", null);
if (dbcursor != null) {
dbcursor.moveToFirst();
int icount = dbcursor.getInt(0);
dbcursor.close();
if (icount > 0) {
filled = true;
} else {
filled = false;
}
}
} catch (Exception e) {
Log.d("Exception ", " when fetching Records!!!!!!!!!!!!!!!!!!!!! " + e.toString());
return filled;
}
return filled;
}
}
@@ -130,7 +130,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
}else{
} else {
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
}
@@ -479,9 +479,13 @@ public class Stock_FacingActivity extends AppCompatActivity {
lin_camera3.setVisibility(View.GONE);
lin_camera4.setVisibility(View.GONE);
camera1.setBackgroundResource(R.mipmap.new_no_camera);
if (db.isPlanogramAddShelfSaveData(store_id, categoryId)) {
camera1.setBackgroundResource(R.mipmap.new_no_camera_done_edit);
} else {
camera1.setBackgroundResource(R.mipmap.new_no_camera);
}
lin_camera1.setOnClickListener(new View.OnClickListener() {
lin_camera1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(Stock_FacingActivity.this, StockFacing_PlanogramTrackerActivity.class);
@@ -499,7 +503,6 @@ public class Stock_FacingActivity extends AppCompatActivity {
});
} else {
findViewById(R.id.lin_camera).setVisibility(View.GONE);
}
}
@@ -1109,7 +1112,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
case 100:
//Planogram List for check and delete on backPress
prepareDefaultList();
if (planogramShelfHeaderDataList.size() > 0) {
if (db.isPlanogramAddShelfSaveData(store_id, categoryId)) {
camera1.setBackgroundResource(R.mipmap.new_no_camera_done_edit);
}