Merge pull request #43 from CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/AShishNewBranch
newcode
This commit is contained in:
@@ -2152,6 +2152,9 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
sb.setKEY_ID(cursordata.getString(cursordata
|
sb.setKEY_ID(cursordata.getString(cursordata
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_ID)));
|
.getColumnIndexOrThrow(CommonString.KEY_ID)));
|
||||||
|
|
||||||
|
sb.setCOMMON_ID(cursordata.getString(cursordata
|
||||||
|
.getColumnIndexOrThrow(CommonString.KEY_Common_ID)));
|
||||||
|
|
||||||
sb.setBrand_id(cursordata.getString(cursordata
|
sb.setBrand_id(cursordata.getString(cursordata
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_BRAND_ID)));
|
.getColumnIndexOrThrow(CommonString.KEY_BRAND_ID)));
|
||||||
|
|
||||||
@@ -2201,7 +2204,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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public ArrayList<BrandMasterGetterSetter> getBrandMasterData(String store_id) {
|
public ArrayList<BrandMasterGetterSetter> getBrandMasterData(String store_id) {
|
||||||
Cursor cursordata = null;
|
Cursor cursordata = null;
|
||||||
@@ -2209,7 +2222,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
try {
|
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) {
|
if (cursordata != null) {
|
||||||
cursordata.moveToFirst();
|
cursordata.moveToFirst();
|
||||||
@@ -2220,12 +2233,14 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
sb.setBRAND(cursordata.getString(cursordata.getColumnIndexOrThrow("BRAND")));
|
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.setSUB_CATEGORY_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("SUB_CATEGORY_ID")));
|
||||||
|
|
||||||
sb.setCOMPANY_ID(cursordata.getString(cursordata.getColumnIndexOrThrow("COMPANY_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);
|
Data.add(sb);
|
||||||
cursordata.moveToNext();
|
cursordata.moveToNext();
|
||||||
@@ -2282,13 +2297,14 @@ 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 values = new ContentValues();
|
||||||
ContentValues values1 = new ContentValues();
|
ContentValues values1 = new ContentValues();
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|
||||||
values.put("Store_Id", data.getStore_id());
|
values.put("Store_Id", data.getStore_id());
|
||||||
|
values.put("categoryId", categoryId);
|
||||||
values.put("brand_name", data.getBrand());
|
values.put("brand_name", data.getBrand());
|
||||||
values.put("brand_id", data.getBrand_id());
|
values.put("brand_id", data.getBrand_id());
|
||||||
values.put("image_url", data.getImage());
|
values.put("image_url", data.getImage());
|
||||||
@@ -2301,6 +2317,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
for (int i = 0; i < dialog.size(); i++) {
|
for (int i = 0; i < dialog.size(); i++) {
|
||||||
values1.put(CommonString.KEY_Common_ID, key_id);
|
values1.put(CommonString.KEY_Common_ID, key_id);
|
||||||
values1.put(CommonString.KEY_STORE_ID, dialog.get(i).getStore_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, dialog.get(i).getBrand());
|
||||||
values1.put(CommonString.KEY_BRAND_ID, dialog.get(i).getBrand_id());
|
values1.put(CommonString.KEY_BRAND_ID, dialog.get(i).getBrand_id());
|
||||||
values1.put(CommonString.KEY_QUANTITY, dialog.get(i).getQuantity());
|
values1.put(CommonString.KEY_QUANTITY, dialog.get(i).getQuantity());
|
||||||
@@ -2310,10 +2327,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
db.insert(CommonString.TABLE_INSERT_STOCK_DIALOG, null, values1);
|
db.insert(CommonString.TABLE_INSERT_STOCK_DIALOG, null, values1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Log.d("Database Exception ", ex.getMessage());
|
Log.d("Database Exception ", ex.getMessage());
|
||||||
}
|
}
|
||||||
@@ -2321,14 +2336,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;
|
Cursor cursordata = null;
|
||||||
ArrayList<AddittionalGetterSetter> productData = new ArrayList<AddittionalGetterSetter>();
|
ArrayList<AddittionalGetterSetter> productData = new ArrayList<AddittionalGetterSetter>();
|
||||||
|
|
||||||
try {
|
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) {
|
if (cursordata != null) {
|
||||||
cursordata.moveToFirst();
|
cursordata.moveToFirst();
|
||||||
@@ -2339,10 +2354,12 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
sb.setKey_id(cursordata.getString(cursordata
|
sb.setKey_id(cursordata.getString(cursordata
|
||||||
.getColumnIndexOrThrow("KEY_ID")));
|
.getColumnIndexOrThrow("KEY_ID")));
|
||||||
|
|
||||||
|
|
||||||
sb.setStore_id(cursordata.getString(cursordata
|
sb.setStore_id(cursordata.getString(cursordata
|
||||||
.getColumnIndexOrThrow("Store_Id")));
|
.getColumnIndexOrThrow("Store_Id")));
|
||||||
|
|
||||||
|
sb.setCategoryId(cursordata.getString(cursordata
|
||||||
|
.getColumnIndexOrThrow("categoryId")));
|
||||||
|
|
||||||
sb.setBrand_id(cursordata.getString(cursordata
|
sb.setBrand_id(cursordata.getString(cursordata
|
||||||
.getColumnIndexOrThrow("brand_id")));
|
.getColumnIndexOrThrow("brand_id")));
|
||||||
|
|
||||||
@@ -2361,7 +2378,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
sb.setBtn_toogle(cursordata.getString(cursordata
|
sb.setBtn_toogle(cursordata.getString(cursordata
|
||||||
.getColumnIndexOrThrow("toggle_value")));
|
.getColumnIndexOrThrow("toggle_value")));
|
||||||
|
|
||||||
|
|
||||||
productData.add(sb);
|
productData.add(sb);
|
||||||
cursordata.moveToNext();
|
cursordata.moveToNext();
|
||||||
}
|
}
|
||||||
@@ -2449,6 +2465,95 @@ 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;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// get T2P Compliance data
|
// get T2P Compliance data
|
||||||
public ArrayList<T2PGetterSetter> getT2pComplianceData(String store_id, String category_id) {
|
public ArrayList<T2PGetterSetter> getT2pComplianceData(String store_id, String category_id) {
|
||||||
|
|
||||||
|
|||||||
+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,
|
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;
|
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() {
|
public String getStock_flag() {
|
||||||
return stock_flag;
|
return stock_flag;
|
||||||
}
|
}
|
||||||
|
|||||||
+9
@@ -76,5 +76,14 @@ public class AddittionalGetterSetter {
|
|||||||
|
|
||||||
String btn_toogle;
|
String btn_toogle;
|
||||||
|
|
||||||
|
public String getCategoryId() {
|
||||||
|
return categoryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategoryId(String categoryId) {
|
||||||
|
this.categoryId = categoryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
String categoryId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,6 +209,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
Snackbar.make(webView, R.string.no_data_for_upload, Snackbar.LENGTH_SHORT)
|
Snackbar.make(webView, R.string.no_data_for_upload, Snackbar.LENGTH_SHORT)
|
||||||
.setAction("Action", null).show();
|
.setAction("Action", null).show();
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//if (isStoreCheckedIn()&& isValid()) {
|
//if (isStoreCheckedIn()&& isValid()) {
|
||||||
|
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ public class CommonString {
|
|||||||
+ KEY_BRAND_ID + " VARCHAR," + KEY_BRAND + " VARCHAR,"
|
+ KEY_BRAND_ID + " VARCHAR," + KEY_BRAND + " VARCHAR,"
|
||||||
+ KEY_DISPLAY_ID +" VARCHAR,"
|
+ KEY_DISPLAY_ID +" VARCHAR,"
|
||||||
+ KEY_SKU_ID + " VARCHAR," + KEY_QUANTITY + " VARCHAR," + KEY_Common_ID + " VARCHAR,"
|
+ KEY_SKU_ID + " VARCHAR," + KEY_QUANTITY + " VARCHAR," + KEY_Common_ID + " VARCHAR,"
|
||||||
+ KEY_CATEGORY_ID + " VARCHAR,"
|
+ "categoryId" + " VARCHAR,"
|
||||||
+ KEY_SKUNAME + " VARCHAR,"
|
+ KEY_SKUNAME + " VARCHAR,"
|
||||||
+ KEY_PROCESS_ID + " VARCHAR)";
|
+ KEY_PROCESS_ID + " VARCHAR)";
|
||||||
|
|
||||||
@@ -340,7 +340,7 @@ public class CommonString {
|
|||||||
+ "toggle_value"
|
+ "toggle_value"
|
||||||
+ " VARCHAR,"
|
+ " VARCHAR,"
|
||||||
|
|
||||||
+ "IMAGE2"
|
+ "categoryId"
|
||||||
+ " VARCHAR"
|
+ " VARCHAR"
|
||||||
|
|
||||||
+ ")";
|
+ ")";
|
||||||
|
|||||||
+123
-25
@@ -22,6 +22,7 @@ import android.preference.PreferenceManager;
|
|||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.support.design.widget.Snackbar;
|
import android.support.design.widget.Snackbar;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.support.v7.widget.CardView;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@@ -90,18 +91,18 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
ArrayList<SkuGetterSetter> empty_list = new ArrayList<>();
|
ArrayList<SkuGetterSetter> empty_list = new ArrayList<>();
|
||||||
String _pathforcheck, _path, str, msg;
|
String _pathforcheck, _path, str, msg;
|
||||||
private SharedPreferences preferences;
|
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;
|
ImageView img_cam, img_clicked;
|
||||||
Button btn_add, btn_close;
|
Button btn_add, btn_close;
|
||||||
EditText Edt_txt;
|
EditText Edt_txt;
|
||||||
MyAdaptorStock adapterData;
|
MyAdaptorStock adapterData;
|
||||||
ListView listviewlay;
|
ListView listviewlay;
|
||||||
String errormsg;
|
String errormsg,categoryName,categoryId;
|
||||||
MyAdaptorAdditionalStock adapteradditional;
|
MyAdaptorAdditionalStock adapteradditional;
|
||||||
AddittionalGetterSetter adGt;
|
AddittionalGetterSetter adGt;
|
||||||
LinearLayout brandlayout, diaplylayout, cameralayout;
|
LinearLayout brandlayout, diaplylayout, cameralayout;
|
||||||
//RelativeLayout skulayout;
|
//RelativeLayout skulayout;
|
||||||
|
CardView cardvew;
|
||||||
////String brand_id,SKU_ID;
|
////String brand_id,SKU_ID;
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
@@ -118,7 +119,10 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||||
|
|
||||||
store_id = "2";
|
categoryName = getIntent().getStringExtra("categoryName");
|
||||||
|
categoryId = getIntent().getStringExtra("categoryId");
|
||||||
|
|
||||||
|
//store_id = "2";
|
||||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||||
|
|
||||||
@@ -126,6 +130,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
db.open();
|
db.open();
|
||||||
spinner_brand_list = (Spinner) findViewById(R.id.spinner_Brand1);
|
spinner_brand_list = (Spinner) findViewById(R.id.spinner_Brand1);
|
||||||
spinner_sku_list = (Spinner) findViewById(R.id.spinner_SkuMaster);
|
spinner_sku_list = (Spinner) findViewById(R.id.spinner_SkuMaster);
|
||||||
|
cardvew = (CardView) findViewById(R.id.cardviewid);
|
||||||
|
|
||||||
|
|
||||||
btntoggle = (ToggleButton) findViewById(R.id.btntoggle);
|
btntoggle = (ToggleButton) findViewById(R.id.btntoggle);
|
||||||
btnimage = (ImageView) findViewById(R.id.btn_image);
|
btnimage = (ImageView) findViewById(R.id.btn_image);
|
||||||
@@ -199,21 +205,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++) {
|
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) {
|
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);
|
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||||
listviewlay.setAdapter(adapteradditional);
|
listviewlay.setAdapter(adapteradditional);
|
||||||
listviewlay.invalidateViews();
|
listviewlay.invalidateViews();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
btnaddlayout.setOnClickListener(new View.OnClickListener() {
|
btnaddlayout.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -227,6 +274,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
adGt.setSku_id(sku_list_id);
|
adGt.setSku_id(sku_list_id);
|
||||||
adGt.setStore_id(store_id);
|
adGt.setStore_id(store_id);
|
||||||
adGt.setBtn_toogle(togglevalue);
|
adGt.setBtn_toogle(togglevalue);
|
||||||
|
adGt.setCategoryId(categoryId);
|
||||||
|
|
||||||
|
|
||||||
if (validateData(adGt, defdata)) {
|
if (validateData(adGt, defdata)) {
|
||||||
|
|
||||||
@@ -243,7 +292,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
db.InsertAdditionalData(adGt, defdata);
|
db.InsertAdditionalData(adGt, defdata,categoryId);
|
||||||
|
|
||||||
spinner_brand_list.setSelection(0);
|
spinner_brand_list.setSelection(0);
|
||||||
|
|
||||||
@@ -257,21 +306,42 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
defdata.clear();
|
defdata.clear();
|
||||||
|
|
||||||
btntoggle.setChecked(true);
|
// btntoggle.setChecked(true);
|
||||||
|
|
||||||
btnimage.setBackgroundResource(R.mipmap.camera);
|
btnimage.setBackgroundResource(R.mipmap.camera);
|
||||||
togglevalue = "1";
|
// togglevalue = "1";
|
||||||
brandlayout.setVisibility(View.VISIBLE);
|
|
||||||
diaplylayout.setVisibility(View.VISIBLE);
|
|
||||||
cameralayout.setVisibility(View.VISIBLE);
|
|
||||||
btnsku.setVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
listdata = db.getAdditionalStock(store_id);
|
|
||||||
|
listdata = db.getAdditionalStock(store_id,categoryId);
|
||||||
|
|
||||||
if (listdata.size() > 0) {
|
if (listdata.size() > 0) {
|
||||||
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
|
||||||
listviewlay.setAdapter(adapteradditional);
|
for(int i=0;i<listdata.size();i++)
|
||||||
listviewlay.invalidateViews();
|
{
|
||||||
|
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 {
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -311,9 +381,17 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
cameralayout.setVisibility(View.VISIBLE);
|
cameralayout.setVisibility(View.VISIBLE);
|
||||||
btnsku.setVisibility(View.VISIBLE);
|
btnsku.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
} else {
|
btnaddlayout.setVisibility(View.VISIBLE);
|
||||||
togglevalue = "0";
|
cardvew.setVisibility(View.VISIBLE);
|
||||||
|
listviewlay.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
db.deleteStockEntryall(store_id,categoryId);
|
||||||
|
|
||||||
|
togglevalue = "0";
|
||||||
|
defdata.clear();
|
||||||
brandlayout.setVisibility(View.INVISIBLE);
|
brandlayout.setVisibility(View.INVISIBLE);
|
||||||
diaplylayout.setVisibility(View.INVISIBLE);
|
diaplylayout.setVisibility(View.INVISIBLE);
|
||||||
cameralayout.setVisibility(View.INVISIBLE);
|
cameralayout.setVisibility(View.INVISIBLE);
|
||||||
@@ -1041,16 +1119,36 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
|
|
||||||
db.deleteStockEntry(listdata.get(position1).getKey_id());
|
db.deleteStockEntry(listdata.get(position1).getKey_id());
|
||||||
|
|
||||||
adapteradditional.notifyDataSetChanged();
|
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.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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -291,6 +291,7 @@ public class StoreListActivity extends AppCompatActivity {
|
|||||||
editor.putString(CommonString.KEY_KEYACCOUNT_ID, current.getKEYACCOUNT_ID());
|
editor.putString(CommonString.KEY_KEYACCOUNT_ID, current.getKEYACCOUNT_ID());
|
||||||
editor.putString(CommonString.KEY_STORETYPE_ID, current.getSTORETYPE_ID());
|
editor.putString(CommonString.KEY_STORETYPE_ID, current.getSTORETYPE_ID());
|
||||||
editor.putString(CommonString.KEY_UPLOAD_STATUS, current.getUPLOAD_STATUS());
|
editor.putString(CommonString.KEY_UPLOAD_STATUS, current.getUPLOAD_STATUS());
|
||||||
|
|
||||||
editor.commit();
|
editor.commit();
|
||||||
|
|
||||||
// showMyDialog(store_id, current.getSTORE_NAME(), "Yes", current.getVISIT_DATE(), current.getCHECKOUT_STATUS());
|
// showMyDialog(store_id, current.getSTORE_NAME(), "Yes", current.getVISIT_DATE(), current.getCHECKOUT_STATUS());
|
||||||
|
|||||||
+18
-1
@@ -28,6 +28,7 @@ import java.util.Locale;
|
|||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
import cpm.com.gskmtorange.dailyentry.AdditionalVisibility;
|
||||||
import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
|
import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.DailyDataMenuGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.DailyDataMenuGetterSetter;
|
||||||
|
|
||||||
@@ -131,7 +132,12 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
//data.setCategory_name("Additional Visibility");
|
//data.setCategory_name("Additional Visibility");
|
||||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_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);
|
categoryList.add(data);
|
||||||
|
|
||||||
data = new DailyDataMenuGetterSetter();
|
data = new DailyDataMenuGetterSetter();
|
||||||
@@ -242,6 +248,17 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
|||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -534,7 +534,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
String additional_visibility_dialog_xml = "";
|
String additional_visibility_dialog_xml = "";
|
||||||
onXML = "";
|
onXML = "";
|
||||||
String onXMLdIALOG = "";
|
String onXMLdIALOG = "";
|
||||||
additionalVisibilityList = db.getAdditionalStock(coverageList.get(i).getStoreId());
|
additionalVisibilityList = db.getAdditionalStockUpload(coverageList.get(i).getStoreId());
|
||||||
|
|
||||||
if (additionalVisibilityList.size() > 0) {
|
if (additionalVisibilityList.size() > 0) {
|
||||||
for (int J = 0; J < additionalVisibilityList.size(); J++) {
|
for (int J = 0; J < additionalVisibilityList.size(); J++) {
|
||||||
@@ -543,8 +543,10 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
additionalVisibilitySkuList = db.getDialogStock(KeyID);
|
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]"
|
onXMLdIALOG = "[VISIBILITY_DAILOG]"
|
||||||
+ "[MID]" + mid + "[/MID]"
|
+ "[MID]" + mid + "[/MID]"
|
||||||
@@ -552,7 +554,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
+ userId
|
+ userId
|
||||||
+ "[/USER_ID]"
|
+ "[/USER_ID]"
|
||||||
+ "[KEY_ID]"
|
+ "[KEY_ID]"
|
||||||
+ additionalVisibilitySkuList.get(k).getKEY_ID()
|
+ additionalVisibilitySkuList.get(k).getCOMMON_ID()
|
||||||
+ "[/KEY_ID]"
|
+ "[/KEY_ID]"
|
||||||
/* + "[DIALOG_BRAND_ID]"
|
/* + "[DIALOG_BRAND_ID]"
|
||||||
+ additionalVisibilitySkuList.get(k).getBrand_id()
|
+ additionalVisibilitySkuList.get(k).getBrand_id()
|
||||||
@@ -567,7 +569,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
additional_visibility_dialog_xml = additional_visibility_dialog_xml + onXMLdIALOG;
|
additional_visibility_dialog_xml = additional_visibility_dialog_xml + onXMLdIALOG;
|
||||||
|
|
||||||
}
|
}}
|
||||||
|
|
||||||
onXML = "[ADDITIONAL_VISIBILITY_DATA]"
|
onXML = "[ADDITIONAL_VISIBILITY_DATA]"
|
||||||
+ "[MID]" + mid + "[/MID]"
|
+ "[MID]" + mid + "[/MID]"
|
||||||
@@ -577,6 +579,9 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
+ "[KEY_ID]"
|
+ "[KEY_ID]"
|
||||||
+ additionalVisibilityList.get(J).getKey_id()
|
+ additionalVisibilityList.get(J).getKey_id()
|
||||||
+ "[/KEY_ID]"
|
+ "[/KEY_ID]"
|
||||||
|
+ "[CATEGORY_ID]"
|
||||||
|
+ additionalVisibilityList.get(J).getCategoryId()
|
||||||
|
+ "[/CATEGORY_ID]"
|
||||||
+ "[ADDITIONAL_DISPLAY]"
|
+ "[ADDITIONAL_DISPLAY]"
|
||||||
+ additionalVisibilityList.get(J).getBtn_toogle()
|
+ additionalVisibilityList.get(J).getBtn_toogle()
|
||||||
+ "[/ADDITIONAL_DISPLAY]"
|
+ "[/ADDITIONAL_DISPLAY]"
|
||||||
@@ -824,6 +829,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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for(int m=0;m<t2PGetterSetters.size();m++){
|
for(int m=0;m<t2PGetterSetters.size();m++){
|
||||||
|
|||||||
@@ -62,7 +62,8 @@
|
|||||||
android:id="@+id/btntoggle"
|
android:id="@+id/btntoggle"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:textOn="Yes"
|
||||||
|
android:textOff="No"
|
||||||
android:layout_weight=".5" />
|
android:layout_weight=".5" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -219,7 +220,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
<android.support.v7.widget.CardView
|
||||||
|
android:id="@+id/cardviewid"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
|||||||
Reference in New Issue
Block a user