Merge pull request #29 from CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/NewVisibilityCode
New visibility code
This commit is contained in:
Generated
+1
-1
@@ -41,7 +41,7 @@
|
|||||||
<ConfirmationsSetting value="0" id="Add" />
|
<ConfirmationsSetting value="0" id="Add" />
|
||||||
<ConfirmationsSetting value="0" id="Remove" />
|
<ConfirmationsSetting value="0" id="Remove" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
db.execSQL(TableBean.getMappingAdditionalPromotion());
|
db.execSQL(TableBean.getMappingAdditionalPromotion());
|
||||||
db.execSQL(TableBean.getMappingPromotion());
|
db.execSQL(TableBean.getMappingPromotion());
|
||||||
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);
|
||||||
@@ -141,7 +142,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);
|
||||||
|
|
||||||
@@ -2014,22 +2015,13 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<AdditionalDialogGetterSetter> getDialogStock(String store_id) {
|
public ArrayList<AdditionalDialogGetterSetter> getDialogStock(String keyid) {
|
||||||
Cursor cursordata = null;
|
Cursor cursordata = null;
|
||||||
ArrayList<AdditionalDialogGetterSetter> productData = new ArrayList<AdditionalDialogGetterSetter>();
|
ArrayList<AdditionalDialogGetterSetter> productData = new ArrayList<AdditionalDialogGetterSetter>();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
cursordata = db.rawQuery("SELECT * FROM STOCK_DIALOG WHERE STORE_ID = '"+store_id + "'", null);
|
cursordata = db.rawQuery("SELECT * FROM STOCK_DIALOG WHERE COMMON_ID = '"+keyid + "'", null);
|
||||||
|
|
||||||
/* cursordata = db.rawQuery("SELECT * from "
|
|
||||||
+ CommonString.TABLE_INSERT_STOCK_TOT + " WHERE "
|
|
||||||
+ CommonString.KEY_STORE_ID + "='" + store_id + "' AND "
|
|
||||||
+ CommonString.KEY_CATEGORY_ID + "='" + cate_id + "' AND "
|
|
||||||
+ CommonString.KEY_PROCESS_ID + " ='" + process_id + "' AND "
|
|
||||||
+ CommonString.KEY_DISPLAY_ID + "= '" + display_id + "' AND "
|
|
||||||
+ CommonString.UNIQUE_KEY_ID + "= '" + unique_id + "'",
|
|
||||||
null);*/
|
|
||||||
|
|
||||||
if (cursordata != null) {
|
if (cursordata != null) {
|
||||||
cursordata.moveToFirst();
|
cursordata.moveToFirst();
|
||||||
@@ -2045,12 +2037,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
sb.setBrand(cursordata.getString(cursordata
|
sb.setBrand(cursordata.getString(cursordata
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_BRAND)));
|
.getColumnIndexOrThrow(CommonString.KEY_BRAND)));
|
||||||
|
|
||||||
/*sb.setCategory_id(cursordata.getString(cursordata
|
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_CATEGORY_ID)));
|
|
||||||
|
|
||||||
|
|
||||||
sb.setDisplay_id(cursordata.getString(cursordata
|
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_DISPLAY_ID)));*/
|
|
||||||
|
|
||||||
sb.setQuantity(cursordata.getString(cursordata
|
sb.setQuantity(cursordata.getString(cursordata
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_QUANTITY)));
|
.getColumnIndexOrThrow(CommonString.KEY_QUANTITY)));
|
||||||
@@ -2061,12 +2047,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
sb.setSku_name(cursordata.getString(cursordata
|
sb.setSku_name(cursordata.getString(cursordata
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_SKUNAME)));
|
.getColumnIndexOrThrow(CommonString.KEY_SKUNAME)));
|
||||||
|
|
||||||
/* sb.setProcess_id(cursordata.getString(cursordata
|
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_PROCESS_ID)));
|
|
||||||
|
|
||||||
sb.setUnique_id(cursordata.getString(cursordata
|
|
||||||
.getColumnIndexOrThrow(CommonString.UNIQUE_KEY_ID)));*/
|
|
||||||
|
|
||||||
|
|
||||||
productData.add(sb);
|
productData.add(sb);
|
||||||
cursordata.moveToNext();
|
cursordata.moveToNext();
|
||||||
@@ -2094,7 +2074,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);
|
||||||
}
|
}
|
||||||
@@ -2186,20 +2166,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) {
|
||||||
@@ -2215,7 +2219,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) {
|
||||||
@@ -2225,27 +2229,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;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,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";
|
||||||
@@ -47,7 +49,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";
|
||||||
@@ -62,7 +65,7 @@ public class CommonString {
|
|||||||
|
|
||||||
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";
|
||||||
@@ -289,21 +292,45 @@ 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 ,"
|
||||||
|
|
||||||
+ KEY_SKUNAME + " VARCHAR,"
|
+ "Store_Id"
|
||||||
+ KEY_IMAGE + " VARCHAR)";
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "brand_name"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "brand_id"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "image_url"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "sku_id"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "sku_name"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "toggle_value"
|
||||||
|
+ " VARCHAR,"
|
||||||
|
|
||||||
|
+ "IMAGE2"
|
||||||
|
+ " VARCHAR"
|
||||||
|
|
||||||
|
+ ")";
|
||||||
|
|
||||||
public static final String TABLE_INSERT_ADDITIONAL_PROMO_COMPLIANCE = "Additional_Promo_Compliance_Data";
|
public static final String TABLE_INSERT_ADDITIONAL_PROMO_COMPLIANCE = "Additional_Promo_Compliance_Data";
|
||||||
|
|
||||||
|
|||||||
+261
-105
@@ -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> uploadlist = new ArrayList<AdditionalDialogGetterSetter>();
|
||||||
|
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,126 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
listdata = db.getAdditionalStock(store_id);
|
||||||
|
|
||||||
|
for(int k=0;k<listdata.size();k++)
|
||||||
|
{
|
||||||
|
String KeyID= listdata.get(k).getKey_id();
|
||||||
|
|
||||||
|
uploadlist = db.getDialogStock(KeyID);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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);
|
||||||
|
btnsku.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);
|
||||||
|
btnsku.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
togglevalue = "0";
|
||||||
|
|
||||||
|
brandlayout.setVisibility(View.INVISIBLE);
|
||||||
|
diaplylayout.setVisibility(View.INVISIBLE);
|
||||||
|
cameralayout.setVisibility(View.INVISIBLE);
|
||||||
|
btnsku.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -233,12 +322,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 +341,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 +493,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 +556,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void startCameraActivity() {
|
protected void startCameraActivity() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -488,10 +564,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 +598,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 +612,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 +642,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 +680,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 +691,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 +791,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dialog.show();
|
dialog.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -778,7 +855,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 +876,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 +898,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 +911,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 +936,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 +985,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 +1006,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 +1028,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 +1075,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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -174,6 +174,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,14 +62,16 @@
|
|||||||
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="40"
|
||||||
android:background="@color/grey_background"
|
android:background="@color/grey_background"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:padding="5dp"
|
android:padding="5dp"
|
||||||
@@ -86,15 +90,16 @@
|
|||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/spinner_Brand1"
|
android:id="@+id/spinner_Brand1"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="50dp"
|
||||||
android:layout_weight="2" />
|
android:layout_weight="2" />
|
||||||
|
|
||||||
</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="40"
|
||||||
android:background="@color/grey_background"
|
android:background="@color/grey_background"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:padding="5dp"
|
android:padding="5dp"
|
||||||
@@ -112,14 +117,14 @@
|
|||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/spinner_SkuMaster"
|
android:id="@+id/spinner_SkuMaster"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="50dp"
|
||||||
android:layout_weight="2"
|
android:layout_weight="2"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
</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"
|
||||||
@@ -175,22 +180,17 @@
|
|||||||
|
|
||||||
</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"
|
||||||
android:background="@color/grey_background"
|
android:background="@color/grey_background"
|
||||||
android:padding="5dp">
|
android:padding="5dp">
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/btn_sku"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:background="@color/colorPrimary"
|
|
||||||
android:text="@string/sku" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
</RelativeLayout>-->
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -198,19 +198,28 @@
|
|||||||
android:layout_weight="9"
|
android:layout_weight="9"
|
||||||
android:background="@color/grey_background"
|
android:background="@color/grey_background"
|
||||||
android:padding="5dp">
|
android:padding="5dp">
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_sku"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:text="@string/sku" />
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btadd"
|
android:id="@+id/btadd"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerInParent="true"
|
android:layout_alignParentRight="true"
|
||||||
android:background="@color/colorPrimary"
|
android:background="@color/colorPrimary"
|
||||||
android:text="@string/add" />
|
android:text="@string/add" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</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