Merge pull request #65 from CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/AShishDONE
newcode
This commit is contained in:
Generated
+1
-1
@@ -41,7 +41,7 @@
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -15,6 +15,7 @@ import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||
import cpm.com.gskmtorange.GetterSetter.GeotaggingBeans;
|
||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
|
||||
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
|
||||
|
||||
@@ -116,6 +117,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_T2P_SKU);
|
||||
|
||||
db.execSQL(TableBean.getMappingPlanogram());
|
||||
db.execSQL(TableBean.getAdditionalDisplay());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2614,6 +2617,9 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
long key_id = db.insert(CommonString.TABLE_INSERT_STOCK_ADDITIONAL_MAIN, null, values);
|
||||
|
||||
if(skulist!=null)
|
||||
{
|
||||
|
||||
for (int j = 0; j < skulist.size(); j++) {
|
||||
values1.put(CommonString.KEY_Common_ID, key_id);
|
||||
values1.put(CommonString.KEY_STORE_ID, skulist.get(j).getStore_id());
|
||||
@@ -2626,7 +2632,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
db.insert(CommonString.TABLE_INSERT_STOCK_DIALOG_MAIN, null, values1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
Log.d("Database Exception ", ex.getMessage());
|
||||
@@ -2966,4 +2972,119 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public ArrayList<AddittionalGetterSetter> getAdditionalMainStock(String store_id, String categoryId) {
|
||||
Cursor cursordata = null;
|
||||
ArrayList<AddittionalGetterSetter> productData = new ArrayList<AddittionalGetterSetter>();
|
||||
|
||||
try {
|
||||
|
||||
// cursordata = db.rawQuery("SELECT * FROM Stock_Additional_visibility WHERE Store_Id = '"+store_id + "'categoryId = '"+categoryId + "'", null);
|
||||
cursordata = db.rawQuery("Select * from Stock_Additional_visibility_Main " + "where categoryId='" + categoryId + "' and Store_Id='" + store_id + "'", null);
|
||||
|
||||
if (cursordata != null) {
|
||||
cursordata.moveToFirst();
|
||||
while (!cursordata.isAfterLast()) {
|
||||
AddittionalGetterSetter sb = new AddittionalGetterSetter();
|
||||
|
||||
|
||||
sb.setKey_id(cursordata.getString(cursordata
|
||||
.getColumnIndexOrThrow("KEY_ID")));
|
||||
|
||||
sb.setStore_id(cursordata.getString(cursordata
|
||||
.getColumnIndexOrThrow("Store_Id")));
|
||||
|
||||
sb.setCategoryId(cursordata.getString(cursordata
|
||||
.getColumnIndexOrThrow("categoryId")));
|
||||
|
||||
sb.setBrand_id(cursordata.getString(cursordata
|
||||
.getColumnIndexOrThrow("brand_id")));
|
||||
|
||||
sb.setBrand(cursordata.getString(cursordata
|
||||
.getColumnIndexOrThrow("brand_name")));
|
||||
|
||||
|
||||
sb.setImage(cursordata.getString(cursordata
|
||||
.getColumnIndexOrThrow("image_url")));
|
||||
|
||||
sb.setSku_id(cursordata.getString(cursordata
|
||||
.getColumnIndexOrThrow("sku_id")));
|
||||
|
||||
sb.setSku(cursordata.getString(cursordata
|
||||
.getColumnIndexOrThrow("sku_name")));
|
||||
sb.setBtn_toogle(cursordata.getString(cursordata
|
||||
.getColumnIndexOrThrow("toggle_value")));
|
||||
|
||||
productData.add(sb);
|
||||
cursordata.moveToNext();
|
||||
}
|
||||
cursordata.close();
|
||||
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
return productData;
|
||||
|
||||
}
|
||||
|
||||
public void InsertADDITIONAL_DISPLAY(ADDITIONAL_DISPLAY_MASTERGetterSetter data) {
|
||||
db.delete("ADDITIONAL_DISPLAY_MASTER", null, null);
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
try {
|
||||
for (int i = 0; i < data.getDISPLAY_ID().size(); i++) {
|
||||
|
||||
values.put("DISPLAY_ID", data.getDISPLAY_ID().get(i));
|
||||
values.put("DISPLAY", data.getDISPLAY().get(i));
|
||||
values.put("IMAGE_PATH", data.getIMAGE_PATH().get(i));
|
||||
values.put("IMAGE_URL", data.getIMAGE_URL().get(i));
|
||||
db.insert("ADDITIONAL_DISPLAY_MASTER", null, values);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.d("Exception ", " ADDITIONAL_DISPLAY_MASTER " + ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<ADDITIONAL_DISPLAY_MASTERGetterSetter> getADDITIONAL_DISPLAYData(String store_id) {
|
||||
Cursor cursordata = null;
|
||||
ArrayList<ADDITIONAL_DISPLAY_MASTERGetterSetter> Data = new ArrayList<ADDITIONAL_DISPLAY_MASTERGetterSetter>();
|
||||
|
||||
try {
|
||||
|
||||
cursordata = db.rawQuery("SELECT * FROM ADDITIONAL_DISPLAY_MASTER ", null);
|
||||
|
||||
if (cursordata != null) {
|
||||
cursordata.moveToFirst();
|
||||
while (!cursordata.isAfterLast()) {
|
||||
ADDITIONAL_DISPLAY_MASTERGetterSetter sb = new ADDITIONAL_DISPLAY_MASTERGetterSetter();
|
||||
sb.setDISPLAY_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("DISPLAY_ID")));
|
||||
sb.setDISPLAY(cursordata.getString(cursordata.getColumnIndexOrThrow("DISPLAY")));
|
||||
sb.setIMAGE_URL(cursordata.getString(cursordata.getColumnIndexOrThrow("IMAGE_URL")));
|
||||
sb.setIMAGE_PATH(cursordata.getString(cursordata.getColumnIndexOrThrow("IMAGE_PATH")));
|
||||
|
||||
Data.add(sb);
|
||||
cursordata.moveToNext();
|
||||
}
|
||||
cursordata.close();
|
||||
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
return Data;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+175
-73
@@ -60,6 +60,7 @@ import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.gsk_dailyentry.DailyDataMenuActivity;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
||||
@@ -71,6 +72,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
||||
public class AdditionalVisibility extends AppCompatActivity implements View.OnClickListener, AdapterView.OnItemSelectedListener {
|
||||
ArrayList<AdditionalDialogGetterSetter> list = new ArrayList<AdditionalDialogGetterSetter>();
|
||||
ArrayList<AddittionalGetterSetter> listdata = new ArrayList<AddittionalGetterSetter>();
|
||||
ArrayList<AddittionalGetterSetter> listMain = new ArrayList<AddittionalGetterSetter>();
|
||||
ArrayList<AdditionalDialogGetterSetter> additionalVisibilitySkuList;
|
||||
ArrayList<AdditionalDialogGetterSetter> additionalVisibilityinsertSkuList;
|
||||
ArrayList<AdditionalDialogGetterSetter> uploadlist = new ArrayList<AdditionalDialogGetterSetter>();
|
||||
@@ -92,7 +94,9 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
ArrayList<BrandMasterGetterSetter> brandList;
|
||||
|
||||
ArrayList<BrandMasterGetterSetter> brand_list;
|
||||
ArrayList<SkuMasterGetterSetter> skuMaster_list;
|
||||
ArrayList<ADDITIONAL_DISPLAY_MASTERGetterSetter> DisplayMaster_list;
|
||||
//ArrayList<ADDITIONAL_DISPLAY_MASTERGetterSetter> DisplayMaster_list;
|
||||
|
||||
|
||||
|
||||
ArrayList<SkuGetterSetter> empty_list = new ArrayList<>();
|
||||
@@ -170,12 +174,12 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
|
||||
///Display List
|
||||
|
||||
skuMaster_list = db.getSKUMasterData(store_id);
|
||||
DisplayMaster_list = db.getADDITIONAL_DISPLAYData(store_id);
|
||||
|
||||
SkuMasterGetterSetter select = new SkuMasterGetterSetter();
|
||||
select.setSKU(str);
|
||||
skuMaster_list.add(0, select);
|
||||
CustomSkuMasterAdpter skuadapter = new CustomSkuMasterAdpter(AdditionalVisibility.this, R.layout.custom_spinner_item, skuMaster_list);
|
||||
ADDITIONAL_DISPLAY_MASTERGetterSetter select = new ADDITIONAL_DISPLAY_MASTERGetterSetter();
|
||||
select.setDISPLAY_ID(str);
|
||||
DisplayMaster_list.add(0, select);
|
||||
CustomSkuMasterAdpter skuadapter = new CustomSkuMasterAdpter(AdditionalVisibility.this, R.layout.custom_spinner_item, DisplayMaster_list);
|
||||
spinner_sku_list.setAdapter(skuadapter);
|
||||
|
||||
spinner_brand_list.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@@ -202,8 +206,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
|
||||
if (position != 0) {
|
||||
|
||||
sku_list_name = skuMaster_list.get(position).getSKU().get(0);
|
||||
sku_list_id = skuMaster_list.get(position).getSKU_ID().get(0);
|
||||
sku_list_name = DisplayMaster_list.get(position).getDISPLAY().get(0);
|
||||
sku_list_id = DisplayMaster_list.get(position).getDISPLAY_ID().get(0);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -214,19 +218,18 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
}
|
||||
});
|
||||
|
||||
listdata = db.getAdditionalStock(store_id,categoryId);
|
||||
/// maintable
|
||||
|
||||
listMain = db.getAdditionalMainStock(store_id, categoryId);
|
||||
|
||||
for (int k = 0; k < listdata.size(); k++) {
|
||||
for (int k = 0; k < listMain.size(); k++) {
|
||||
|
||||
String tooglevalue= listdata.get(k).getBtn_toogle();
|
||||
String tooglevalue = listMain.get(k).getBtn_toogle();
|
||||
|
||||
if(tooglevalue.equalsIgnoreCase("0"))
|
||||
{
|
||||
if (tooglevalue.equalsIgnoreCase("0")) {
|
||||
btnaddlayout.setVisibility(View.INVISIBLE);
|
||||
cardvew.setVisibility(View.INVISIBLE);
|
||||
listviewlay.setVisibility(View.INVISIBLE);
|
||||
|
||||
maincard.setVisibility(View.INVISIBLE);
|
||||
btntoggle.setChecked(false);
|
||||
brandlayout.setVisibility(View.INVISIBLE);
|
||||
@@ -241,6 +244,27 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
|
||||
}
|
||||
|
||||
listdata = db.getAdditionalStock(store_id, categoryId);
|
||||
|
||||
for (int k = 0; k < listdata.size(); k++) {
|
||||
|
||||
String tooglevalue = listdata.get(k).getBtn_toogle();
|
||||
|
||||
if (tooglevalue.equalsIgnoreCase("0")) {
|
||||
btnaddlayout.setVisibility(View.INVISIBLE);
|
||||
cardvew.setVisibility(View.INVISIBLE);
|
||||
listviewlay.setVisibility(View.INVISIBLE);
|
||||
|
||||
maincard.setVisibility(View.INVISIBLE);
|
||||
btntoggle.setChecked(false);
|
||||
brandlayout.setVisibility(View.INVISIBLE);
|
||||
diaplylayout.setVisibility(View.INVISIBLE);
|
||||
cameralayout.setVisibility(View.INVISIBLE);
|
||||
btnsku.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (listdata.size() > 0) {
|
||||
for (int i = 0; i < listdata.size(); i++) {
|
||||
@@ -266,10 +290,11 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
if (togglevalue.equals("1")) {
|
||||
|
||||
listdata = db.getAdditionalStock(store_id, categoryId);
|
||||
|
||||
if(listdata.size()>0)
|
||||
{
|
||||
if (listdata.size() > 0) {
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
||||
AdditionalVisibility.this);
|
||||
// set title
|
||||
@@ -318,12 +343,59 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
// show it
|
||||
alertDialog.show();
|
||||
|
||||
}else
|
||||
{
|
||||
} else {
|
||||
Snackbar.make(view, getResources().getString(R.string.title_activity_Want_add), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
}
|
||||
} else {
|
||||
|
||||
}});
|
||||
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
||||
AdditionalVisibility.this);
|
||||
// set title
|
||||
alertDialogBuilder.setTitle(getResources().getString(R.string.title_activity_Want_save));
|
||||
// set dialog message
|
||||
alertDialogBuilder
|
||||
.setMessage(getResources().getString(R.string.title_activity_save_data))
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
|
||||
db.deleteStockEntryall(store_id, categoryId);
|
||||
|
||||
newadd = new AddittionalGetterSetter();
|
||||
newadd.setBrand(brand_list_name);
|
||||
newadd.setBrand_id(brand_list_id);
|
||||
newadd.setImage(img_str);
|
||||
newadd.setSku(sku_list_name);
|
||||
newadd.setSku_id(sku_list_id);
|
||||
newadd.setStore_id(store_id);
|
||||
newadd.setBtn_toogle(togglevalue);
|
||||
newadd.setCategoryId(categoryId);
|
||||
|
||||
|
||||
db.InsertMainListAdditionalData(newadd, additionalVisibilitySkuList, categoryId);
|
||||
finish();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
// if this button is clicked, just close
|
||||
// the dialog box and do nothing
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
|
||||
// create alert dialog
|
||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
|
||||
// show it
|
||||
alertDialog.show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
btnaddlayout.setOnClickListener(new View.OnClickListener() {
|
||||
@@ -362,29 +434,22 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
sku_list_id = "";
|
||||
defdata.clear();
|
||||
|
||||
if(camera_allow.equals("1"))
|
||||
{
|
||||
if (camera_allow.equals("1")) {
|
||||
btnimage.setBackgroundResource(R.mipmap.camera_orange);
|
||||
}else
|
||||
{
|
||||
} else {
|
||||
btnimage.setBackgroundResource(R.mipmap.camera_grey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
listdata = db.getAdditionalStock(store_id, categoryId);
|
||||
if (listdata.size() > 0) {
|
||||
for(int i=0;i<listdata.size();i++)
|
||||
{
|
||||
if(listdata.get(i).getBtn_toogle().equalsIgnoreCase("0"))
|
||||
{
|
||||
for (int i = 0; i < listdata.size(); i++) {
|
||||
if (listdata.get(i).getBtn_toogle().equalsIgnoreCase("0")) {
|
||||
listviewlay.setVisibility(View.INVISIBLE);
|
||||
maincard.setVisibility(View.INVISIBLE);
|
||||
cardvew.setVisibility(View.INVISIBLE);
|
||||
btnaddlayout.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||
listviewlay.setAdapter(adapteradditional);
|
||||
listviewlay.invalidateViews();
|
||||
@@ -429,8 +494,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
if (btntoggle.isChecked()) {
|
||||
listdata = db.getAdditionalStock(store_id, categoryId);
|
||||
|
||||
if(listdata.size()>0)
|
||||
{
|
||||
if (listdata.size() > 0) {
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
||||
AdditionalVisibility.this);
|
||||
// set title
|
||||
@@ -442,6 +506,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
togglevalue = "1";
|
||||
btntoggle.setChecked(true);
|
||||
db.deleteStockEntryall(store_id, categoryId);
|
||||
brandlayout.setVisibility(View.VISIBLE);
|
||||
diaplylayout.setVisibility(View.VISIBLE);
|
||||
@@ -450,7 +515,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
btnaddlayout.setVisibility(View.VISIBLE);
|
||||
cardvew.setVisibility(View.VISIBLE);
|
||||
listviewlay.setVisibility(View.VISIBLE);
|
||||
maincard.setVisibility(View.VISIBLE);
|
||||
maincard.setVisibility(View.INVISIBLE);
|
||||
listdata = db.getAdditionalStock(store_id, categoryId);
|
||||
|
||||
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||
@@ -463,6 +528,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
// if this button is clicked, just close
|
||||
// the dialog box and do nothing
|
||||
dialog.cancel();
|
||||
btntoggle.setChecked(false);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -471,17 +537,67 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
// show it
|
||||
alertDialog.show();
|
||||
|
||||
}else
|
||||
} else {
|
||||
|
||||
listMain = db.getAdditionalMainStock(store_id, categoryId);
|
||||
|
||||
if(listMain.size()>0)
|
||||
{
|
||||
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
||||
AdditionalVisibility.this);
|
||||
// set title
|
||||
alertDialogBuilder.setTitle(getResources().getString(R.string.title_activity_Want_to_delete));
|
||||
// set dialog message
|
||||
alertDialogBuilder
|
||||
.setMessage(getResources().getString(R.string.title_activity_click_delete))
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
db.deleteStockEntryall(store_id, categoryId);
|
||||
togglevalue = "1";
|
||||
btntoggle.setChecked(true);
|
||||
brandlayout.setVisibility(View.VISIBLE);
|
||||
diaplylayout.setVisibility(View.VISIBLE);
|
||||
cameralayout.setVisibility(View.VISIBLE);
|
||||
btnsku.setVisibility(View.VISIBLE);
|
||||
btnaddlayout.setVisibility(View.VISIBLE);
|
||||
cardvew.setVisibility(View.VISIBLE);
|
||||
listviewlay.setVisibility(View.VISIBLE);
|
||||
maincard.setVisibility(View.VISIBLE);
|
||||
listviewlay.setVisibility(View.INVISIBLE);
|
||||
maincard.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
// if this button is clicked, just close
|
||||
// the dialog box and do nothing
|
||||
dialog.cancel();
|
||||
btntoggle.setChecked(false);
|
||||
}
|
||||
});
|
||||
|
||||
// create alert dialog
|
||||
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||
// show it
|
||||
alertDialog.show();
|
||||
|
||||
}
|
||||
else{
|
||||
togglevalue = "1";
|
||||
btntoggle.setChecked(true);
|
||||
brandlayout.setVisibility(View.VISIBLE);
|
||||
diaplylayout.setVisibility(View.VISIBLE);
|
||||
cameralayout.setVisibility(View.VISIBLE);
|
||||
btnsku.setVisibility(View.VISIBLE);
|
||||
btnaddlayout.setVisibility(View.VISIBLE);
|
||||
cardvew.setVisibility(View.VISIBLE);
|
||||
listviewlay.setVisibility(View.INVISIBLE);
|
||||
maincard.setVisibility(View.INVISIBLE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -489,8 +605,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
|
||||
listdata = db.getAdditionalStock(store_id, categoryId);
|
||||
|
||||
if(listdata.size()>0)
|
||||
{
|
||||
if (listdata.size() > 0) {
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
||||
AdditionalVisibility.this);
|
||||
// set title
|
||||
@@ -504,25 +619,29 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
db.deleteStockEntryall(store_id, categoryId);
|
||||
togglevalue = "0";
|
||||
btntoggle.setChecked(false);
|
||||
|
||||
defdata.clear();
|
||||
btnaddlayout.setVisibility(View.INVISIBLE);
|
||||
brandlayout.setVisibility(View.INVISIBLE);
|
||||
diaplylayout.setVisibility(View.INVISIBLE);
|
||||
cameralayout.setVisibility(View.INVISIBLE);
|
||||
btnsku.setVisibility(View.INVISIBLE);
|
||||
|
||||
maincard.setVisibility(View.INVISIBLE);
|
||||
listdata = db.getAdditionalStock(store_id, categoryId);
|
||||
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||
listviewlay.setAdapter(adapteradditional);
|
||||
listviewlay.invalidateViews();
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
// if this button is clicked, just close
|
||||
// the dialog box and do nothing
|
||||
btntoggle.setChecked(true);
|
||||
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
@@ -532,14 +651,16 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
// show it
|
||||
alertDialog.show();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
togglevalue = "0";
|
||||
defdata.clear();
|
||||
btntoggle.setChecked(false);
|
||||
btnaddlayout.setVisibility(View.INVISIBLE);
|
||||
brandlayout.setVisibility(View.INVISIBLE);
|
||||
diaplylayout.setVisibility(View.INVISIBLE);
|
||||
cameralayout.setVisibility(View.INVISIBLE);
|
||||
btnsku.setVisibility(View.INVISIBLE);
|
||||
maincard.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -547,8 +668,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
if (camera_allow.equals("1")) {
|
||||
|
||||
btnimage.setOnClickListener(new View.OnClickListener() {
|
||||
@@ -564,22 +683,13 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
btnimage.setBackgroundResource(R.mipmap.camera_grey);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
btnsku.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
@@ -745,7 +855,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
|
||||
private Activity activity;
|
||||
private ArrayList data;
|
||||
SkuMasterGetterSetter tempValues = null;
|
||||
ADDITIONAL_DISPLAY_MASTERGetterSetter tempValues = null;
|
||||
LayoutInflater inflater;
|
||||
|
||||
/*************
|
||||
@@ -785,7 +895,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
|
||||
/***** Get each Model object from Arraylist ********/
|
||||
tempValues = null;
|
||||
tempValues = (SkuMasterGetterSetter) data.get(position);
|
||||
tempValues = (ADDITIONAL_DISPLAY_MASTERGetterSetter) data.get(position);
|
||||
|
||||
TextView label = (TextView) row.findViewById(R.id.tv_text);
|
||||
|
||||
@@ -796,7 +906,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
//sub.setText("");
|
||||
} else {
|
||||
// Set values for spinner each row
|
||||
label.setText(tempValues.getSKU().get(0));
|
||||
label.setText(tempValues.getDISPLAY().get(0));
|
||||
}
|
||||
|
||||
return row;
|
||||
@@ -853,8 +963,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||
intent.setPackage(defaultCameraPackage);
|
||||
startActivityForResult(intent, 0);
|
||||
}
|
||||
catch (ActivityNotFoundException e) {
|
||||
} catch (ActivityNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
@@ -862,11 +971,11 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
intent.setPackage(gallery_package);
|
||||
startActivityForResult(intent, 0);
|
||||
|
||||
}
|
||||
catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
|
||||
@@ -1318,13 +1427,11 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
db.deleteStockEntry(listdata.get(position1).getKey_id());
|
||||
|
||||
|
||||
|
||||
adapteradditional.notifyDataSetChanged();
|
||||
|
||||
listdata = db.getAdditionalStock(store_id, categoryId);
|
||||
|
||||
|
||||
|
||||
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||
listviewlay.setAdapter(adapteradditional);
|
||||
|
||||
@@ -1402,9 +1509,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
|
||||
errormsg = getResources().getString(R.string.title_activity_select_dropdown);
|
||||
|
||||
}
|
||||
else if(camera_allow.equals("1"))
|
||||
{
|
||||
} else if (camera_allow.equals("1")) {
|
||||
if (imageu == null || imageu.equalsIgnoreCase("")) {
|
||||
flag = false;
|
||||
|
||||
@@ -1412,8 +1517,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (dialog.size() == 0) {
|
||||
} else if (dialog.size() == 0) {
|
||||
|
||||
errormsg = getResources().getString(R.string.title_activity_fill_sku);
|
||||
flag = false;
|
||||
@@ -1469,11 +1573,9 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
|
||||
if (language.equalsIgnoreCase("English")) {
|
||||
lang = "EN";
|
||||
}
|
||||
else if(language.equalsIgnoreCase("UAE")) {
|
||||
} else if (language.equalsIgnoreCase("UAE")) {
|
||||
lang = "AR";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
lang = "TR";
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ import java.util.Locale;
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
|
||||
@@ -76,6 +77,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
MappingPromotionGetterSetter mappingPromotionGetterSetter;
|
||||
MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter mapping_additional_promotion_masterGetterSetter;
|
||||
STORE_PERFORMANCE_MasterGetterSetter store_performance_masterGetterSetter;
|
||||
ADDITIONAL_DISPLAY_MASTERGetterSetter additional_display_getter_setter;
|
||||
|
||||
MAPPING_PLANOGRAM_MasterGetterSetter mapping_planogram_masterGetterSetter;
|
||||
private Dialog dialog;
|
||||
private ProgressBar pb;
|
||||
@@ -639,6 +642,42 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
|
||||
//ADDITIONAL_DISPLAY_MASTER
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "ADDITIONAL_DISPLAY_MASTER");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
additional_display_getter_setter = XMLHandlers.ADDITIONAL_DISPLAY_MASTERXMLHandler(xpp, eventType);
|
||||
|
||||
if (additional_display_getter_setter.getDISPLAY_ID().size() > 0) {
|
||||
String table_store_display = additional_display_getter_setter.getTable_STORE_ADDITIONAL_DISPLAY();
|
||||
if (table_store_display != null) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setAdditionalDisplay(table_store_display);
|
||||
}
|
||||
} else {
|
||||
//return "ADDITIONAL_DISPLAY_MASTER";
|
||||
}
|
||||
data.value = 100;
|
||||
data.name = "ADDITIONAL_DISPLAY_MASTER Data Download";
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
//MAPPING_PLANOGRAM
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
@@ -754,6 +793,9 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
|
||||
db.InsertSTORE_PERFORMANCE(store_performance_masterGetterSetter);
|
||||
db.InsertMAPPING_PLANOGRAM(mapping_planogram_masterGetterSetter);
|
||||
db.InsertADDITIONAL_DISPLAY(additional_display_getter_setter);
|
||||
|
||||
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
/*final AlertMessage message = new AlertMessage(
|
||||
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by ashishc on 18-01-2017.
|
||||
*/
|
||||
|
||||
public class ADDITIONAL_DISPLAY_MASTERGetterSetter {
|
||||
|
||||
|
||||
ArrayList<String> DISPLAY_ID = new ArrayList<>();
|
||||
|
||||
public String getTable_STORE_ADDITIONAL_DISPLAY() {
|
||||
return table_STORE_ADDITIONAL_DISPLAY;
|
||||
}
|
||||
|
||||
public void setTable_STORE_ADDITIONAL_DISPLAY(String table_STORE_ADDITIONAL_DISPLAY) {
|
||||
this.table_STORE_ADDITIONAL_DISPLAY = table_STORE_ADDITIONAL_DISPLAY;
|
||||
}
|
||||
|
||||
String table_STORE_ADDITIONAL_DISPLAY;
|
||||
|
||||
|
||||
public ArrayList<String> getDISPLAY() {
|
||||
return DISPLAY;
|
||||
}
|
||||
|
||||
public void setDISPLAY(String DISPLAY) {
|
||||
this.DISPLAY.add(DISPLAY);
|
||||
}
|
||||
|
||||
public ArrayList<String> getDISPLAY_ID() {
|
||||
return DISPLAY_ID;
|
||||
}
|
||||
|
||||
public void setDISPLAY_ID(String DISPLAY_ID) {
|
||||
this.DISPLAY_ID.add(DISPLAY_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getIMAGE_URL() {
|
||||
return IMAGE_URL;
|
||||
}
|
||||
|
||||
public void setIMAGE_URL(String IMAGE_URL) {
|
||||
this.IMAGE_URL.add(IMAGE_URL);
|
||||
}
|
||||
|
||||
ArrayList<String> DISPLAY = new ArrayList<>();
|
||||
ArrayList<String> IMAGE_URL = new ArrayList<>();
|
||||
|
||||
public ArrayList<String> getIMAGE_PATH() {
|
||||
return IMAGE_PATH;
|
||||
}
|
||||
|
||||
public void setIMAGE_PATH(String IMAGE_PATH) {
|
||||
this.IMAGE_PATH.add(IMAGE_PATH);
|
||||
}
|
||||
|
||||
ArrayList<String> IMAGE_PATH = new ArrayList<>();
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -24,6 +24,16 @@ public class TableBean {
|
||||
public static String STORE_PERFORMANCE;
|
||||
public static String MAPPING_PLANOGRAM;
|
||||
|
||||
public static String getAdditionalDisplay() {
|
||||
return ADDITIONAL_DISPLAY;
|
||||
}
|
||||
|
||||
public static void setAdditionalDisplay(String additionalDisplay) {
|
||||
ADDITIONAL_DISPLAY = additionalDisplay;
|
||||
}
|
||||
|
||||
public static String ADDITIONAL_DISPLAY;
|
||||
|
||||
//Gagan end code
|
||||
|
||||
public static String getJourneyPlan() {
|
||||
|
||||
@@ -5,6 +5,7 @@ import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
|
||||
@@ -708,4 +709,49 @@ public class XMLHandlers {
|
||||
return st;
|
||||
}
|
||||
//Gagan End Code
|
||||
|
||||
|
||||
public static ADDITIONAL_DISPLAY_MASTERGetterSetter ADDITIONAL_DISPLAY_MASTERXMLHandler(XmlPullParser xpp, int eventType) {
|
||||
ADDITIONAL_DISPLAY_MASTERGetterSetter st = new ADDITIONAL_DISPLAY_MASTERGetterSetter();
|
||||
|
||||
try {
|
||||
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||
|
||||
if (xpp.getName().equals("META_DATA")) {
|
||||
st.setTable_STORE_ADDITIONAL_DISPLAY(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("DISPLAY_ID")) {
|
||||
st.setDISPLAY_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("DISPLAY")) {
|
||||
st.setDISPLAY(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("IMAGE_URL")) {
|
||||
st.setIMAGE_URL(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("IMAGE_PATH")) {
|
||||
st.setIMAGE_PATH(xpp.nextText());
|
||||
}
|
||||
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
} catch (XmlPullParserException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return st;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -144,22 +144,23 @@
|
||||
<string name="uploadimge">Fotoğraflar paylaşılıyor</string>
|
||||
<string name="success">Başarı</string>
|
||||
<string name="wantcheckout">Mağazadan çıkmak istiyor musunuz?</string>
|
||||
<string name="nonetwork">No Network Connection. Please check your Internet Connection</string>
|
||||
<string name="nonetwork">Bağlantı kurulamıyor. İnternet bağlantınızı kontrol ediniz</string>
|
||||
<string name="click_image">En az bir fotoğraf çekiniz</string>
|
||||
|
||||
<string name="title_store_list_activity_already_store_closed">Store Already Closed</string>
|
||||
<string name="title_store_list_activity_store_closed">Store Closed</string>
|
||||
<string name="title_store_list_activity_store_already_done">Store Already Uploaded</string>
|
||||
<string name="title_store_list_activity_store_data_uploaded">Store Data Uploaded</string>
|
||||
<string name="title_store_list_activity_store_already_checkout">Store Already Checkout</string>
|
||||
<string name="title_store_list_activity_already_store_closed">Mağaza kapalı</string>
|
||||
<string name="title_store_list_activity_store_closed">Mağaza kapalı</string>
|
||||
<string name="title_store_list_activity_store_already_done">Paylaşılan mağaza</string>
|
||||
<string name="title_store_list_activity_store_data_uploaded">Paylaşılan mağaza</string>
|
||||
<string name="title_store_list_activity_store_already_checkout">Mağaza zaten çıkılmış</string>
|
||||
<string name="title_store_list_activity_store_again_uploaded">Please Store data again Uploaded</string>
|
||||
<string name="title_store_list_checkout_current">Please checkout from current store</string>
|
||||
<string name="title_store_list_checkout_Already_filled">Data already filled</string>
|
||||
<string name="NetworkError">Network Error ,</string>
|
||||
<string name="uploadeddata"> Uploaded Data ,</string>
|
||||
<string name="DataNot"> Data Not Uploaded ,</string>
|
||||
<string name="delete">Delete</string>
|
||||
<string name="title_store_list_checkout_current">Lütfen önce mağazadan çık</string>
|
||||
<string name="title_store_list_checkout_Already_filled">Doldurulmuş veriler</string>
|
||||
<string name="NetworkError">Bağlantı kurulamıyor ,</string>
|
||||
<string name="uploadeddata">Veriler Paylaşılıyor ,</string>
|
||||
<string name="DataNot">Veriler Paylaşılmadı ,</string>
|
||||
<string name="delete">Sil</string>
|
||||
<string name="adddatatoclick">Click Yes To Add Data</string>
|
||||
<string name="displayname">Teşhir Türü</string>
|
||||
|
||||
<!--Gagan start new code 2-->
|
||||
<string name="stock_facing_planogram_dialog_title">Örnek Fotoğraf</string>
|
||||
|
||||
Reference in New Issue
Block a user