newcode
This commit is contained in:
Generated
-2
@@ -3,8 +3,6 @@
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/GSKMTOrange/GSKMTOrange.iml" filepath="$PROJECT_DIR$/GSKMTOrange/GSKMTOrange.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/GSKMTOrange/GSKMTOrange.iml" filepath="$PROJECT_DIR$/GSKMTOrange/GSKMTOrange.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/GSKORANGEV1.iml" filepath="$PROJECT_DIR$/GSKORANGEV1.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/GSKORANGEV1.iml" filepath="$PROJECT_DIR$/GSKORANGEV1.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
|
||||
@@ -2034,6 +2034,9 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
sb.setKEY_ID(cursordata.getString(cursordata
|
||||
.getColumnIndexOrThrow(CommonString.KEY_ID)));
|
||||
|
||||
sb.setCOMMON_ID(cursordata.getString(cursordata
|
||||
.getColumnIndexOrThrow(CommonString.KEY_Common_ID)));
|
||||
|
||||
sb.setBrand_id(cursordata.getString(cursordata
|
||||
.getColumnIndexOrThrow(CommonString.KEY_BRAND_ID)));
|
||||
|
||||
@@ -2083,7 +2086,17 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
}
|
||||
public void deleteStockEntryall(String storeid,String categoryid) {
|
||||
try {
|
||||
|
||||
db.delete(CommonString.TABLE_INSERT_STOCK_ADDITIONAL, "Store_Id" + "='" + storeid +"categoryId" + "='" + categoryid + "'", null);
|
||||
db.delete(CommonString.TABLE_INSERT_STOCK_DIALOG, "Store_Id" + "='" + storeid +"categoryId" + "='" + categoryid + "'", null);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("" + e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2093,7 +2106,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
try {
|
||||
|
||||
cursordata = db.rawQuery("SELECT * FROM BRAND_MASTER ", null);
|
||||
cursordata = db.rawQuery("SELECT BR.BRAND_ID, BR.BRAND FROM BRAND_MASTER BR INNER JOIN SUB_CATEGORY_MASTER SB ON BR.SUB_CATEGORY_ID = SB.SUB_CATEGORY_ID INNER JOIN CATEGORY_MASTER CA ON SB.CATEGORY_ID =CA.CATEGORY_ID WHERE COMPANY_ID =1", null);
|
||||
|
||||
if (cursordata != null) {
|
||||
cursordata.moveToFirst();
|
||||
@@ -2104,13 +2117,11 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
sb.setBRAND(cursordata.getString(cursordata.getColumnIndexOrThrow("BRAND")));
|
||||
|
||||
sb.setSUB_CATEGORY_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("SUB_CATEGORY_ID")));
|
||||
|
||||
|
||||
/*sb.setSUB_CATEGORY_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("SUB_CATEGORY_ID")));
|
||||
|
||||
sb.setCOMPANY_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("COMPANY_ID")));
|
||||
|
||||
sb.setBRAND_SEQUENCE(cursordata.getString(cursordata.getColumnIndexOrThrow("BRAND_SEQUENCE")));
|
||||
sb.setBRAND_SEQUENCE(cursordata.getString(cursordata.getColumnIndexOrThrow("BRAND_SEQUENCE")));*/
|
||||
|
||||
Data.add(sb);
|
||||
cursordata.moveToNext();
|
||||
@@ -2169,13 +2180,12 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
}
|
||||
|
||||
public void InsertAdditionalData(AddittionalGetterSetter data,ArrayList<AdditionalDialogGetterSetter> dialog) {
|
||||
public void InsertAdditionalData(AddittionalGetterSetter data,ArrayList<AdditionalDialogGetterSetter> dialog,String categoryId) {
|
||||
ContentValues values = new ContentValues();
|
||||
ContentValues values1 = new ContentValues();
|
||||
try {
|
||||
|
||||
|
||||
values.put("Store_Id", data.getStore_id());
|
||||
values.put("categoryId", categoryId);
|
||||
values.put("brand_name", data.getBrand());
|
||||
values.put("brand_id", data.getBrand_id());
|
||||
values.put("image_url", data.getImage());
|
||||
@@ -2183,12 +2193,14 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
values.put("sku_name", data.getSku());
|
||||
values.put("toggle_value", data.getBtn_toogle());
|
||||
|
||||
|
||||
long key_id = db.insert(CommonString.TABLE_INSERT_STOCK_ADDITIONAL, null, values);
|
||||
|
||||
for(int i=0;i<dialog.size();i++)
|
||||
{
|
||||
values1.put(CommonString.KEY_Common_ID, key_id);
|
||||
values1.put(CommonString.KEY_STORE_ID, dialog.get(i).getStore_id());
|
||||
values1.put("categoryId", categoryId);
|
||||
values1.put(CommonString.KEY_BRAND, dialog.get(i).getBrand());
|
||||
values1.put(CommonString.KEY_BRAND_ID, dialog.get(i).getBrand_id());
|
||||
values1.put(CommonString.KEY_QUANTITY, dialog.get(i).getQuantity());
|
||||
@@ -2197,18 +2209,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
|
||||
db.insert(CommonString.TABLE_INSERT_STOCK_DIALOG, null, values1);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (Exception ex) {
|
||||
Log.d("Database Exception ", ex.getMessage());
|
||||
}
|
||||
@@ -2216,14 +2218,14 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<AddittionalGetterSetter> getAdditionalStock(String store_id) {
|
||||
public ArrayList<AddittionalGetterSetter> getAdditionalStock(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 + "'", null);
|
||||
|
||||
// cursordata = db.rawQuery("SELECT * FROM Stock_Additional_visibility WHERE Store_Id = '"+store_id + "'categoryId = '"+categoryId + "'", null);
|
||||
cursordata = db.rawQuery("Select * from Stock_Additional_visibility " + "where categoryId='" + categoryId + "' and Store_Id='" + store_id + "'", null);
|
||||
|
||||
if (cursordata != null) {
|
||||
cursordata.moveToFirst();
|
||||
@@ -2234,10 +2236,12 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
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")));
|
||||
|
||||
@@ -2256,7 +2260,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
sb.setBtn_toogle(cursordata.getString(cursordata
|
||||
.getColumnIndexOrThrow("toggle_value")));
|
||||
|
||||
|
||||
productData.add(sb);
|
||||
cursordata.moveToNext();
|
||||
}
|
||||
@@ -2283,4 +2286,93 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public boolean additionalVisibilitydata(String store_id, String category_id) {
|
||||
Log.d("AdditionalVisibility ", "AdditionalVisibility data--------------->Start<------------");
|
||||
ArrayList<AddittionalGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
dbcursor = db.rawQuery("Select * from Stock_Additional_visibility " + "where categoryId='" + category_id + "' and Store_Id='" + store_id + "'", null);
|
||||
|
||||
if (dbcursor != null) {
|
||||
if (dbcursor.moveToFirst()) {
|
||||
do {
|
||||
AddittionalGetterSetter sb = new AddittionalGetterSetter();
|
||||
|
||||
sb.setBrand_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("brand_id")));
|
||||
list.add(sb);
|
||||
} while (dbcursor.moveToNext());
|
||||
}
|
||||
dbcursor.close();
|
||||
|
||||
if (list.size() > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.d("Exception ", "when fetching Records!!!!" + e.toString());
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public ArrayList<AddittionalGetterSetter> getAdditionalStockUpload(String store_id) {
|
||||
Cursor cursordata = null;
|
||||
ArrayList<AddittionalGetterSetter> productData = new ArrayList<AddittionalGetterSetter>();
|
||||
|
||||
try {
|
||||
|
||||
cursordata = db.rawQuery("SELECT * FROM Stock_Additional_visibility WHERE 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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+20
@@ -5,6 +5,26 @@ public class AdditionalDialogGetterSetter {
|
||||
image3, BEFORE_QTY, camera1, camera2, camera3, AFTER_QTY, store_id, stock_count, question_id, question, answer, type,
|
||||
KEY_ID, unique_id,image_url, sku_id,quantity, process_id, sku_name, stock_flag;
|
||||
|
||||
public String getCOMMON_ID() {
|
||||
return COMMON_ID;
|
||||
}
|
||||
|
||||
public void setCOMMON_ID(String COMMON_ID) {
|
||||
this.COMMON_ID = COMMON_ID;
|
||||
}
|
||||
|
||||
String COMMON_ID;
|
||||
|
||||
public String getCategoryId() {
|
||||
return categoryId;
|
||||
}
|
||||
|
||||
public void setCategoryId(String categoryId) {
|
||||
this.categoryId = categoryId;
|
||||
}
|
||||
|
||||
String categoryId;
|
||||
|
||||
public String getStock_flag() {
|
||||
return stock_flag;
|
||||
}
|
||||
|
||||
+9
@@ -76,5 +76,14 @@ public class AddittionalGetterSetter {
|
||||
|
||||
String btn_toogle;
|
||||
|
||||
public String getCategoryId() {
|
||||
return categoryId;
|
||||
}
|
||||
|
||||
public void setCategoryId(String categoryId) {
|
||||
this.categoryId = categoryId;
|
||||
}
|
||||
|
||||
String categoryId;
|
||||
|
||||
}
|
||||
|
||||
@@ -195,6 +195,7 @@ public class MainActivity extends AppCompatActivity
|
||||
Snackbar.make(webView, R.string.no_data_for_upload, Snackbar.LENGTH_SHORT)
|
||||
.setAction("Action", null).show();
|
||||
|
||||
|
||||
} else {
|
||||
//if (isStoreCheckedIn()&& isValid()) {
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@ public class CommonString {
|
||||
+ KEY_BRAND_ID + " VARCHAR," + KEY_BRAND + " VARCHAR,"
|
||||
+ KEY_DISPLAY_ID +" VARCHAR,"
|
||||
+ KEY_SKU_ID + " VARCHAR," + KEY_QUANTITY + " VARCHAR," + KEY_Common_ID + " VARCHAR,"
|
||||
+ KEY_CATEGORY_ID + " VARCHAR,"
|
||||
+ "categoryId" + " VARCHAR,"
|
||||
+ KEY_SKUNAME + " VARCHAR,"
|
||||
+ KEY_PROCESS_ID + " VARCHAR)";
|
||||
|
||||
@@ -327,7 +327,7 @@ public class CommonString {
|
||||
+ "toggle_value"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "IMAGE2"
|
||||
+ "categoryId"
|
||||
+ " VARCHAR"
|
||||
|
||||
+ ")";
|
||||
|
||||
+123
-25
@@ -20,6 +20,7 @@ import android.preference.PreferenceManager;
|
||||
import android.provider.MediaStore;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.CardView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -87,18 +88,18 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
ArrayList<SkuGetterSetter> empty_list = new ArrayList<>();
|
||||
String _pathforcheck, _path, str, msg;
|
||||
private SharedPreferences preferences;
|
||||
String store_id, date, intime, img_str, togglevalue = "1";
|
||||
String store_id, date, intime, img_str, togglevalue = "1",CATEGORY_ID;
|
||||
ImageView img_cam, img_clicked;
|
||||
Button btn_add, btn_close;
|
||||
EditText Edt_txt;
|
||||
MyAdaptorStock adapterData;
|
||||
ListView listviewlay;
|
||||
String errormsg;
|
||||
String errormsg,categoryName,categoryId;
|
||||
MyAdaptorAdditionalStock adapteradditional;
|
||||
AddittionalGetterSetter adGt;
|
||||
LinearLayout brandlayout, diaplylayout, cameralayout;
|
||||
//RelativeLayout skulayout;
|
||||
|
||||
CardView cardvew;
|
||||
////String brand_id,SKU_ID;
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
// TODO Auto-generated method stub
|
||||
@@ -114,7 +115,10 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||
|
||||
|
||||
store_id = "2";
|
||||
categoryName = getIntent().getStringExtra("categoryName");
|
||||
categoryId = getIntent().getStringExtra("categoryId");
|
||||
|
||||
//store_id = "2";
|
||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||
|
||||
@@ -122,6 +126,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
db.open();
|
||||
spinner_brand_list = (Spinner) findViewById(R.id.spinner_Brand1);
|
||||
spinner_sku_list = (Spinner) findViewById(R.id.spinner_SkuMaster);
|
||||
cardvew = (CardView) findViewById(R.id.cardviewid);
|
||||
|
||||
|
||||
btntoggle = (ToggleButton) findViewById(R.id.btntoggle);
|
||||
btnimage = (ImageView) findViewById(R.id.btn_image);
|
||||
@@ -195,21 +201,62 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
}
|
||||
});
|
||||
|
||||
listdata = db.getAdditionalStock(store_id);
|
||||
listdata = db.getAdditionalStock(store_id,categoryId);
|
||||
|
||||
|
||||
for (int k = 0; k < listdata.size(); k++) {
|
||||
String KeyID = listdata.get(k).getKey_id();
|
||||
|
||||
uploadlist = db.getDialogStock(KeyID);
|
||||
String tooglevalue= listdata.get(k).getBtn_toogle();
|
||||
|
||||
if(tooglevalue.equalsIgnoreCase("0"))
|
||||
{
|
||||
|
||||
btnaddlayout.setVisibility(View.INVISIBLE);
|
||||
cardvew.setVisibility(View.INVISIBLE);
|
||||
listviewlay.setVisibility(View.INVISIBLE);
|
||||
btntoggle.setChecked(false);
|
||||
brandlayout.setVisibility(View.INVISIBLE);
|
||||
diaplylayout.setVisibility(View.INVISIBLE);
|
||||
cameralayout.setVisibility(View.INVISIBLE);
|
||||
btnsku.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* String KeyID = listdata.get(k).getKey_id();
|
||||
|
||||
uploadlist = db.getDialogStock(KeyID);*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (listdata.size() > 0) {
|
||||
|
||||
for (int i = 0; i < listdata.size(); i++) {
|
||||
if (listdata.get(i).getBtn_toogle().equalsIgnoreCase("0")) {
|
||||
listviewlay.setVisibility(View.INVISIBLE);
|
||||
cardvew.setVisibility(View.INVISIBLE);
|
||||
btnaddlayout.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||
listviewlay.setAdapter(adapteradditional);
|
||||
listviewlay.invalidateViews();
|
||||
btnaddlayout.setVisibility(View.VISIBLE);
|
||||
cardvew.setVisibility(View.VISIBLE);
|
||||
listviewlay.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* if (listdata.size() > 0) {
|
||||
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||
listviewlay.setAdapter(adapteradditional);
|
||||
listviewlay.invalidateViews();
|
||||
}
|
||||
}*/
|
||||
|
||||
btnaddlayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -223,6 +270,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
adGt.setSku_id(sku_list_id);
|
||||
adGt.setStore_id(store_id);
|
||||
adGt.setBtn_toogle(togglevalue);
|
||||
adGt.setCategoryId(categoryId);
|
||||
|
||||
|
||||
if (validateData(adGt, defdata)) {
|
||||
|
||||
@@ -239,7 +288,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
db.InsertAdditionalData(adGt, defdata);
|
||||
db.InsertAdditionalData(adGt, defdata,categoryId);
|
||||
|
||||
spinner_brand_list.setSelection(0);
|
||||
|
||||
@@ -253,21 +302,42 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
|
||||
defdata.clear();
|
||||
|
||||
btntoggle.setChecked(true);
|
||||
// btntoggle.setChecked(true);
|
||||
|
||||
btnimage.setBackgroundResource(R.mipmap.camera);
|
||||
togglevalue = "1";
|
||||
brandlayout.setVisibility(View.VISIBLE);
|
||||
diaplylayout.setVisibility(View.VISIBLE);
|
||||
cameralayout.setVisibility(View.VISIBLE);
|
||||
btnsku.setVisibility(View.VISIBLE);
|
||||
// togglevalue = "1";
|
||||
|
||||
listdata = db.getAdditionalStock(store_id);
|
||||
|
||||
listdata = db.getAdditionalStock(store_id,categoryId);
|
||||
|
||||
if (listdata.size() > 0) {
|
||||
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||
listviewlay.setAdapter(adapteradditional);
|
||||
listviewlay.invalidateViews();
|
||||
|
||||
for(int i=0;i<listdata.size();i++)
|
||||
{
|
||||
if(listdata.get(i).getBtn_toogle().equalsIgnoreCase("0"))
|
||||
{
|
||||
listviewlay.setVisibility(View.INVISIBLE);
|
||||
cardvew.setVisibility(View.INVISIBLE);
|
||||
btnaddlayout.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||
listviewlay.setAdapter(adapteradditional);
|
||||
listviewlay.invalidateViews();
|
||||
btnaddlayout.setVisibility(View.VISIBLE);
|
||||
cardvew.setVisibility(View.VISIBLE);
|
||||
listviewlay.setVisibility(View.VISIBLE);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
@@ -307,9 +377,17 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
cameralayout.setVisibility(View.VISIBLE);
|
||||
btnsku.setVisibility(View.VISIBLE);
|
||||
|
||||
} else {
|
||||
togglevalue = "0";
|
||||
btnaddlayout.setVisibility(View.VISIBLE);
|
||||
cardvew.setVisibility(View.VISIBLE);
|
||||
listviewlay.setVisibility(View.VISIBLE);
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
db.deleteStockEntryall(store_id,categoryId);
|
||||
|
||||
togglevalue = "0";
|
||||
defdata.clear();
|
||||
brandlayout.setVisibility(View.INVISIBLE);
|
||||
diaplylayout.setVisibility(View.INVISIBLE);
|
||||
cameralayout.setVisibility(View.INVISIBLE);
|
||||
@@ -1037,16 +1115,36 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
|
||||
db.deleteStockEntry(listdata.get(position1).getKey_id());
|
||||
|
||||
adapteradditional.notifyDataSetChanged();
|
||||
|
||||
listdata = db.getAdditionalStock(store_id);
|
||||
listdata = db.getAdditionalStock(store_id,categoryId);
|
||||
|
||||
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||
/* adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||
listviewlay.setAdapter(adapteradditional);
|
||||
listviewlay.invalidateViews();
|
||||
listviewlay.invalidateViews();*/
|
||||
|
||||
if (listdata.size() > 0) {
|
||||
|
||||
for (int i = 0; i < listdata.size(); i++) {
|
||||
if (listdata.get(i).getBtn_toogle().equalsIgnoreCase("0")) {
|
||||
listviewlay.setVisibility(View.INVISIBLE);
|
||||
cardvew.setVisibility(View.INVISIBLE);
|
||||
btnaddlayout.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||
listviewlay.setAdapter(adapteradditional);
|
||||
listviewlay.invalidateViews();
|
||||
btnaddlayout.setVisibility(View.VISIBLE);
|
||||
cardvew.setVisibility(View.VISIBLE);
|
||||
listviewlay.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -285,6 +285,7 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
editor.putString(CommonString.KEY_KEYACCOUNT_ID, current.getKEYACCOUNT_ID());
|
||||
editor.putString(CommonString.KEY_STORETYPE_ID, current.getSTORETYPE_ID());
|
||||
editor.putString(CommonString.KEY_UPLOAD_STATUS, current.getUPLOAD_STATUS());
|
||||
|
||||
editor.commit();
|
||||
|
||||
// showMyDialog(store_id, current.getSTORE_NAME(), "Yes", current.getVISIT_DATE(), current.getCHECKOUT_STATUS());
|
||||
|
||||
+18
-1
@@ -26,6 +26,7 @@ import java.util.List;
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.dailyentry.AdditionalVisibility;
|
||||
import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DailyDataMenuGetterSetter;
|
||||
|
||||
@@ -125,7 +126,12 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
//data.setCategory_name("Additional Visibility");
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_additional_visibility));
|
||||
data.setCategory_img(R.mipmap.additional_visibility);
|
||||
if (db.additionalVisibilitydata(store_id, categoryId)) {
|
||||
data.setCategory_img(R.mipmap.additional_visibility_done);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.additional_visibility);
|
||||
}
|
||||
|
||||
categoryList.add(data);
|
||||
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
@@ -210,6 +216,17 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
|
||||
}
|
||||
|
||||
else if (dailyData.getCategory_name().equalsIgnoreCase((getResources().getString(R.string.title_activity_Additional_visibility)))) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, AdditionalVisibility.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -447,7 +447,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
String additional_visibility_dialog_xml = "";
|
||||
onXML = "";
|
||||
String onXMLdIALOG = "";
|
||||
additionalVisibilityList = db.getAdditionalStock(coverageList.get(i).getStoreId());
|
||||
additionalVisibilityList = db.getAdditionalStockUpload(coverageList.get(i).getStoreId());
|
||||
|
||||
if (additionalVisibilityList.size() > 0) {
|
||||
for (int J = 0; J < additionalVisibilityList.size(); J++) {
|
||||
@@ -456,8 +456,10 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
additionalVisibilitySkuList = db.getDialogStock(KeyID);
|
||||
|
||||
for (int k = 0; k < additionalVisibilitySkuList.size(); k++) {
|
||||
if(additionalVisibilitySkuList.size()>0)
|
||||
{
|
||||
|
||||
for (int k = 0; k < additionalVisibilitySkuList.size(); k++) {
|
||||
|
||||
onXMLdIALOG = "[VISIBILITY_DAILOG]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
@@ -465,7 +467,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
+ userId
|
||||
+ "[/USER_ID]"
|
||||
+ "[KEY_ID]"
|
||||
+ additionalVisibilitySkuList.get(k).getKEY_ID()
|
||||
+ additionalVisibilitySkuList.get(k).getCOMMON_ID()
|
||||
+ "[/KEY_ID]"
|
||||
/* + "[DIALOG_BRAND_ID]"
|
||||
+ additionalVisibilitySkuList.get(k).getBrand_id()
|
||||
@@ -480,7 +482,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
additional_visibility_dialog_xml = additional_visibility_dialog_xml + onXMLdIALOG;
|
||||
|
||||
}
|
||||
}}
|
||||
|
||||
onXML = "[ADDITIONAL_VISIBILITY_DATA]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
@@ -490,6 +492,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
+ "[KEY_ID]"
|
||||
+ additionalVisibilityList.get(J).getKey_id()
|
||||
+ "[/KEY_ID]"
|
||||
+ "[CATEGORY_ID]"
|
||||
+ additionalVisibilityList.get(J).getCategoryId()
|
||||
+ "[/CATEGORY_ID]"
|
||||
+ "[ADDITIONAL_DISPLAY]"
|
||||
+ additionalVisibilityList.get(J).getBtn_toogle()
|
||||
+ "[/ADDITIONAL_DISPLAY]"
|
||||
@@ -600,6 +605,36 @@ public class UploadActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
}
|
||||
//// ashish visibility image start
|
||||
|
||||
if (additionalVisibilityList.size() > 0) {
|
||||
for (int i1 = 0; i1 < additionalVisibilityList.size(); i1++) {
|
||||
|
||||
if (additionalVisibilityList.get(i1).getImage() != null && !additionalVisibilityList.get(i1).getImage().equals("")) {
|
||||
if (new File(CommonString.FILE_PATH + additionalVisibilityList.get(i1).getImage()).exists()) {
|
||||
|
||||
try {
|
||||
result = UploadImage(additionalVisibilityList.get(i1).getImage(), "AdditionalVisibilityImages");
|
||||
|
||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "AdditionalVisibilityImages";
|
||||
}
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
message.setText("AdditionalVisibilityImages Uploaded");
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//// ashish close image
|
||||
|
||||
|
||||
|
||||
// SET COVERAGE STATUS
|
||||
|
||||
@@ -62,7 +62,8 @@
|
||||
android:id="@+id/btntoggle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:textOn="Yes"
|
||||
android:textOff="No"
|
||||
android:layout_weight=".5" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -219,7 +220,7 @@
|
||||
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
|
||||
android:id="@+id/cardviewid"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="10dp"
|
||||
|
||||
Reference in New Issue
Block a user