Merge pull request #60 from CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/GG_Additional_PromoCompliance_Vlidationa
//Stock_FacingActivity Changes today
This commit is contained in:
@@ -974,13 +974,13 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<MSL_AvailabilityGetterSetter> getMSL_AvailabilitySKU_AfterSaveData(String category_id, String brand_id) {
|
||||
public ArrayList<MSL_AvailabilityGetterSetter> getMSL_AvailabilitySKU_AfterSaveData(String category_id, String brand_id, String store_id) {
|
||||
ArrayList<MSL_AvailabilityGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
dbcursor = db.rawQuery("Select * from Msl_Availability_Data " +
|
||||
"where category_id='" + category_id + "' and Brand_Id='" + brand_id + "'", null);
|
||||
"where category_id='" + category_id + "' and Brand_Id='" + brand_id + "' AND Store_Id='" + store_id + "'", null);
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
@@ -1232,13 +1232,13 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
return list;
|
||||
}
|
||||
|
||||
public ArrayList<Stock_FacingGetterSetter> getStockAndFacingSKU_AfterSaveData(String category_id, String brand_id) {
|
||||
public ArrayList<Stock_FacingGetterSetter> getStockAndFacingSKU_AfterSaveData(String category_id, String brand_id, String store_id) {
|
||||
ArrayList<Stock_FacingGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
dbcursor = db.rawQuery("Select * from Stock_Facing_Child_Data " +
|
||||
"where category_id='" + category_id + "' and Brand_Id='" + brand_id + "'", null);
|
||||
"where category_id='" + category_id + "' and Brand_Id='" + brand_id + "' AND Store_Id='" + store_id + "'", null);
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
|
||||
+8
-10
@@ -72,11 +72,11 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||
|
||||
db = new GSKOrangeDB(this);
|
||||
db.open();
|
||||
|
||||
|
||||
|
||||
//preference data
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
@@ -226,7 +226,7 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
}
|
||||
|
||||
private void prepareList() {
|
||||
@@ -242,7 +242,7 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||
hashMapListHeaderData.add(headerDataList.get(i));
|
||||
|
||||
//childDataList = new ArrayList<>();
|
||||
childDataList = db.getMSL_AvailabilitySKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id());
|
||||
childDataList = db.getMSL_AvailabilitySKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||
if (!(childDataList.size() > 0)) {
|
||||
childDataList = db.getMSL_AvailabilitySKUData(categoryId, headerDataList.get(i).getBrand_id());
|
||||
}
|
||||
@@ -491,15 +491,13 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||
|
||||
private static boolean updateResources(Context context, String language) {
|
||||
|
||||
String lang ;
|
||||
String lang;
|
||||
|
||||
if(language.equalsIgnoreCase("English")){
|
||||
if (language.equalsIgnoreCase("English")) {
|
||||
lang = "EN";
|
||||
}
|
||||
else if(language.equalsIgnoreCase("UAE")) {
|
||||
} else if (language.equalsIgnoreCase("UAE")) {
|
||||
lang = "AR";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
lang = "TR";
|
||||
}
|
||||
|
||||
|
||||
+33
-32
@@ -50,15 +50,13 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
||||
|
||||
private static boolean updateResources(Context context, String language) {
|
||||
|
||||
String lang ;
|
||||
String lang;
|
||||
|
||||
if(language.equalsIgnoreCase("English")){
|
||||
if (language.equalsIgnoreCase("English")) {
|
||||
lang = "EN";
|
||||
}
|
||||
else if(language.equalsIgnoreCase("UAE")) {
|
||||
} else if (language.equalsIgnoreCase("UAE")) {
|
||||
lang = "AR";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
lang = "TR";
|
||||
}
|
||||
|
||||
@@ -99,11 +97,11 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
||||
btn_add = (Button) findViewById(R.id.btn_add);
|
||||
|
||||
db = new GSKOrangeDB(this);
|
||||
db.open();
|
||||
db.open();
|
||||
|
||||
//preference data
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
@@ -218,31 +216,34 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
||||
btn_add.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final View v) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(PromoComplianceActivity.this);
|
||||
builder.setMessage("Are you sure you want to add")
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
if (!cd.getSp_promo().equals("0")) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(PromoComplianceActivity.this);
|
||||
builder.setMessage("Are you sure you want to add")
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
db.InsertAdditionalPromoData(cd, categoryId);
|
||||
AdditionalPromoListView();
|
||||
|
||||
db.InsertAdditionalPromoData(cd, categoryId);
|
||||
AdditionalPromoListView();
|
||||
sp_promo.setSelection(0);
|
||||
toggle_add_InStock.setChecked(true);
|
||||
toggle_add_promoAnnouncer.setChecked(true);
|
||||
toggle_add_runningPos.setChecked(true);
|
||||
|
||||
sp_promo.setSelection(0);
|
||||
toggle_add_InStock.setChecked(true);
|
||||
toggle_add_promoAnnouncer.setChecked(true);
|
||||
toggle_add_runningPos.setChecked(true);
|
||||
|
||||
Snackbar.make(v, "promo is add", Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
//Toast.makeText(getApplicationContext(), "promo is add", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
})
|
||||
.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
Snackbar.make(v, "promo is add", Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
//Toast.makeText(getApplicationContext(), "promo is add", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
})
|
||||
.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
} else {
|
||||
Snackbar.make(v, "Select the promo value", Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -295,7 +296,7 @@ public class PromoComplianceActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
updateResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
}
|
||||
|
||||
private void prepareList() {
|
||||
|
||||
+1
-1
@@ -300,7 +300,7 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
hashMapListHeaderData.add(headerDataList.get(i));
|
||||
|
||||
//Child Data
|
||||
childDataList = db.getStockAndFacingSKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id());
|
||||
childDataList = db.getStockAndFacingSKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||
if (!(childDataList.size() > 0)) {
|
||||
childDataList = db.getStockAndFacingSKUData(categoryId, headerDataList.get(i).getBrand_id());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user