Merge remote-tracking branch 'origin/GeoT' into GeoT
# Conflicts: # GSKMTOrange/src/main/AndroidManifest.xml # GSKMTOrange/src/main/java/cpm/com/gskmtorange/GeoTag/GeoTagActivity.java
This commit is contained in:
@@ -85,11 +85,11 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
db.execSQL(TableBean.getMappingDisplayChecklist());
|
db.execSQL(TableBean.getMappingDisplayChecklist());
|
||||||
|
|
||||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_MSL_AVAILABILITY);
|
db.execSQL(CommonString.CREATE_TABLE_INSERT_MSL_AVAILABILITY);
|
||||||
|
db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_ADDITIONAL_VISIBILITY);
|
||||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_FACING_HEADER);
|
db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_FACING_HEADER);
|
||||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_FACING_CHILD);
|
db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_FACING_CHILD);
|
||||||
db.execSQL(CommonString.CREATE_TABLE_STOCK_DIALOG);
|
db.execSQL(CommonString.CREATE_TABLE_STOCK_DIALOG);
|
||||||
db.execSQL(CommonString.CREATE_TABLE_STOCK_ADDITIONAL_STOCK_DATA);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -143,7 +143,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
values.put("CAMERA_ALLOW", data.getCAMERA_ALLOW().get(i));
|
values.put("CAMERA_ALLOW", data.getCAMERA_ALLOW().get(i));
|
||||||
values.put("GEO_TAG", data.getGEO_TAG().get(i));
|
values.put("GEO_TAG", data.getGEO_TAG().get(i));
|
||||||
|
values.put("CHANNEL_ID", data.getCHANNEL_ID().get(i));
|
||||||
|
|
||||||
db.insert("JOURNEY_PLAN", null, values);
|
db.insert("JOURNEY_PLAN", null, values);
|
||||||
|
|
||||||
@@ -1533,7 +1533,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
public void deleteStockEntry(String id) {
|
public void deleteStockEntry(String id) {
|
||||||
try {
|
try {
|
||||||
db.delete(CommonString.TABLE_INSERT_STOCK_ADDITIONAL_DATA, "Id" + "='" + id + "'", null);
|
db.delete(CommonString.TABLE_INSERT_STOCK_ADDITIONAL, "KEY_ID" + "='" + id + "'", null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println("" + e);
|
System.out.println("" + e);
|
||||||
}
|
}
|
||||||
@@ -1625,20 +1625,44 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InsertAdditionalData(AddittionalGetterSetter data) {
|
public void InsertAdditionalData(AddittionalGetterSetter data,ArrayList<AdditionalDialogGetterSetter> dialog) {
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
|
ContentValues values1 = new ContentValues();
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|
||||||
values.put(CommonString.KEY_STORE_ID, data.getStore_id());
|
values.put("Store_Id", data.getStore_id());
|
||||||
values.put(CommonString.KEY_BRAND, data.getBrand());
|
values.put("brand_name", data.getBrand());
|
||||||
values.put(CommonString.KEY_BRAND_ID, data.getBrand_id());
|
values.put("brand_id", data.getBrand_id());
|
||||||
values.put(CommonString.KEY_IMAGE, data.getImage());
|
values.put("image_url", data.getImage());
|
||||||
values.put(CommonString.KEY_SKU_ID, data.getSku_id());
|
values.put("sku_id", data.getSku_id());
|
||||||
values.put(CommonString.KEY_SKUNAME, data.getSku());
|
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(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());
|
||||||
|
values1.put(CommonString.KEY_SKU_ID, dialog.get(i).getSku_id());
|
||||||
|
values1.put(CommonString.KEY_SKUNAME, dialog.get(i).getSku_name());
|
||||||
|
|
||||||
|
|
||||||
|
db.insert(CommonString.TABLE_INSERT_STOCK_DIALOG, null, values1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
db.insert(CommonString.TABLE_INSERT_STOCK_ADDITIONAL_DATA, null, values);
|
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
@@ -1654,7 +1678,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
cursordata = db.rawQuery("SELECT * FROM ADDITIONAL_STOCK_DATA WHERE STORE_ID = '"+store_id + "'", null);
|
cursordata = db.rawQuery("SELECT * FROM Stock_Additional_visibility WHERE Store_Id = '"+store_id + "'", null);
|
||||||
|
|
||||||
|
|
||||||
if (cursordata != null) {
|
if (cursordata != null) {
|
||||||
@@ -1664,27 +1688,27 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
|
|
||||||
sb.setKey_id(cursordata.getString(cursordata
|
sb.setKey_id(cursordata.getString(cursordata
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_ID)));
|
.getColumnIndexOrThrow("KEY_ID")));
|
||||||
|
|
||||||
|
|
||||||
sb.setStore_id(cursordata.getString(cursordata
|
sb.setStore_id(cursordata.getString(cursordata
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_STORE_ID)));
|
.getColumnIndexOrThrow("Store_Id")));
|
||||||
|
|
||||||
sb.setBrand_id(cursordata.getString(cursordata
|
sb.setBrand_id(cursordata.getString(cursordata
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_BRAND_ID)));
|
.getColumnIndexOrThrow("brand_id")));
|
||||||
|
|
||||||
sb.setBrand(cursordata.getString(cursordata
|
sb.setBrand(cursordata.getString(cursordata
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_BRAND)));
|
.getColumnIndexOrThrow("brand_name")));
|
||||||
|
|
||||||
|
|
||||||
sb.setImage(cursordata.getString(cursordata
|
sb.setImage(cursordata.getString(cursordata
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_IMAGE)));
|
.getColumnIndexOrThrow("image_url")));
|
||||||
|
|
||||||
sb.setSku_id(cursordata.getString(cursordata
|
sb.setSku_id(cursordata.getString(cursordata
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_SKU_ID)));
|
.getColumnIndexOrThrow("sku_id")));
|
||||||
|
|
||||||
sb.setSku(cursordata.getString(cursordata
|
sb.setSku(cursordata.getString(cursordata
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_SKUNAME)));
|
.getColumnIndexOrThrow("sku_name")));
|
||||||
|
|
||||||
productData.add(sb);
|
productData.add(sb);
|
||||||
cursordata.moveToNext();
|
cursordata.moveToNext();
|
||||||
|
|||||||
+11
@@ -66,4 +66,15 @@ public class AddittionalGetterSetter {
|
|||||||
|
|
||||||
String key_id;
|
String key_id;
|
||||||
|
|
||||||
|
public String getBtn_toogle() {
|
||||||
|
return btn_toogle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBtn_toogle(String btn_toogle) {
|
||||||
|
this.btn_toogle = btn_toogle;
|
||||||
|
}
|
||||||
|
|
||||||
|
String btn_toogle;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ public class CommonString {
|
|||||||
public static final String KEY_LOGIN_DATA = "LOGIN_DATA";
|
public static final String KEY_LOGIN_DATA = "LOGIN_DATA";
|
||||||
public static final String KEY_CULTURE_ID = "CULTURE_ID";
|
public static final String KEY_CULTURE_ID = "CULTURE_ID";
|
||||||
public static final String KEY_STORE_ID = "STORE_ID";
|
public static final String KEY_STORE_ID = "STORE_ID";
|
||||||
|
public static final String KEY_Common_ID = "COMMON_ID";
|
||||||
|
|
||||||
public static final String KEY_STORE_NAME = "STORE_NAME";
|
public static final String KEY_STORE_NAME = "STORE_NAME";
|
||||||
public static final String KEY_VISIT_DATE = "VISIT_DATE";
|
public static final String KEY_VISIT_DATE = "VISIT_DATE";
|
||||||
public static final String KEY_CAMERA_ALLOW = "CAMERA_ALLOW";
|
public static final String KEY_CAMERA_ALLOW = "CAMERA_ALLOW";
|
||||||
@@ -48,7 +50,8 @@ public class CommonString {
|
|||||||
public static final String KEY_REASON = "REASON";
|
public static final String KEY_REASON = "REASON";
|
||||||
public static final String KEY_COVERAGE_REMARK = "REMARK";
|
public static final String KEY_COVERAGE_REMARK = "REMARK";
|
||||||
public static final String KEY_IMAGE = "IMAGE";
|
public static final String KEY_IMAGE = "IMAGE";
|
||||||
public static final String KEY_ID = "Id";
|
public static final String KEY_IMAGE_URL = "IMAGE_URL";
|
||||||
|
public static final String KEY_ID = "Id";
|
||||||
public static final String KEY_MERCHANDISER_ID = "MERCHANDISER_ID";
|
public static final String KEY_MERCHANDISER_ID = "MERCHANDISER_ID";
|
||||||
public static final String KEY_BRAND = "BRAND";
|
public static final String KEY_BRAND = "BRAND";
|
||||||
public static final String KEY_BRAND_ID = "BRAND_ID";
|
public static final String KEY_BRAND_ID = "BRAND_ID";
|
||||||
@@ -61,7 +64,7 @@ public class CommonString {
|
|||||||
public static final String KEY_PROCESS_ID = "PROCESS_ID";
|
public static final String KEY_PROCESS_ID = "PROCESS_ID";
|
||||||
public static final String KEY_JOURNEY_PLAN = "JOURNEY_PLAN";
|
public static final String KEY_JOURNEY_PLAN = "JOURNEY_PLAN";
|
||||||
public static final String TABLE_INSERT_STOCK_DIALOG = "STOCK_DIALOG";
|
public static final String TABLE_INSERT_STOCK_DIALOG = "STOCK_DIALOG";
|
||||||
public static final String TABLE_INSERT_STOCK_ADDITIONAL_DATA = "ADDITIONAL_STOCK_DATA";
|
|
||||||
|
|
||||||
public static final String KEY_P = "P";
|
public static final String KEY_P = "P";
|
||||||
public static final String KEY_D = "D";
|
public static final String KEY_D = "D";
|
||||||
@@ -284,19 +287,44 @@ public class CommonString {
|
|||||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT," + KEY_STORE_ID + " VARCHAR,"
|
+ " INTEGER PRIMARY KEY AUTOINCREMENT," + KEY_STORE_ID + " VARCHAR,"
|
||||||
+ 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," + UNIQUE_KEY_ID + " VARCHAR,"
|
+ KEY_SKU_ID + " VARCHAR," + KEY_QUANTITY + " VARCHAR," + KEY_Common_ID + " VARCHAR,"
|
||||||
+ KEY_CATEGORY_ID + " VARCHAR,"
|
+ KEY_CATEGORY_ID + " VARCHAR,"
|
||||||
+ KEY_SKUNAME + " VARCHAR,"
|
+ KEY_SKUNAME + " VARCHAR,"
|
||||||
+ KEY_PROCESS_ID + " VARCHAR)";
|
+ KEY_PROCESS_ID + " VARCHAR)";
|
||||||
|
|
||||||
|
|
||||||
public static final String CREATE_TABLE_STOCK_ADDITIONAL_STOCK_DATA = "CREATE TABLE "
|
public static final String TABLE_INSERT_STOCK_ADDITIONAL = "Stock_Additional_visibility";
|
||||||
+ TABLE_INSERT_STOCK_ADDITIONAL_DATA + " (" + KEY_ID
|
|
||||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT," + KEY_STORE_ID + " VARCHAR,"
|
|
||||||
+ KEY_BRAND_ID + " VARCHAR," + KEY_BRAND + " VARCHAR,"
|
|
||||||
|
|
||||||
+ KEY_SKU_ID + " VARCHAR," + KEY_IMAGE + " VARCHAR,"
|
public static final String CREATE_TABLE_INSERT_STOCK_ADDITIONAL_VISIBILITY = "CREATE TABLE IF NOT EXISTS "
|
||||||
|
+ TABLE_INSERT_STOCK_ADDITIONAL
|
||||||
|
+ "("
|
||||||
|
+ "KEY_ID"
|
||||||
|
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
|
|
||||||
|
+ "Store_Id"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "brand_name"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "brand_id"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "image_url"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "sku_id"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "sku_name"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "toggle_value"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "IMAGE2"
|
||||||
|
+ " VARCHAR"
|
||||||
|
|
||||||
|
+ ")";
|
||||||
|
|
||||||
+ KEY_SKUNAME + " VARCHAR,"
|
|
||||||
+ KEY_IMAGE + " VARCHAR)";
|
|
||||||
}
|
}
|
||||||
|
|||||||
+253
-104
@@ -11,12 +11,14 @@ import android.content.pm.ApplicationInfo;
|
|||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
|
import android.support.design.widget.Snackbar;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -33,6 +35,7 @@ import android.widget.EditText;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.ToggleButton;
|
import android.widget.ToggleButton;
|
||||||
@@ -41,6 +44,7 @@ import java.io.File;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
@@ -60,6 +64,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
ArrayList<AdditionalDialogGetterSetter> list = new ArrayList<AdditionalDialogGetterSetter>();
|
ArrayList<AdditionalDialogGetterSetter> list = new ArrayList<AdditionalDialogGetterSetter>();
|
||||||
ArrayList<AddittionalGetterSetter> listdata = new ArrayList<AddittionalGetterSetter>();
|
ArrayList<AddittionalGetterSetter> listdata = new ArrayList<AddittionalGetterSetter>();
|
||||||
|
|
||||||
|
|
||||||
|
ArrayList<AdditionalDialogGetterSetter> defdata = new ArrayList<AdditionalDialogGetterSetter>();
|
||||||
Spinner spinner_brand, spinner_sku;
|
Spinner spinner_brand, spinner_sku;
|
||||||
Spinner spinner_brand_list, spinner_sku_list;
|
Spinner spinner_brand_list, spinner_sku_list;
|
||||||
|
|
||||||
@@ -69,7 +75,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
Button btnsku, btnaddlayout;
|
Button btnsku, btnaddlayout;
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
ArrayList<SkuGetterSetter> sku_list;
|
ArrayList<SkuGetterSetter> sku_list;
|
||||||
String brand_name="", brand_id ="", SKU_name ="", SKU_ID="",brand_list_name="",brand_list_id="",sku_list_name="",sku_list_id="";
|
String brand_name = "", brand_id = "", SKU_name = "", SKU_ID = "", brand_list_name = "", brand_list_id = "", sku_list_name = "", sku_list_id = "";
|
||||||
public ListView listview;
|
public ListView listview;
|
||||||
LinearLayout linearlay;
|
LinearLayout linearlay;
|
||||||
ArrayList<BrandMasterGetterSetter> brandList;
|
ArrayList<BrandMasterGetterSetter> brandList;
|
||||||
@@ -79,15 +85,20 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
|
|
||||||
ArrayList<SkuGetterSetter> empty_list = new ArrayList<>();
|
ArrayList<SkuGetterSetter> empty_list = new ArrayList<>();
|
||||||
String _pathforcheck,_path,str;
|
String _pathforcheck, _path, str,msg;
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
String store_id,date,intime,img_str;
|
String store_id, date, intime, img_str, togglevalue = "1";
|
||||||
ImageView img_cam,img_clicked;
|
ImageView img_cam, img_clicked;
|
||||||
Button btn_add;
|
Button btn_add;
|
||||||
EditText Edt_txt;
|
EditText Edt_txt;
|
||||||
MyAdaptorStock adapterData;
|
MyAdaptorStock adapterData;
|
||||||
ListView listviewlay;
|
ListView listviewlay;
|
||||||
|
String errormsg;
|
||||||
MyAdaptorAdditionalStock adapteradditional;
|
MyAdaptorAdditionalStock adapteradditional;
|
||||||
|
AddittionalGetterSetter adGt;
|
||||||
|
LinearLayout brandlayout, diaplylayout, cameralayout;
|
||||||
|
RelativeLayout skulayout;
|
||||||
|
|
||||||
////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
|
||||||
@@ -103,7 +114,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||||
|
|
||||||
|
|
||||||
store_id="1";
|
// store_id = "1";
|
||||||
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, "");
|
||||||
|
|
||||||
@@ -118,7 +129,16 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
btnsku = (Button) findViewById(R.id.btn_sku);
|
btnsku = (Button) findViewById(R.id.btn_sku);
|
||||||
btnaddlayout = (Button) findViewById(R.id.btadd);
|
btnaddlayout = (Button) findViewById(R.id.btadd);
|
||||||
listviewlay = (ListView) findViewById(R.id.listviewlv);
|
listviewlay = (ListView) findViewById(R.id.listviewlv);
|
||||||
|
brandlayout = (LinearLayout) findViewById(R.id.tv_brandlayout);
|
||||||
|
diaplylayout = (LinearLayout) findViewById(R.id.tv_displaylayout);
|
||||||
|
cameralayout = (LinearLayout) findViewById(R.id.tv_cameralayout);
|
||||||
|
|
||||||
|
skulayout = (RelativeLayout) findViewById(R.id.tv_skulayout);
|
||||||
|
|
||||||
|
btntoggle.setChecked(true);
|
||||||
|
|
||||||
|
|
||||||
|
str = CommonString.FILE_PATH;
|
||||||
|
|
||||||
///band List
|
///band List
|
||||||
brand_list = db.getBrandMasterData(store_id);
|
brand_list = db.getBrandMasterData(store_id);
|
||||||
@@ -135,7 +155,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
SkuMasterGetterSetter select = new SkuMasterGetterSetter();
|
SkuMasterGetterSetter select = new SkuMasterGetterSetter();
|
||||||
select.setSKU("Select");
|
select.setSKU("Select");
|
||||||
skuMaster_list.add(0,select);
|
skuMaster_list.add(0, select);
|
||||||
CustomSkuMasterAdpter skuadapter = new CustomSkuMasterAdpter(AdditionalVisibility.this, R.layout.custom_spinner_item, skuMaster_list);
|
CustomSkuMasterAdpter skuadapter = new CustomSkuMasterAdpter(AdditionalVisibility.this, R.layout.custom_spinner_item, skuMaster_list);
|
||||||
spinner_sku_list.setAdapter(skuadapter);
|
spinner_sku_list.setAdapter(skuadapter);
|
||||||
|
|
||||||
@@ -145,8 +165,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
|
|
||||||
brand_list_name=brand_list.get(position).getBRAND().get(0);
|
brand_list_name = brand_list.get(position).getBRAND().get(0);
|
||||||
brand_list_id=brand_list.get(position).getBRAND_ID().get(0);
|
brand_list_id = brand_list.get(position).getBRAND_ID().get(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -163,8 +183,8 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
|
|
||||||
sku_list_name=skuMaster_list.get(position).getSKU().get(0);
|
sku_list_name = skuMaster_list.get(position).getSKU().get(0);
|
||||||
sku_list_id=skuMaster_list.get(position).getSKU_ID().get(0);
|
sku_list_id = skuMaster_list.get(position).getSKU_ID().get(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -175,57 +195,119 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
listdata = db.getAdditionalStock(store_id);
|
||||||
|
|
||||||
|
if (listdata.size() > 0) {
|
||||||
|
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||||
|
listviewlay.setAdapter(adapteradditional);
|
||||||
|
listviewlay.invalidateViews();
|
||||||
|
}
|
||||||
|
|
||||||
btnaddlayout.setOnClickListener(new View.OnClickListener() {
|
btnaddlayout.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
|
adGt = new AddittionalGetterSetter();
|
||||||
AddittionalGetterSetter adGt=new AddittionalGetterSetter();
|
|
||||||
|
|
||||||
adGt.setBrand(brand_list_name);
|
adGt.setBrand(brand_list_name);
|
||||||
adGt.setBrand_id(brand_list_id);
|
adGt.setBrand_id(brand_list_id);
|
||||||
adGt.setImage(img_str);
|
adGt.setImage(img_str);
|
||||||
adGt.setSku(sku_list_name);
|
adGt.setSku(sku_list_name);
|
||||||
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);
|
||||||
|
|
||||||
db.InsertAdditionalData(adGt);
|
if (validateData(adGt,defdata)) {
|
||||||
|
|
||||||
spinner_brand_list.setSelection(0);
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
|
||||||
|
AdditionalVisibility.this);
|
||||||
|
|
||||||
spinner_sku_list.setSelection(0);
|
// set title
|
||||||
|
alertDialogBuilder.setTitle("Do You Want To Save");
|
||||||
|
|
||||||
img_str="";
|
// set dialog message
|
||||||
|
alertDialogBuilder
|
||||||
|
.setMessage("")
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
listdata = db.getAdditionalStock(store_id);
|
db.InsertAdditionalData(adGt,defdata);
|
||||||
|
|
||||||
if(listdata.size()>0)
|
spinner_brand_list.setSelection(0);
|
||||||
{
|
|
||||||
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this,listdata);
|
spinner_sku_list.setSelection(0);
|
||||||
listviewlay.setAdapter(adapteradditional);
|
|
||||||
listviewlay.invalidateViews();
|
img_str = "";
|
||||||
|
brand_list_name = "";
|
||||||
|
brand_list_id = "";
|
||||||
|
sku_list_name = "";
|
||||||
|
sku_list_id = "";
|
||||||
|
|
||||||
|
defdata.clear();
|
||||||
|
|
||||||
|
|
||||||
|
btntoggle.setChecked(true);
|
||||||
|
|
||||||
|
togglevalue = "1";
|
||||||
|
brandlayout.setVisibility(View.VISIBLE);
|
||||||
|
diaplylayout.setVisibility(View.VISIBLE);
|
||||||
|
cameralayout.setVisibility(View.VISIBLE);
|
||||||
|
skulayout.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
listdata = db.getAdditionalStock(store_id);
|
||||||
|
|
||||||
|
if (listdata.size() > 0) {
|
||||||
|
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||||
|
listviewlay.setAdapter(adapteradditional);
|
||||||
|
listviewlay.invalidateViews();
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton("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();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Snackbar.make(view, errormsg, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
btntoggle.setOnClickListener(new View.OnClickListener() {
|
btntoggle.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
|
if (btntoggle.isChecked()) {
|
||||||
|
togglevalue = "1";
|
||||||
|
|
||||||
|
brandlayout.setVisibility(View.VISIBLE);
|
||||||
|
diaplylayout.setVisibility(View.VISIBLE);
|
||||||
|
cameralayout.setVisibility(View.VISIBLE);
|
||||||
|
skulayout.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
togglevalue = "0";
|
||||||
|
|
||||||
|
brandlayout.setVisibility(View.GONE);
|
||||||
|
diaplylayout.setVisibility(View.GONE);
|
||||||
|
cameralayout.setVisibility(View.GONE);
|
||||||
|
skulayout.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -233,12 +315,10 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
_pathforcheck = store_id + "Store"
|
_pathforcheck = store_id + "Store"
|
||||||
+ "Image" + date.replace("/","") + getCurrentTime().replace(":","")+".jpg";
|
+ "Image" + date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||||
|
|
||||||
intime = getCurrentTime();
|
intime = getCurrentTime();
|
||||||
|
|
||||||
startCameraActivity();
|
startCameraActivity();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -254,6 +334,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCurrentTime() {
|
public String getCurrentTime() {
|
||||||
|
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
@@ -405,9 +486,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class CustomSkuMasterAdpter extends ArrayAdapter<String> {
|
public class CustomSkuMasterAdpter extends ArrayAdapter<String> {
|
||||||
|
|
||||||
private Activity activity;
|
private Activity activity;
|
||||||
@@ -471,15 +549,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void startCameraActivity() {
|
protected void startCameraActivity() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -488,10 +557,10 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
File file = new File(_path);
|
File file = new File(_path);
|
||||||
Uri outputFileUri = Uri.fromFile(file);
|
Uri outputFileUri = Uri.fromFile(file);
|
||||||
|
|
||||||
String defaultCameraPackage="";
|
String defaultCameraPackage = "";
|
||||||
final PackageManager packageManager = getPackageManager();
|
final PackageManager packageManager = getPackageManager();
|
||||||
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||||
for (int n=0;n<list.size();n++) {
|
for (int n = 0; n < list.size(); n++) {
|
||||||
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||||
Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
||||||
Log.e("TAG", "package name : " + list.get(n).packageName);
|
Log.e("TAG", "package name : " + list.get(n).packageName);
|
||||||
@@ -522,6 +591,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
|
||||||
@@ -535,10 +605,10 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||||
if (new File(str + _pathforcheck).exists()) {
|
if (new File(str + _pathforcheck).exists()) {
|
||||||
Bitmap bmp = BitmapFactory.decodeFile(str + _pathforcheck);
|
// Bitmap bmp = BitmapFactory.decodeFile(str + _pathforcheck);
|
||||||
img_cam.setImageBitmap(bmp);
|
// img_cam.setImageBitmap(bmp);
|
||||||
img_clicked.setVisibility(View.GONE);
|
// img_clicked.setVisibility(View.GONE);
|
||||||
img_cam.setVisibility(View.VISIBLE);
|
// img_cam.setVisibility(View.VISIBLE);
|
||||||
img_str = _pathforcheck;
|
img_str = _pathforcheck;
|
||||||
_pathforcheck = "";
|
_pathforcheck = "";
|
||||||
}
|
}
|
||||||
@@ -565,29 +635,24 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
//dialog.setCancelable(false);
|
//dialog.setCancelable(false);
|
||||||
spinner_brand = (Spinner) dialog.findViewById(R.id.spinner_brand);
|
spinner_brand = (Spinner) dialog.findViewById(R.id.spinner_brand);
|
||||||
spinner_sku = (Spinner) dialog.findViewById(R.id.spinner_sku);
|
spinner_sku = (Spinner) dialog.findViewById(R.id.spinner_sku);
|
||||||
btn_add = (Button) dialog.findViewById(R.id.btn_add);
|
btn_add = (Button) dialog.findViewById(R.id.btn_add);
|
||||||
Edt_txt = (EditText) dialog.findViewById(R.id.et_stock);
|
Edt_txt = (EditText) dialog.findViewById(R.id.et_stock);
|
||||||
listview = (ListView)dialog.findViewById(R.id.lv);
|
listview = (ListView) dialog.findViewById(R.id.lv);
|
||||||
linearlay = (LinearLayout)dialog.findViewById(R.id.list_layout);
|
linearlay = (LinearLayout) dialog.findViewById(R.id.list_layout);
|
||||||
|
|
||||||
|
//list = db.getDialogStock(store_id);
|
||||||
|
|
||||||
|
|
||||||
|
if (defdata.size() > 0) {
|
||||||
list = db.getDialogStock(store_id);
|
|
||||||
|
|
||||||
|
|
||||||
if(list.size()>0)
|
|
||||||
{
|
|
||||||
linearlay.setVisibility(View.VISIBLE);
|
linearlay.setVisibility(View.VISIBLE);
|
||||||
adapterData = new MyAdaptorStock(AdditionalVisibility.this,list);
|
adapterData = new MyAdaptorStock(AdditionalVisibility.this, defdata);
|
||||||
listview.setAdapter(adapterData);
|
listview.setAdapter(adapterData);
|
||||||
listview.invalidateViews();
|
listview.invalidateViews();
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
spinner_sku.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
spinner_sku.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
@@ -608,10 +673,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
btn_add.setOnClickListener(new View.OnClickListener() {
|
btn_add.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@@ -623,29 +684,40 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
//ab.setDisplay_id(data.get(position).getDisplay_id());
|
//ab.setDisplay_id(data.get(position).getDisplay_id());
|
||||||
ab.setStore_id(store_id);
|
ab.setStore_id(store_id);
|
||||||
// ab.setUnique_id(data.get(position).getUnique_id());
|
// ab.setUnique_id(data.get(position).getUnique_id());
|
||||||
ab.setSku_id(SKU_ID);
|
ab.setSku_id(SKU_ID);
|
||||||
ab.setSku_name(SKU_name);
|
ab.setSku_name(SKU_name);
|
||||||
// ab.setProcess_id(process_id);
|
// ab.setProcess_id(process_id);
|
||||||
ab.setQuantity(Edt_txt.getText().toString());
|
ab.setQuantity(Edt_txt.getText().toString());
|
||||||
// ab.setCategory_id(category_id);
|
// ab.setCategory_id(category_id);
|
||||||
|
|
||||||
db.InsertStockDialog(ab);
|
|
||||||
|
|
||||||
spinner_brand.setSelection(0);
|
if(validateDialogData(ab))
|
||||||
spinner_sku.setSelection(0);
|
{
|
||||||
Edt_txt.setText("");
|
|
||||||
|
|
||||||
list = db.getDialogStock(store_id);
|
|
||||||
|
|
||||||
|
defdata.add(ab);
|
||||||
|
// db.InsertStockDialog(ab);
|
||||||
|
|
||||||
|
spinner_brand.setSelection(0);
|
||||||
|
spinner_sku.setSelection(0);
|
||||||
|
Edt_txt.setText("");
|
||||||
|
|
||||||
|
// list = db.getDialogStock(store_id);
|
||||||
linearlay.setVisibility(View.VISIBLE);
|
linearlay.setVisibility(View.VISIBLE);
|
||||||
adapterData = new MyAdaptorStock(AdditionalVisibility.this,list);
|
adapterData = new MyAdaptorStock(AdditionalVisibility.this, defdata);
|
||||||
listview.setAdapter(adapterData);
|
listview.setAdapter(adapterData);
|
||||||
listview.invalidateViews();
|
listview.invalidateViews();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Snackbar.make(v, msg, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
}
|
||||||
|
|
||||||
// dialog.cancel();
|
|
||||||
|
// dialog.cancel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -712,8 +784,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dialog.show();
|
dialog.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -778,7 +848,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
class ViewHolder {
|
class ViewHolder {
|
||||||
TextView brand, qty_bought, display;
|
TextView brand, qty_bought, display;
|
||||||
Button save,delete;
|
Button save, delete;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -799,7 +869,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
holder.qty_bought = (TextView) convertView.findViewById(R.id.qty_bought);
|
holder.qty_bought = (TextView) convertView.findViewById(R.id.qty_bought);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
holder.delete = (Button) convertView.findViewById(R.id.delete_btn);
|
holder.delete = (Button) convertView.findViewById(R.id.delete_btn);
|
||||||
|
|
||||||
convertView.setTag(holder);
|
convertView.setTag(holder);
|
||||||
@@ -822,11 +891,12 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
alertDialogBuilder
|
alertDialogBuilder
|
||||||
.setMessage("Click Yes To Delete!")
|
.setMessage("Click Yes To Delete!")
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.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.deletedialogStockEntry(list.get(position1).getKEY_ID());
|
||||||
|
|
||||||
db.deletedialogStockEntry(list.get(position1).getKEY_ID());
|
defdata.remove(position1);
|
||||||
|
|
||||||
adapterData.notifyDataSetChanged();
|
adapterData.notifyDataSetChanged();
|
||||||
|
|
||||||
@@ -834,15 +904,15 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
list.get(position1).getDisplay_id(),list.get(position1).getUnique_id());*/
|
list.get(position1).getDisplay_id(),list.get(position1).getUnique_id());*/
|
||||||
|
|
||||||
|
|
||||||
list = db.getDialogStock(store_id);
|
// list = db.getDialogStock(store_id);
|
||||||
|
|
||||||
listview.setAdapter(new MyAdaptorStock(AdditionalVisibility.this, list));
|
listview.setAdapter(new MyAdaptorStock(AdditionalVisibility.this, defdata));
|
||||||
listview.invalidateViews();
|
listview.invalidateViews();
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton("No",new DialogInterface.OnClickListener() {
|
.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog,int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
// if this button is clicked, just close
|
// if this button is clicked, just close
|
||||||
// the dialog box and do nothing
|
// the dialog box and do nothing
|
||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
@@ -859,7 +929,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
holder.brand.setText(list.get(position1).getBrand().toString());
|
holder.brand.setText(list.get(position1).getBrand().toString());
|
||||||
holder.display.setText(list.get(position1).getSku_name().toString());
|
holder.display.setText(list.get(position1).getSku_name().toString());
|
||||||
|
|
||||||
@@ -909,7 +978,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
class ViewHolder {
|
class ViewHolder {
|
||||||
TextView brand, qty_bought, display;
|
TextView brand, qty_bought, display;
|
||||||
Button save,delete;
|
Button save, delete;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -930,7 +999,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
holder.qty_bought = (TextView) convertView.findViewById(R.id.qty_bought);
|
holder.qty_bought = (TextView) convertView.findViewById(R.id.qty_bought);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
holder.delete = (Button) convertView.findViewById(R.id.delete_btn);
|
holder.delete = (Button) convertView.findViewById(R.id.delete_btn);
|
||||||
|
|
||||||
convertView.setTag(holder);
|
convertView.setTag(holder);
|
||||||
@@ -953,23 +1021,25 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
alertDialogBuilder
|
alertDialogBuilder
|
||||||
.setMessage("Click Yes To Delete!")
|
.setMessage("Click Yes To Delete!")
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.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());
|
||||||
|
|
||||||
adapterData.notifyDataSetChanged();
|
adapteradditional.notifyDataSetChanged();
|
||||||
|
|
||||||
listdata = db.getAdditionalStock(store_id);
|
listdata = db.getAdditionalStock(store_id);
|
||||||
|
|
||||||
listview.setAdapter(new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata));
|
adapteradditional = new MyAdaptorAdditionalStock(AdditionalVisibility.this, listdata);
|
||||||
listview.invalidateViews();
|
listviewlay.setAdapter(adapteradditional);
|
||||||
|
listviewlay.invalidateViews();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton("No",new DialogInterface.OnClickListener() {
|
.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog,int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
// if this button is clicked, just close
|
// if this button is clicked, just close
|
||||||
// the dialog box and do nothing
|
// the dialog box and do nothing
|
||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
@@ -998,8 +1068,87 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean validateData(AddittionalGetterSetter data,ArrayList<AdditionalDialogGetterSetter> dialog) {
|
||||||
|
boolean flag = true;
|
||||||
|
|
||||||
|
String brandid = data.getBrand_id();
|
||||||
|
String skuid = data.getSku_id();
|
||||||
|
|
||||||
|
String imageu = data.getImage();
|
||||||
|
String toggleid = data.getBtn_toogle();
|
||||||
|
|
||||||
|
|
||||||
|
if (toggleid.equalsIgnoreCase("0")) {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
|
||||||
}
|
if (brandid.equalsIgnoreCase("") || skuid.equalsIgnoreCase("")) {
|
||||||
|
flag = false;
|
||||||
|
|
||||||
|
errormsg = "Please Select dropdown";
|
||||||
|
|
||||||
|
} else if (imageu == null || imageu.equalsIgnoreCase("")) {
|
||||||
|
flag = false;
|
||||||
|
|
||||||
|
errormsg = "Please Take a image";
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (dialog.size()==0) {
|
||||||
|
|
||||||
|
errormsg = "Please fill sku data";
|
||||||
|
flag = false;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
else {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean validateDialogData(AdditionalDialogGetterSetter data) {
|
||||||
|
boolean flag = true;
|
||||||
|
|
||||||
|
String brandid=data.getBrand_id();
|
||||||
|
String displayid=data.getSku_id();
|
||||||
|
String QTy=data.getQuantity();
|
||||||
|
|
||||||
|
|
||||||
|
if(brandid.equalsIgnoreCase("")||brandid==null)
|
||||||
|
{
|
||||||
|
flag = false;
|
||||||
|
|
||||||
|
msg="Please Select Dropdown";
|
||||||
|
}
|
||||||
|
else if(displayid==null||displayid.equalsIgnoreCase(""))
|
||||||
|
{
|
||||||
|
flag = false;
|
||||||
|
msg="Please Select Dropdown";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
else if(QTy.equalsIgnoreCase("") || QTy==null)
|
||||||
|
{
|
||||||
|
flag = false;
|
||||||
|
msg="Please enter Quantity";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+13
@@ -24,6 +24,19 @@ public class JourneyPlanGetterSetter {
|
|||||||
ArrayList<String> CLASS_ID = new ArrayList<String>();
|
ArrayList<String> CLASS_ID = new ArrayList<String>();
|
||||||
ArrayList<String> CAMERA_ALLOW = new ArrayList<String>();
|
ArrayList<String> CAMERA_ALLOW = new ArrayList<String>();
|
||||||
|
|
||||||
|
public ArrayList<String> getCHANNEL_ID() {
|
||||||
|
return CHANNEL_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCHANNEL_ID(String CHANNEL_ID) {
|
||||||
|
this.CHANNEL_ID.add(CHANNEL_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
ArrayList<String> CHANNEL_ID = new ArrayList<String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public ArrayList<String> getCHECKOUT_STATUS() {
|
public ArrayList<String> getCHECKOUT_STATUS() {
|
||||||
return CHECKOUT_STATUS;
|
return CHECKOUT_STATUS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,6 +173,11 @@ public class XMLHandlers {
|
|||||||
jcpGetterSetter.setGEO_TAG(xpp.nextText());
|
jcpGetterSetter.setGEO_TAG(xpp.nextText());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (xpp.getName().equals("CHANNEL_ID")) {
|
||||||
|
jcpGetterSetter.setCHANNEL_ID(xpp.nextText());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
xpp.next();
|
xpp.next();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,9 +19,9 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="2dp"
|
android:layout_marginBottom="2dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
android:layout_weight="10"
|
android:layout_weight="10"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:weightSum="25">
|
android:weightSum="25">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -115,9 +115,9 @@
|
|||||||
android:id="@+id/delete_btn"
|
android:id="@+id/delete_btn"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="30dp"
|
||||||
android:layout_weight="10"
|
android:layout_weight="10"
|
||||||
android:background="@color/grey_background"
|
android:background="@color/grey_background"
|
||||||
android:layout_marginLeft="30dp"
|
|
||||||
android:text="Delete" />
|
android:text="Delete" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -10,16 +10,6 @@
|
|||||||
<include layout="@layout/contentadditionalvisibility" />
|
<include layout="@layout/contentadditionalvisibility" />
|
||||||
|
|
||||||
|
|
||||||
<android.support.design.widget.FloatingActionButton
|
|
||||||
android:id="@+id/fab"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom|end"
|
|
||||||
android:layout_margin="@dimen/fab_margin"
|
|
||||||
app:srcCompat="@android:drawable/ic_menu_save"
|
|
||||||
app:backgroundTint="@color/colorPrimary"
|
|
||||||
android:visibility="gone"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
<android.support.v7.widget.CardView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
@@ -60,11 +62,13 @@
|
|||||||
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:layout_weight=".5" />
|
android:layout_weight=".5" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/tv_brandlayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="30"
|
android:layout_weight="30"
|
||||||
@@ -92,6 +96,7 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/tv_displaylayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="30"
|
android:layout_weight="30"
|
||||||
@@ -120,6 +125,7 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/tv_cameralayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="15"
|
android:layout_weight="15"
|
||||||
@@ -176,6 +182,7 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
android:id="@+id/tv_skulayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="8"
|
android:layout_weight="8"
|
||||||
@@ -210,7 +217,10 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</android.support.v7.widget.CardView>
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
<android.support.v7.widget.CardView
|
||||||
|
|
||||||
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