Merge branch 'master' of https://github.com/CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/GSKORANGEV1 into Category_G
# Conflicts: # GSKMTOrange/src/main/AndroidManifest.xml # GSKMTOrange/src/main/java/cpm/com/gskmtorange/MainActivity.java
This commit is contained in:
@@ -35,51 +35,31 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:screenOrientation="portrait"
|
||||||
android:screenOrientation="portrait"/>
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity android:name=".autoupdate.AutoUpdateActivity"
|
<activity
|
||||||
android:screenOrientation="portrait"/>
|
android:name=".autoupdate.AutoUpdateActivity"
|
||||||
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".SelectLanguageActivity"
|
android:name=".SelectLanguageActivity"
|
||||||
android:label="@string/title_activity_select_language"
|
android:label="@string/title_activity_select_language"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity android:name=".download.DownloadActivity"
|
<activity
|
||||||
android:screenOrientation="portrait"/>
|
android:name=".download.DownloadActivity"
|
||||||
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
|
|
||||||
android:name=".GeoTag.GeoTagStoreList"
|
android:name=".GeoTag.GeoTagStoreList"
|
||||||
android:label="@string/title_activity_store_list_geotag"
|
android:label="@string/title_activity_store_list_geotag"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:screenOrientation="portrait"
|
||||||
android:screenOrientation="portrait"/>
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".gsk_dailyentry.CategoryWisePerformanceActivity"
|
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
|
||||||
android:windowSoftInputMode="adjustPan"
|
|
||||||
android:screenOrientation="portrait"/>
|
|
||||||
<!-- android:label="@string/title_activity_category_wise_performance" -->
|
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".gsk_dailyentry.DailyDataMenuActivity"
|
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
|
||||||
android:windowSoftInputMode="adjustPan"
|
|
||||||
android:screenOrientation="portrait"/>
|
|
||||||
<!-- android:label="@string/title_activity_daily_main_menu" -->
|
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".gsk_dailyentry.MSL_AvailabilityActivity"
|
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
|
||||||
android:windowSoftInputMode="adjustPan"
|
|
||||||
android:screenOrientation="portrait"/>
|
|
||||||
<!-- android:label="@string/title_activity_msl__availability" -->
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.StoreListActivity"
|
android:name=".dailyentry.StoreListActivity"
|
||||||
android:label="@string/title_activity_store_list_geotag"
|
android:label="@string/title_activity_store_list_geotag"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:screenOrientation="portrait"
|
||||||
android:screenOrientation="portrait"/>
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.StoreimageActivity"
|
android:name=".dailyentry.StoreimageActivity"
|
||||||
android:label="@string/title_activity_store_list_geotag"
|
android:label="@string/title_activity_store_list_geotag"
|
||||||
@@ -97,18 +77,50 @@
|
|||||||
android:name="com.google.android.gms.version"
|
android:name="com.google.android.gms.version"
|
||||||
android:value="@integer/google_play_services_version" />
|
android:value="@integer/google_play_services_version" />
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".gsk_dailyentry.Stock_FacingActivity"
|
|
||||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
|
||||||
android:windowSoftInputMode="adjustPan"
|
|
||||||
android:screenOrientation="portrait"/>
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".dailyentry.T2PComplianceActivity"
|
android:name=".dailyentry.T2PComplianceActivity"
|
||||||
android:label="@string/title_activity_t2_pcompliance"
|
android:label="@string/title_activity_t2_pcompliance"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"></activity>
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
|
|
||||||
|
<!--Gagan Start Declaration-->
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.CategoryListActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.CategoryWisePerformanceActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.DailyDataMenuActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.MSL_AvailabilityActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".gsk_dailyentry.Stock_FacingActivity"
|
||||||
|
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
|
||||||
|
<!--Gagan End Declaration-->
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -14,29 +14,24 @@ import java.util.List;
|
|||||||
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||||
import cpm.com.gskmtorange.GetterSetter.GeotaggingBeans;
|
import cpm.com.gskmtorange.GetterSetter.GeotaggingBeans;
|
||||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter;
|
|
||||||
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
|
||||||
|
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.CategoryGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.CategoryMasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by ashishc on 29-12-2016.
|
* Created by ashishc on 29-12-2016.
|
||||||
@@ -65,7 +60,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
db.execSQL(TableBean.getJourneyPlan());
|
db.execSQL(TableBean.getJourneyPlan());
|
||||||
|
|
||||||
//Gagan
|
//Gagan Start
|
||||||
db.execSQL(TableBean.getBrandMaster());
|
db.execSQL(TableBean.getBrandMaster());
|
||||||
db.execSQL(TableBean.getSkuMaster());
|
db.execSQL(TableBean.getSkuMaster());
|
||||||
db.execSQL(TableBean.getCategoryMaster());
|
db.execSQL(TableBean.getCategoryMaster());
|
||||||
@@ -74,20 +69,19 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
db.execSQL(TableBean.getMappingStock());
|
db.execSQL(TableBean.getMappingStock());
|
||||||
db.execSQL(TableBean.getMappingT2p());
|
db.execSQL(TableBean.getMappingT2p());
|
||||||
|
|
||||||
|
|
||||||
db.execSQL(CommonString.CREATE_TABLE_STORE_GEOTAGGING);
|
|
||||||
db.execSQL(CommonString.CREATE_TABLE_COVERAGE_DATA);
|
|
||||||
|
|
||||||
|
|
||||||
db.execSQL(TableBean.getDisplayChecklistMaster());
|
|
||||||
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_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);
|
||||||
|
|
||||||
|
//Gagan End
|
||||||
|
|
||||||
|
|
||||||
|
db.execSQL(CommonString.CREATE_TABLE_STORE_GEOTAGGING);
|
||||||
|
db.execSQL(CommonString.CREATE_TABLE_COVERAGE_DATA);
|
||||||
|
|
||||||
|
db.execSQL(TableBean.getDisplayChecklistMaster());
|
||||||
|
db.execSQL(TableBean.getMappingDisplayChecklist());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -150,17 +144,17 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<T2PGetterSetter> getT2PDefaultData(String store_id){
|
public ArrayList<T2PGetterSetter> getT2PDefaultData(String store_id) {
|
||||||
|
|
||||||
ArrayList<T2PGetterSetter> t2PList = new ArrayList<>();
|
ArrayList<T2PGetterSetter> t2PList = new ArrayList<>();
|
||||||
Cursor dbcursor = null;
|
Cursor dbcursor = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
dbcursor = db.rawQuery("Select BM.BRAND As BRAND, BM.BRAND_ID As BRAND_ID, DM.DISPLAY As DISPLAY, DM.DISPLAY_ID As DISPLAY_ID from BRAND_MASTER BM INNER JOIN MAPPING_T2P T ON BM.BRAND_ID = T.BRAND_ID INNER JOIN DISPLAY_MASTER DM ON T.DISPLAY_ID= DM.DISPLAY_ID WHERE T.STORE_ID = '"+ store_id +"'",null);
|
dbcursor = db.rawQuery("Select BM.BRAND As BRAND, BM.BRAND_ID As BRAND_ID, DM.DISPLAY As DISPLAY, DM.DISPLAY_ID As DISPLAY_ID from BRAND_MASTER BM INNER JOIN MAPPING_T2P T ON BM.BRAND_ID = T.BRAND_ID INNER JOIN DISPLAY_MASTER DM ON T.DISPLAY_ID= DM.DISPLAY_ID WHERE T.STORE_ID = '" + store_id + "'", null);
|
||||||
if(dbcursor != null){
|
if (dbcursor != null) {
|
||||||
dbcursor.moveToFirst();
|
dbcursor.moveToFirst();
|
||||||
while(!dbcursor.isAfterLast()){
|
while (!dbcursor.isAfterLast()) {
|
||||||
|
|
||||||
T2PGetterSetter t2p = new T2PGetterSetter();
|
T2PGetterSetter t2p = new T2PGetterSetter();
|
||||||
|
|
||||||
@@ -190,8 +184,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
dbcursor.close();
|
dbcursor.close();
|
||||||
return t2PList;
|
return t2PList;
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e){
|
|
||||||
|
|
||||||
Log.d("Exception get T2P", e.toString());
|
Log.d("Exception get T2P", e.toString());
|
||||||
return t2PList;
|
return t2PList;
|
||||||
@@ -201,17 +194,17 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//get Gaps data
|
//get Gaps data
|
||||||
public ArrayList<GapsChecklistGetterSetter> getGapsDefaultData(String display_id){
|
public ArrayList<GapsChecklistGetterSetter> getGapsDefaultData(String display_id) {
|
||||||
|
|
||||||
ArrayList<GapsChecklistGetterSetter> checkList = new ArrayList<>();
|
ArrayList<GapsChecklistGetterSetter> checkList = new ArrayList<>();
|
||||||
Cursor dbcursor = null;
|
Cursor dbcursor = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
dbcursor = db.rawQuery("Select DC.CHECKLIST_ID As CHECKLIST_ID, DC.CHECKLIST As CHECKLIST, C.DISPLAY_ID As DISPLAY_ID from MAPPING_DISPLAY_CHECKLIST C INNER JOIN DISPLAY_CHECKLIST_MASTER DC ON C.CHECKLIST_ID= DC.CHECKLIST_ID WHERE C.DISPLAY_ID = '"+ display_id +"'",null);
|
dbcursor = db.rawQuery("Select DC.CHECKLIST_ID As CHECKLIST_ID, DC.CHECKLIST As CHECKLIST, C.DISPLAY_ID As DISPLAY_ID from MAPPING_DISPLAY_CHECKLIST C INNER JOIN DISPLAY_CHECKLIST_MASTER DC ON C.CHECKLIST_ID= DC.CHECKLIST_ID WHERE C.DISPLAY_ID = '" + display_id + "'", null);
|
||||||
if(dbcursor != null){
|
if (dbcursor != null) {
|
||||||
dbcursor.moveToFirst();
|
dbcursor.moveToFirst();
|
||||||
while(!dbcursor.isAfterLast()){
|
while (!dbcursor.isAfterLast()) {
|
||||||
|
|
||||||
GapsChecklistGetterSetter check = new GapsChecklistGetterSetter();
|
GapsChecklistGetterSetter check = new GapsChecklistGetterSetter();
|
||||||
|
|
||||||
@@ -234,8 +227,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
dbcursor.close();
|
dbcursor.close();
|
||||||
return checkList;
|
return checkList;
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e){
|
|
||||||
|
|
||||||
Log.d("Exception get T2P", e.toString());
|
Log.d("Exception get T2P", e.toString());
|
||||||
return checkList;
|
return checkList;
|
||||||
@@ -245,17 +237,17 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//get Brand data for T2P
|
//get Brand data for T2P
|
||||||
public ArrayList<BrandMasterGetterSetter> getBrandT2PData(String store_type_id, String class_id, String key_account_id ){
|
public ArrayList<BrandMasterGetterSetter> getBrandT2PData(String store_type_id, String class_id, String key_account_id) {
|
||||||
|
|
||||||
ArrayList<BrandMasterGetterSetter> brandList = new ArrayList<>();
|
ArrayList<BrandMasterGetterSetter> brandList = new ArrayList<>();
|
||||||
Cursor dbcursor = null;
|
Cursor dbcursor = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
dbcursor = db.rawQuery("SELECT DISTINCT BR.BRAND_ID, SCM.SUB_CATEGORY||'-'||BR.BRAND AS BRAND FROM MAPPING_STOCK MS INNER JOIN SKU_MASTER SM ON MS.SKU_ID = SM.SKU_ID INNER JOIN BRAND_MASTER BR ON SM.BRAND_ID=BR.BRAND_ID INNER JOIN SUB_CATEGORY_MASTER SCM ON BR.SUB_CATEGORY_ID = SCM.SUB_CATEGORY_ID WHERE MS.KEYACCOUNT_ID ='"+key_account_id +"' AND STORETYPE_ID ='" + store_type_id + "' AND CLASS_ID = "+ class_id +"'",null);
|
dbcursor = db.rawQuery("SELECT DISTINCT BR.BRAND_ID, SCM.SUB_CATEGORY||'-'||BR.BRAND AS BRAND FROM MAPPING_STOCK MS INNER JOIN SKU_MASTER SM ON MS.SKU_ID = SM.SKU_ID INNER JOIN BRAND_MASTER BR ON SM.BRAND_ID=BR.BRAND_ID INNER JOIN SUB_CATEGORY_MASTER SCM ON BR.SUB_CATEGORY_ID = SCM.SUB_CATEGORY_ID WHERE MS.KEYACCOUNT_ID ='" + key_account_id + "' AND STORETYPE_ID ='" + store_type_id + "' AND CLASS_ID = " + class_id + "'", null);
|
||||||
if(dbcursor != null){
|
if (dbcursor != null) {
|
||||||
dbcursor.moveToFirst();
|
dbcursor.moveToFirst();
|
||||||
while(!dbcursor.isAfterLast()){
|
while (!dbcursor.isAfterLast()) {
|
||||||
|
|
||||||
BrandMasterGetterSetter brand = new BrandMasterGetterSetter();
|
BrandMasterGetterSetter brand = new BrandMasterGetterSetter();
|
||||||
|
|
||||||
@@ -274,8 +266,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
dbcursor.close();
|
dbcursor.close();
|
||||||
return brandList;
|
return brandList;
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e){
|
|
||||||
|
|
||||||
Log.d("Exception get T2P", e.toString());
|
Log.d("Exception get T2P", e.toString());
|
||||||
return brandList;
|
return brandList;
|
||||||
@@ -285,17 +276,17 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//get Sku data for T2P
|
//get Sku data for T2P
|
||||||
public ArrayList<SkuGetterSetter> getSkuT2PData(String store_type_id, String class_id, String key_account_id , String brand_id){
|
public ArrayList<SkuGetterSetter> getSkuT2PData(String store_type_id, String class_id, String key_account_id, String brand_id) {
|
||||||
|
|
||||||
ArrayList<SkuGetterSetter> skuList = new ArrayList<>();
|
ArrayList<SkuGetterSetter> skuList = new ArrayList<>();
|
||||||
Cursor dbcursor = null;
|
Cursor dbcursor = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
dbcursor = db.rawQuery("SELECT DISTINCT SM.SKU, SM.SKU_ID, BR.BRAND_ID FROM MAPPING_STOCK MS INNER JOIN SKU_MASTER SM ON MS.SKU_ID = SM.SKU_ID INNER JOIN BRAND_MASTER BR ON SM.BRAND_ID=BR.BRAND_ID INNER JOIN SUB_CATEGORY_MASTER SCM ON BR.SUB_CATEGORY_ID = SCM.SUB_CATEGORY_ID WHERE MS.KEYACCOUNT_ID ='"+key_account_id +"' AND STORETYPE_ID ='" + store_type_id + "' AND CLASS_ID = "+ class_id +"' AND SM.BRAND_ID='"+ brand_id + "'",null);
|
dbcursor = db.rawQuery("SELECT DISTINCT SM.SKU, SM.SKU_ID, BR.BRAND_ID FROM MAPPING_STOCK MS INNER JOIN SKU_MASTER SM ON MS.SKU_ID = SM.SKU_ID INNER JOIN BRAND_MASTER BR ON SM.BRAND_ID=BR.BRAND_ID INNER JOIN SUB_CATEGORY_MASTER SCM ON BR.SUB_CATEGORY_ID = SCM.SUB_CATEGORY_ID WHERE MS.KEYACCOUNT_ID ='" + key_account_id + "' AND STORETYPE_ID ='" + store_type_id + "' AND CLASS_ID = " + class_id + "' AND SM.BRAND_ID='" + brand_id + "'", null);
|
||||||
if(dbcursor != null){
|
if (dbcursor != null) {
|
||||||
dbcursor.moveToFirst();
|
dbcursor.moveToFirst();
|
||||||
while(!dbcursor.isAfterLast()){
|
while (!dbcursor.isAfterLast()) {
|
||||||
|
|
||||||
SkuGetterSetter sku = new SkuGetterSetter();
|
SkuGetterSetter sku = new SkuGetterSetter();
|
||||||
|
|
||||||
@@ -316,8 +307,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
dbcursor.close();
|
dbcursor.close();
|
||||||
return skuList;
|
return skuList;
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e){
|
|
||||||
|
|
||||||
Log.d("Exception get T2P", e.toString());
|
Log.d("Exception get T2P", e.toString());
|
||||||
return skuList;
|
return skuList;
|
||||||
@@ -402,45 +392,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Gagan Goel
|
|
||||||
public void InsertCategory(CategoryMasterGetterSetter data) {
|
|
||||||
db.delete("CATEGORY_MASTER", null, null);
|
|
||||||
|
|
||||||
ContentValues values = new ContentValues();
|
|
||||||
try {
|
|
||||||
for (int i = 0; i < data.getCATEGORY_ID().size(); i++) {
|
|
||||||
|
|
||||||
values.put("CATEGORY_ID", data.getCATEGORY_ID().get(i));
|
|
||||||
values.put("CATEGORY", data.getCATEGORY().get(i));
|
|
||||||
values.put("CATEGORY_SEQUENCE", data.getCATEGORY_SEQUENCE().get(i));
|
|
||||||
|
|
||||||
db.insert("CATEGORY_MASTER", null, values);
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Log.d("Exception ", " in CATEGORY_MASTER " + ex.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void InsertMappingStock(MappingStockGetterSetter data) {
|
|
||||||
db.delete("MAPPING_STOCK", null, null);
|
|
||||||
|
|
||||||
ContentValues values = new ContentValues();
|
|
||||||
try {
|
|
||||||
for (int i = 0; i < data.getKEYACCOUNT_ID().size(); i++) {
|
|
||||||
|
|
||||||
values.put("KEYACCOUNT_ID", data.getKEYACCOUNT_ID().get(i));
|
|
||||||
values.put("STORETYPE_ID", data.getSTORETYPE_ID().get(i));
|
|
||||||
values.put("CLASS_ID", data.getCLASS_ID().get(i));
|
|
||||||
values.put("SKU_ID", data.getSKU_ID().get(i));
|
|
||||||
values.put("MUST_HAVE", data.getMUST_HAVE().get(i));
|
|
||||||
values.put("MBQ", data.getMBQ().get(i));
|
|
||||||
|
|
||||||
db.insert("MAPPING_STOCK", null, values);
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Log.d("Exception ", " in MAPPING_STOCK " + ex.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//insert MAPPING_DISPLAY_CHECKLIST
|
//insert MAPPING_DISPLAY_CHECKLIST
|
||||||
public void InsertMappingDisplayChecklist(MappingDisplayChecklistGetterSetter data) {
|
public void InsertMappingDisplayChecklist(MappingDisplayChecklistGetterSetter data) {
|
||||||
@@ -460,64 +411,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InsertSubCategoryMaster(SubCategoryMasterGetterSetter data) {
|
|
||||||
db.delete("SUB_CATEGORY_MASTER", null, null);
|
|
||||||
|
|
||||||
ContentValues values = new ContentValues();
|
|
||||||
try {
|
|
||||||
for (int i = 0; i < data.getSUB_CATEGORY_ID().size(); i++) {
|
|
||||||
|
|
||||||
values.put("SUB_CATEGORY_ID", data.getSUB_CATEGORY_ID().get(i));
|
|
||||||
values.put("SUB_CATEGORY", data.getSUB_CATEGORY().get(i));
|
|
||||||
values.put("CATEGORY_ID", data.getCATEGORY_ID().get(i));
|
|
||||||
values.put("SUB_CATEGORY_SEQUENCE", data.getSUB_CATEGORY_SEQUENCE().get(i));
|
|
||||||
|
|
||||||
db.insert("SUB_CATEGORY_MASTER", null, values);
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Log.d("Exception ", " in MAPPING_STOCK " + ex.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void InsertBrandMaster(BrandMasterGetterSetter data) {
|
|
||||||
db.delete("BRAND_MASTER", null, null);
|
|
||||||
|
|
||||||
ContentValues values = new ContentValues();
|
|
||||||
try {
|
|
||||||
for (int i = 0; i < data.getBRAND_ID().size(); i++) {
|
|
||||||
|
|
||||||
values.put("BRAND_ID", data.getBRAND_ID().get(i));
|
|
||||||
values.put("BRAND", data.getBRAND().get(i));
|
|
||||||
values.put("SUB_CATEGORY_ID", data.getSUB_CATEGORY_ID().get(i));
|
|
||||||
values.put("COMPANY_ID", data.getCOMPANY_ID().get(i));
|
|
||||||
values.put("BRAND_SEQUENCE", data.getBRAND_SEQUENCE().get(i));
|
|
||||||
|
|
||||||
db.insert("BRAND_MASTER", null, values);
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Log.d("Exception ", " in BRAND_MASTER " + ex.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void InsertSkuMaster(SkuMasterGetterSetter data) {
|
|
||||||
db.delete("SKU_MASTER", null, null);
|
|
||||||
|
|
||||||
ContentValues values = new ContentValues();
|
|
||||||
try {
|
|
||||||
for (int i = 0; i < data.getSKU_ID().size(); i++) {
|
|
||||||
|
|
||||||
values.put("SKU_ID", data.getSKU_ID().get(i));
|
|
||||||
values.put("SKU", data.getSKU().get(i));
|
|
||||||
values.put("BRAND_ID", data.getBRAND_ID().get(i));
|
|
||||||
values.put("MRP", data.getMRP().get(i));
|
|
||||||
values.put("SKU_SEQUENCE", data.getSKU_SEQUENCE().get(i));
|
|
||||||
|
|
||||||
db.insert("SKU_MASTER", null, values);
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Log.d("Exception ", " in SKU_MASTER " + ex.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//insert DISPLAY_CHECKLIST_MASTER
|
//insert DISPLAY_CHECKLIST_MASTER
|
||||||
public void InsertDisplayChecklistMaster(DisplayChecklistMasterGetterSetter data) {
|
public void InsertDisplayChecklistMaster(DisplayChecklistMasterGetterSetter data) {
|
||||||
@@ -555,26 +448,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InsertMAPPING_T2P(MAPPINGT2PGetterSetter data) {
|
|
||||||
db.delete("MAPPING_T2P", null, null);
|
|
||||||
|
|
||||||
ContentValues values = new ContentValues();
|
public void InsertSTOREgeotag(String storeid, double lat, double longitude, String path, String status) {
|
||||||
try {
|
|
||||||
for (int i = 0; i < data.getSTORE_ID().size(); i++) {
|
|
||||||
|
|
||||||
values.put("STORE_ID", data.getSTORE_ID().get(i));
|
|
||||||
values.put("BRAND_ID", data.getBRAND_ID().get(i));
|
|
||||||
values.put("DISPLAY_ID", data.getDISPLAY_ID().get(i));
|
|
||||||
|
|
||||||
db.insert("MAPPING_T2P", null, values);
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Log.d("Exception ", " in MAPPING_T2P " + ex.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void InsertSTOREgeotag(String storeid, double lat, double longitude, String path,String status) {
|
|
||||||
|
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
|
|
||||||
@@ -612,8 +487,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void updateCheckoutStatus(String id, String status) {
|
public void updateCheckoutStatus(String id, String status) {
|
||||||
|
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
@@ -664,8 +537,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
if (dbcursor != null && !dbcursor.isClosed()) {
|
if (dbcursor != null && !dbcursor.isClosed()) {
|
||||||
dbcursor.close();
|
dbcursor.close();
|
||||||
}
|
}
|
||||||
@@ -677,7 +549,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void updateGeoTagData(String storeid,String status) {
|
public void updateGeoTagData(String storeid, String status) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -685,7 +557,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
values.put("GEO_TAG", status);
|
values.put("GEO_TAG", status);
|
||||||
|
|
||||||
int l = db.update(CommonString.TABLE_STORE_GEOTAGGING, values,
|
int l = db.update(CommonString.TABLE_STORE_GEOTAGGING, values,
|
||||||
CommonString.KEY_STORE_ID + "=?", new String[] { storeid });
|
CommonString.KEY_STORE_ID + "=?", new String[]{storeid});
|
||||||
System.out.println("update : " + l);
|
System.out.println("update : " + l);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.d("Database Data ", e.toString());
|
Log.d("Database Data ", e.toString());
|
||||||
@@ -693,7 +565,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateDataStatus(String id,String status) {
|
public void updateDataStatus(String id, String status) {
|
||||||
|
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
|
|
||||||
@@ -762,17 +634,176 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
.getColumnIndexOrThrow(CommonString.KEY_REASON_ID))))));
|
.getColumnIndexOrThrow(CommonString.KEY_REASON_ID))))));
|
||||||
sb.setMID(Integer.parseInt(((dbcursor.getString(dbcursor
|
sb.setMID(Integer.parseInt(((dbcursor.getString(dbcursor
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_ID))))));
|
.getColumnIndexOrThrow(CommonString.KEY_ID))))));
|
||||||
if(dbcursor.getString(dbcursor
|
if (dbcursor.getString(dbcursor
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_COVERAGE_REMARK))==null){
|
.getColumnIndexOrThrow(CommonString.KEY_COVERAGE_REMARK)) == null) {
|
||||||
sb.setRemark("");
|
sb.setRemark("");
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
sb.setRemark((((dbcursor.getString(dbcursor
|
sb.setRemark((((dbcursor.getString(dbcursor
|
||||||
.getColumnIndexOrThrow(CommonString.KEY_COVERAGE_REMARK))))));
|
.getColumnIndexOrThrow(CommonString.KEY_COVERAGE_REMARK))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
list.add(sb);
|
list.add(sb);
|
||||||
|
dbcursor.moveToNext();
|
||||||
|
}
|
||||||
|
dbcursor.close();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.d("Exception get JCP!", e.toString());
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long InsertCoverageData(CoverageBean data) {
|
||||||
|
|
||||||
|
//db.delete(CommonString1.TABLE_COVERAGE_DATA, "STORE_ID" + "='" + data.getStoreId() + "'", null);
|
||||||
|
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
values.put(CommonString.KEY_STORE_ID, data.getStoreId());
|
||||||
|
values.put(CommonString.KEY_USER_ID, data.getUserId());
|
||||||
|
values.put(CommonString.KEY_IN_TIME, data.getInTime());
|
||||||
|
values.put(CommonString.KEY_OUT_TIME, data.getOutTime());
|
||||||
|
values.put(CommonString.KEY_VISIT_DATE, data.getVisitDate());
|
||||||
|
values.put(CommonString.KEY_LATITUDE, data.getLatitude());
|
||||||
|
values.put(CommonString.KEY_LONGITUDE, data.getLongitude());
|
||||||
|
values.put(CommonString.KEY_REASON_ID, data.getReasonid());
|
||||||
|
values.put(CommonString.KEY_REASON, data.getReason());
|
||||||
|
values.put(CommonString.KEY_COVERAGE_STATUS, data.getStatus());
|
||||||
|
values.put(CommonString.KEY_IMAGE, data.getImage());
|
||||||
|
values.put(CommonString.KEY_COVERAGE_REMARK, data.getRemark());
|
||||||
|
values.put(CommonString.KEY_REASON_ID, data.getReasonid());
|
||||||
|
values.put(CommonString.KEY_REASON, data.getReason());
|
||||||
|
values.put(CommonString.KEY_GEO_TAG, data.getGEO_TAG());
|
||||||
|
|
||||||
|
return db.insert(CommonString.TABLE_COVERAGE_DATA, null, values);
|
||||||
|
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Log.d("Database Exception ", ex.toString());
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Gagan Start Method
|
||||||
|
|
||||||
|
public void InsertCategory(CategoryMasterGetterSetter data) {
|
||||||
|
db.delete("CATEGORY_MASTER", null, null);
|
||||||
|
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
try {
|
||||||
|
for (int i = 0; i < data.getCATEGORY_ID().size(); i++) {
|
||||||
|
|
||||||
|
values.put("CATEGORY_ID", data.getCATEGORY_ID().get(i));
|
||||||
|
values.put("CATEGORY", data.getCATEGORY().get(i));
|
||||||
|
values.put("CATEGORY_SEQUENCE", data.getCATEGORY_SEQUENCE().get(i));
|
||||||
|
|
||||||
|
db.insert("CATEGORY_MASTER", null, values);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Log.d("Exception ", " in CATEGORY_MASTER " + ex.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InsertSubCategoryMaster(SubCategoryMasterGetterSetter data) {
|
||||||
|
db.delete("SUB_CATEGORY_MASTER", null, null);
|
||||||
|
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
try {
|
||||||
|
for (int i = 0; i < data.getSUB_CATEGORY_ID().size(); i++) {
|
||||||
|
|
||||||
|
values.put("SUB_CATEGORY_ID", data.getSUB_CATEGORY_ID().get(i));
|
||||||
|
values.put("SUB_CATEGORY", data.getSUB_CATEGORY().get(i));
|
||||||
|
values.put("CATEGORY_ID", data.getCATEGORY_ID().get(i));
|
||||||
|
values.put("SUB_CATEGORY_SEQUENCE", data.getSUB_CATEGORY_SEQUENCE().get(i));
|
||||||
|
|
||||||
|
db.insert("SUB_CATEGORY_MASTER", null, values);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Log.d("Exception ", " in MAPPING_STOCK " + ex.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InsertBrandMaster(BrandMasterGetterSetter data) {
|
||||||
|
db.delete("BRAND_MASTER", null, null);
|
||||||
|
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
try {
|
||||||
|
for (int i = 0; i < data.getBRAND_ID().size(); i++) {
|
||||||
|
|
||||||
|
values.put("BRAND_ID", data.getBRAND_ID().get(i));
|
||||||
|
values.put("BRAND", data.getBRAND().get(i));
|
||||||
|
values.put("SUB_CATEGORY_ID", data.getSUB_CATEGORY_ID().get(i));
|
||||||
|
values.put("COMPANY_ID", data.getCOMPANY_ID().get(i));
|
||||||
|
values.put("BRAND_SEQUENCE", data.getBRAND_SEQUENCE().get(i));
|
||||||
|
|
||||||
|
db.insert("BRAND_MASTER", null, values);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Log.d("Exception ", " in BRAND_MASTER " + ex.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InsertSkuMaster(SkuMasterGetterSetter data) {
|
||||||
|
db.delete("SKU_MASTER", null, null);
|
||||||
|
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
try {
|
||||||
|
for (int i = 0; i < data.getSKU_ID().size(); i++) {
|
||||||
|
|
||||||
|
values.put("SKU_ID", data.getSKU_ID().get(i));
|
||||||
|
values.put("SKU", data.getSKU().get(i));
|
||||||
|
values.put("BRAND_ID", data.getBRAND_ID().get(i));
|
||||||
|
values.put("MRP", data.getMRP().get(i));
|
||||||
|
values.put("SKU_SEQUENCE", data.getSKU_SEQUENCE().get(i));
|
||||||
|
|
||||||
|
db.insert("SKU_MASTER", null, values);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Log.d("Exception ", " in SKU_MASTER " + ex.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InsertMappingStock(MappingStockGetterSetter data) {
|
||||||
|
db.delete("MAPPING_STOCK", null, null);
|
||||||
|
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
try {
|
||||||
|
for (int i = 0; i < data.getKEYACCOUNT_ID().size(); i++) {
|
||||||
|
|
||||||
|
values.put("KEYACCOUNT_ID", data.getKEYACCOUNT_ID().get(i));
|
||||||
|
values.put("STORETYPE_ID", data.getSTORETYPE_ID().get(i));
|
||||||
|
values.put("CLASS_ID", data.getCLASS_ID().get(i));
|
||||||
|
values.put("SKU_ID", data.getSKU_ID().get(i));
|
||||||
|
values.put("MUST_HAVE", data.getMUST_HAVE().get(i));
|
||||||
|
values.put("MBQ", data.getMBQ().get(i));
|
||||||
|
|
||||||
|
db.insert("MAPPING_STOCK", null, values);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Log.d("Exception ", " in MAPPING_STOCK " + ex.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InsertMAPPING_T2P(MAPPINGT2PGetterSetter data) {
|
||||||
|
db.delete("MAPPING_T2P", null, null);
|
||||||
|
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
try {
|
||||||
|
for (int i = 0; i < data.getSTORE_ID().size(); i++) {
|
||||||
|
|
||||||
|
values.put("STORE_ID", data.getSTORE_ID().get(i));
|
||||||
|
values.put("BRAND_ID", data.getBRAND_ID().get(i));
|
||||||
|
values.put("DISPLAY_ID", data.getDISPLAY_ID().get(i));
|
||||||
|
|
||||||
|
db.insert("MAPPING_T2P", null, values);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Log.d("Exception ", " in MAPPING_T2P " + ex.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Category List
|
//Category List
|
||||||
public ArrayList<CategoryGetterSetter> getCategoryListData(String keyAccountId, String storeTypeId, String classId) {
|
public ArrayList<CategoryGetterSetter> getCategoryListData(String keyAccountId, String storeTypeId, String classId) {
|
||||||
@@ -1225,39 +1256,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long InsertCoverageData(CoverageBean data) {
|
|
||||||
|
|
||||||
//db.delete(CommonString1.TABLE_COVERAGE_DATA, "STORE_ID" + "='" + data.getStoreId() + "'", null);
|
|
||||||
|
|
||||||
ContentValues values = new ContentValues();
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
values.put(CommonString.KEY_STORE_ID, data.getStoreId());
|
|
||||||
values.put(CommonString.KEY_USER_ID, data.getUserId());
|
|
||||||
values.put(CommonString.KEY_IN_TIME, data.getInTime());
|
|
||||||
values.put(CommonString.KEY_OUT_TIME, data.getOutTime());
|
|
||||||
values.put(CommonString.KEY_VISIT_DATE, data.getVisitDate());
|
|
||||||
values.put(CommonString.KEY_LATITUDE, data.getLatitude());
|
|
||||||
values.put(CommonString.KEY_LONGITUDE, data.getLongitude());
|
|
||||||
values.put(CommonString.KEY_REASON_ID, data.getReasonid());
|
|
||||||
values.put(CommonString.KEY_REASON, data.getReason());
|
|
||||||
values.put(CommonString.KEY_COVERAGE_STATUS, data.getStatus());
|
|
||||||
values.put(CommonString.KEY_IMAGE, data.getImage());
|
|
||||||
values.put(CommonString.KEY_COVERAGE_REMARK, data.getRemark());
|
|
||||||
values.put(CommonString.KEY_REASON_ID, data.getReasonid());
|
|
||||||
values.put(CommonString.KEY_REASON, data.getReason());
|
|
||||||
values.put(CommonString.KEY_GEO_TAG, data.getGEO_TAG());
|
|
||||||
|
|
||||||
return db.insert(CommonString.TABLE_COVERAGE_DATA, null, values);
|
|
||||||
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Log.d("Database Exception ", ex.toString());
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public boolean checkStockAndFacingData(String store_id, String category_id) {
|
public boolean checkStockAndFacingData(String store_id, String category_id) {
|
||||||
Log.d("Stock_Facing ", "Stock data--------------->Start<------------");
|
Log.d("Stock_Facing ", "Stock data--------------->Start<------------");
|
||||||
@@ -1330,4 +1328,5 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Gagan End Method
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import java.util.Locale;
|
|||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
||||||
|
|
||||||
public class SelectLanguageActivity extends AppCompatActivity implements View.OnClickListener{
|
public class SelectLanguageActivity extends AppCompatActivity implements View.OnClickListener {
|
||||||
|
|
||||||
Button btn_lang_1, btn_lang_2;
|
Button btn_lang_1, btn_lang_2;
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
|||||||
language = login_data.getCULTURE_NAME();
|
language = login_data.getCULTURE_NAME();
|
||||||
culture_id = login_data.getCULTURE_ID();
|
culture_id = login_data.getCULTURE_ID();
|
||||||
|
|
||||||
if(language.size()>1){
|
if (language.size() > 1) {
|
||||||
|
|
||||||
btn_lang_1.setText(language.get(0));
|
btn_lang_1.setText(language.get(0));
|
||||||
btn_lang_2.setText(language.get(1));
|
btn_lang_2.setText(language.get(1));
|
||||||
@@ -61,20 +61,18 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||||
fab.setOnClickListener(new View.OnClickListener() {
|
fab.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
if(selected_flag){
|
if (selected_flag) {
|
||||||
Intent intent = new Intent(getBaseContext(),
|
Intent intent = new Intent(getBaseContext(),
|
||||||
MainActivity.class);
|
MainActivity.class);
|
||||||
|
|
||||||
intent.putExtra(CommonString.KEY_LOGIN_DATA, login_data);
|
intent.putExtra(CommonString.KEY_LOGIN_DATA, login_data);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||||
.setAction("Action", null).show();
|
.setAction("Action", null).show();
|
||||||
}
|
}
|
||||||
@@ -84,16 +82,14 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
int id = view.getId();
|
int id = view.getId();
|
||||||
|
|
||||||
switch (id){
|
switch (id) {
|
||||||
|
|
||||||
case R.id.btn_language_one:
|
case R.id.btn_language_one:
|
||||||
|
|
||||||
selected_flag = true;
|
selected_flag = true;
|
||||||
|
|
||||||
updateResources(getApplicationContext(),language.get(0));
|
updateResources(getApplicationContext(), language.get(0));
|
||||||
|
|
||||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
@@ -109,7 +105,7 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
|||||||
|
|
||||||
selected_flag = true;
|
selected_flag = true;
|
||||||
|
|
||||||
updateResources(getApplicationContext(),language.get(1));
|
updateResources(getApplicationContext(), language.get(1));
|
||||||
|
|
||||||
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
btn_lang_1.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
btn_lang_2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
@@ -124,16 +120,13 @@ public class SelectLanguageActivity extends AppCompatActivity implements View.On
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
private static boolean updateResources(Context context, String language) {
|
||||||
|
String lang;
|
||||||
|
|
||||||
String lang ;
|
if (language.equalsIgnoreCase("English")) {
|
||||||
|
|
||||||
if(language.equals("English")){
|
|
||||||
lang = "EN";
|
lang = "EN";
|
||||||
}
|
} else if (language.equalsIgnoreCase("UAE")) {
|
||||||
else if(language.equals("UAE")) {
|
|
||||||
lang = "AR";
|
lang = "AR";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
lang = "TR";
|
lang = "TR";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ public class CommonString {
|
|||||||
public static final String KEY_PASSWORD = "password";
|
public static final String KEY_PASSWORD = "password";
|
||||||
public static final String KEY_DATE = "date";
|
public static final String KEY_DATE = "date";
|
||||||
public static final String KEY_STOREVISITED_STATUS = "STOREVISITED_STATUS";
|
public static final String KEY_STOREVISITED_STATUS = "STOREVISITED_STATUS";
|
||||||
public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/GSK_MT_Images/";
|
|
||||||
|
|
||||||
public static final String KEY_PATH = "path";
|
public static final String KEY_PATH = "path";
|
||||||
public static final String KEY_VERSION = "APP_VERSION";
|
public static final String KEY_VERSION = "APP_VERSION";
|
||||||
@@ -156,6 +155,8 @@ public class CommonString {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Gagan Code Start
|
||||||
|
|
||||||
//File Path
|
//File Path
|
||||||
public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/GSK_MT_ORANGE_IMAGES/";
|
public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/GSK_MT_ORANGE_IMAGES/";
|
||||||
|
|
||||||
@@ -270,4 +271,5 @@ public class CommonString {
|
|||||||
|
|
||||||
+ ")";
|
+ ")";
|
||||||
|
|
||||||
|
//Gagan Code End
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package cpm.com.gskmtorange.gettersetter;
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
public class CoverageBean
|
public class CoverageBean
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package cpm.com.gskmtorange.gettersetter;
|
package cpm.com.gskmtorange.GetterSetter;
|
||||||
|
|
||||||
public class GeotaggingBeans {
|
public class GeotaggingBeans {
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@
|
|||||||
<string name="title_store_list_activity_store_closed">Store Closed</string>
|
<string name="title_store_list_activity_store_closed">Store Closed</string>
|
||||||
|
|
||||||
|
|
||||||
<string name="save">SAVE</string>
|
|
||||||
|
|
||||||
<string name="title_store_list_checkout_current">Please checkout from current store</string>
|
<string name="title_store_list_checkout_current">Please checkout from current store</string>
|
||||||
<string name="title_store_list_checkout_Already_filled">Data already filled</string>
|
<string name="title_store_list_checkout_Already_filled">Data already filled</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user