Merge pull request #20 from CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/Category_G
Category g
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,22 @@ 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 * FROM(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 +"') As Brand",null);
|
dbcursor = db.rawQuery("SELECT * FROM(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 +"') As Brand",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 +271,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 +281,18 @@ 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 +313,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 +398,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 +417,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 +454,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 +493,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 +543,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 +555,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void updateGeoTagData(String storeid,String status) {
|
public void updateGeoTagData(String storeid, String status) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -685,7 +563,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 +571,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 +640,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) {
|
||||||
@@ -1226,39 +1263,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<------------");
|
||||||
ArrayList<Stock_FacingGetterSetter> list = new ArrayList<>();
|
ArrayList<Stock_FacingGetterSetter> list = new ArrayList<>();
|
||||||
@@ -1330,4 +1334,5 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Gagan End Method
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
|
||||||
} else if (id == R.id.nav_setting) {
|
} else if (id == R.id.nav_setting) {
|
||||||
startActivity(new Intent(MainActivity.this, CategoryListActivity.class));
|
//startActivity(new Intent(MainActivity.this, CategoryListActivity.class));
|
||||||
} else if (id == R.id.nav_export) {
|
} else if (id == R.id.nav_export) {
|
||||||
|
|
||||||
AlertDialog.Builder builder1 = new AlertDialog.Builder(MainActivity.this);
|
AlertDialog.Builder builder1 = new AlertDialog.Builder(MainActivity.this);
|
||||||
|
|||||||
@@ -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,15 @@ 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.equalsIgnoreCase("English")){
|
||||||
lang = "EN";
|
lang = "EN";
|
||||||
}
|
}
|
||||||
else if(language.equalsIgnoreCase("UAE")) {
|
else if(language.equalsIgnoreCase("UAE")) {
|
||||||
|
|
||||||
lang = "AR";
|
lang = "AR";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
lang = "TR";
|
lang = "TR";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,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";
|
||||||
@@ -155,6 +154,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/";
|
||||||
|
|
||||||
@@ -269,4 +270,5 @@ public class CommonString {
|
|||||||
|
|
||||||
+ ")";
|
+ ")";
|
||||||
|
|
||||||
|
//Gagan Code End
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import android.view.View;
|
|||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.google.android.gms.common.ConnectionResult;
|
import com.google.android.gms.common.ConnectionResult;
|
||||||
import com.google.android.gms.common.api.GoogleApiClient;
|
import com.google.android.gms.common.api.GoogleApiClient;
|
||||||
import com.google.android.gms.location.LocationServices;
|
import com.google.android.gms.location.LocationServices;
|
||||||
@@ -37,36 +38,35 @@ import cpm.com.gskmtorange.R;
|
|||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||||
|
import cpm.com.gskmtorange.gsk_dailyentry.CategoryListActivity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by ashishc on 31-05-2016.
|
* Created by ashishc on 31-05-2016.
|
||||||
*/
|
*/
|
||||||
public class StoreimageActivity extends AppCompatActivity implements View.OnClickListener,GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
|
public class StoreimageActivity extends AppCompatActivity implements View.OnClickListener,
|
||||||
|
GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
|
||||||
|
|
||||||
|
ImageView img_cam, img_clicked;
|
||||||
ImageView img_cam,img_clicked;
|
|
||||||
Button btn_save;
|
Button btn_save;
|
||||||
|
|
||||||
String _pathforcheck,_path,str;
|
String _pathforcheck, _path, str;
|
||||||
|
|
||||||
String store_id,visit_date,username,intime,date;
|
String store_id, visit_date, username, intime, date;
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
AlertDialog alert;
|
AlertDialog alert;
|
||||||
String img_str;
|
String img_str;
|
||||||
private GSKOrangeDB database;
|
private GSKOrangeDB database;
|
||||||
|
|
||||||
String lat,lon;
|
String lat, lon;
|
||||||
GoogleApiClient mGoogleApiClient;
|
GoogleApiClient mGoogleApiClient;
|
||||||
ArrayList<CoverageBean> coverage_list;
|
ArrayList<CoverageBean> coverage_list;
|
||||||
|
|
||||||
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_storeimage);
|
setContentView(R.layout.activity_storeimage);
|
||||||
|
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
|
||||||
getSupportActionBar().setHomeButtonEnabled(true);
|
getSupportActionBar().setHomeButtonEnabled(true);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
@@ -90,8 +90,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
database = new GSKOrangeDB(this);
|
database = new GSKOrangeDB(this);
|
||||||
database.open();
|
database.open();
|
||||||
|
|
||||||
|
coverage_list = database.getCoverageData(date);
|
||||||
coverage_list = database.getCoverageData(date);
|
|
||||||
|
|
||||||
img_cam.setOnClickListener(this);
|
img_cam.setOnClickListener(this);
|
||||||
img_clicked.setOnClickListener(this);
|
img_clicked.setOnClickListener(this);
|
||||||
@@ -106,13 +105,11 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Build.VERSION.SDK_INT >= 23 &&
|
if (Build.VERSION.SDK_INT >= 23 &&
|
||||||
ContextCompat.checkSelfPermission(getApplicationContext(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
|
ContextCompat.checkSelfPermission(getApplicationContext(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
|
||||||
ContextCompat.checkSelfPermission(getApplicationContext(), android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
ContextCompat.checkSelfPermission(getApplicationContext(), android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -122,13 +119,10 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
// as you specify a parent activity in AndroidManifest.xml.
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
if(id==android.R.id.home){
|
if (id == android.R.id.home) {
|
||||||
|
|
||||||
// NavUtils.navigateUpFromSameTask(this);
|
// NavUtils.navigateUpFromSameTask(this);
|
||||||
finish();
|
finish();
|
||||||
|
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
@@ -136,12 +130,10 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
/*Intent i = new Intent(this, DailyEntryScreen.class);
|
/*Intent i = new Intent(this, DailyEntryScreen.class);
|
||||||
startActivity(i);*/
|
startActivity(i);*/
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
|
|
||||||
|
|
||||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,12 +142,12 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
|
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
|
|
||||||
switch (id){
|
switch (id) {
|
||||||
|
|
||||||
case R.id.img_cam_selfie:
|
case R.id.img_cam_selfie:
|
||||||
|
|
||||||
_pathforcheck = store_id + "Store"
|
_pathforcheck = store_id + "Store"
|
||||||
+ "Image" + visit_date.replace("/","") + getCurrentTime().replace(":","")+".jpg";
|
+ "Image" + visit_date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
||||||
|
|
||||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||||
|
|
||||||
@@ -167,41 +159,34 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
|
|
||||||
case R.id.btn_save_selfie:
|
case R.id.btn_save_selfie:
|
||||||
|
|
||||||
if (img_str !=null) {
|
if (img_str != null) {
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(
|
AlertDialog.Builder builder = new AlertDialog.Builder(StoreimageActivity.this);
|
||||||
StoreimageActivity.this);
|
|
||||||
builder.setMessage("Do you want to save the data ")
|
builder.setMessage("Do you want to save the data ")
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.setPositiveButton("OK",
|
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||||
new DialogInterface.OnClickListener() {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
public void onClick(
|
|
||||||
DialogInterface dialog,
|
|
||||||
int id) {
|
|
||||||
|
|
||||||
alert.getButton(
|
alert.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
|
||||||
AlertDialog.BUTTON_POSITIVE)
|
|
||||||
.setEnabled(false);
|
|
||||||
|
|
||||||
String status ="INVALID";
|
String status = "INVALID";
|
||||||
|
|
||||||
|
CoverageBean cdata = new CoverageBean();
|
||||||
|
cdata.setStoreId(store_id);
|
||||||
|
cdata.setVisitDate(visit_date);
|
||||||
|
cdata.setUserId(username);
|
||||||
|
cdata.setInTime(intime);
|
||||||
|
cdata.setReason("");
|
||||||
|
cdata.setReasonid("0");
|
||||||
|
cdata.setLatitude(lat);
|
||||||
|
cdata.setLongitude(lon);
|
||||||
|
cdata.setImage(img_str);
|
||||||
|
cdata.setRemark("");
|
||||||
|
cdata.setStatus(CommonString.KEY_CHECK_IN);
|
||||||
|
|
||||||
CoverageBean cdata = new CoverageBean();
|
database.InsertCoverageData(cdata);
|
||||||
cdata.setStoreId(store_id);
|
|
||||||
cdata.setVisitDate(visit_date);
|
|
||||||
cdata.setUserId(username);
|
|
||||||
cdata.setInTime(intime);
|
|
||||||
cdata.setReason("");
|
|
||||||
cdata.setReasonid("0");
|
|
||||||
cdata.setLatitude(lat);
|
|
||||||
cdata.setLongitude(lon);
|
|
||||||
cdata.setImage(img_str);
|
|
||||||
cdata.setRemark("");
|
|
||||||
cdata.setStatus(CommonString.KEY_CHECK_IN);
|
|
||||||
|
|
||||||
database.InsertCoverageData(cdata);
|
database.updateCheckoutStatus(store_id, status);
|
||||||
|
|
||||||
database.updateCheckoutStatus(store_id, status);
|
|
||||||
|
|
||||||
/* SharedPreferences.Editor editor = preferences.edit();
|
/* SharedPreferences.Editor editor = preferences.edit();
|
||||||
|
|
||||||
@@ -211,41 +196,28 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
editor.commit();*/
|
editor.commit();*/
|
||||||
|
|
||||||
|
|
||||||
/* Intent in=new Intent(StoreimageActivity.this,StoreEntry.class);
|
Intent in = new Intent(StoreimageActivity.this, CategoryListActivity.class);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
})
|
||||||
finish();*/
|
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
|
||||||
}
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
})
|
dialog.cancel();
|
||||||
.setNegativeButton("Cancel",
|
}
|
||||||
new DialogInterface.OnClickListener() {
|
});
|
||||||
public void onClick(
|
|
||||||
DialogInterface dialog,
|
|
||||||
int id) {
|
|
||||||
dialog.cancel();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
alert = builder.create();
|
alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(getApplicationContext(), "Please click the image", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
Toast.makeText(getApplicationContext(),
|
|
||||||
"Please click the image", Toast.LENGTH_SHORT).show();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void startCameraActivity() {
|
protected void startCameraActivity() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
/*Log.i("MakeMachine", "startCameraActivity()");
|
/*Log.i("MakeMachine", "startCameraActivity()");
|
||||||
File file = new File(_path);
|
File file = new File(_path);
|
||||||
@@ -261,10 +233,10 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
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);
|
||||||
@@ -281,38 +253,30 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||||
intent.setPackage(defaultCameraPackage);
|
intent.setPackage(defaultCameraPackage);
|
||||||
startActivityForResult(intent, 0);
|
startActivityForResult(intent, 0);
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
|
||||||
Log.i("MakeMachine", "resultCode: " + resultCode);
|
Log.i("MakeMachine", "resultCode: " + resultCode);
|
||||||
switch (resultCode) {
|
switch (resultCode) {
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
Log.i("MakeMachine", "User cancelled");
|
Log.i("MakeMachine", "User cancelled");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case -1:
|
case -1:
|
||||||
|
|
||||||
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);
|
||||||
@@ -320,21 +284,14 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
|
|
||||||
img_str = _pathforcheck;
|
img_str = _pathforcheck;
|
||||||
_pathforcheck = "";
|
_pathforcheck = "";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getCurrentTime() {
|
public String getCurrentTime() {
|
||||||
|
|
||||||
Calendar m_cal = Calendar.getInstance();
|
Calendar m_cal = Calendar.getInstance();
|
||||||
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss:mmm");
|
||||||
@@ -344,18 +301,15 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
+ m_cal.get(Calendar.MINUTE) + ":" + m_cal.get(Calendar.SECOND);*/
|
+ m_cal.get(Calendar.MINUTE) + ":" + m_cal.get(Calendar.SECOND);*/
|
||||||
|
|
||||||
return cdate;
|
return cdate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConnected(Bundle bundle) {
|
public void onConnected(Bundle bundle) {
|
||||||
|
|
||||||
Location mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
|
Location mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
|
||||||
if (mLastLocation != null) {
|
if (mLastLocation != null) {
|
||||||
lat = String.valueOf(mLastLocation.getLatitude());
|
lat = String.valueOf(mLastLocation.getLatitude());
|
||||||
lon = String.valueOf(mLastLocation.getLongitude());
|
lon = String.valueOf(mLastLocation.getLongitude());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -378,4 +332,4 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
|||||||
super.onStop();
|
super.onStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|
||||||
|
|||||||
+28
-2
@@ -2,7 +2,9 @@ package cpm.com.gskmtorange.gsk_dailyentry;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.support.design.widget.FloatingActionButton;
|
import android.support.design.widget.FloatingActionButton;
|
||||||
import android.support.design.widget.Snackbar;
|
import android.support.design.widget.Snackbar;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
@@ -24,6 +26,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.CategoryGetterSetter;
|
||||||
|
|
||||||
public class CategoryListActivity extends AppCompatActivity {
|
public class CategoryListActivity extends AppCompatActivity {
|
||||||
@@ -35,6 +38,9 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
|
|
||||||
|
private SharedPreferences preferences;
|
||||||
|
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -48,6 +54,17 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
db = new GSKOrangeDB(this);
|
db = new GSKOrangeDB(this);
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||||
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
|
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||||
|
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||||
|
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||||
|
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||||
|
|
||||||
|
|
||||||
txt_categoryName = (TextView) findViewById(R.id.txt_categoryName);
|
txt_categoryName = (TextView) findViewById(R.id.txt_categoryName);
|
||||||
//txt_categoryName.setText("Category List");
|
//txt_categoryName.setText("Category List");
|
||||||
txt_categoryName.setText(getResources().getString(R.string.title_activity_category_list));
|
txt_categoryName.setText(getResources().getString(R.string.title_activity_category_list));
|
||||||
@@ -69,7 +86,7 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
||||||
categoryList = new ArrayList<>();
|
categoryList = new ArrayList<>();
|
||||||
|
|
||||||
categoryList = db.getCategoryListData("1", "1", "1");
|
categoryList = db.getCategoryListData(keyAccount_id, storeType_id, class_id);
|
||||||
|
|
||||||
adapter = new CategoryListAdapter(CategoryListActivity.this, categoryList);
|
adapter = new CategoryListAdapter(CategoryListActivity.this, categoryList);
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
@@ -99,7 +116,16 @@ public class CategoryListActivity extends AppCompatActivity {
|
|||||||
final CategoryGetterSetter categoryData = list.get(position);
|
final CategoryGetterSetter categoryData = list.get(position);
|
||||||
|
|
||||||
holder.categoryName.setText(categoryData.getCategory());
|
holder.categoryName.setText(categoryData.getCategory());
|
||||||
holder.categoryIcon.setImageResource(R.drawable.category);
|
//holder.categoryIcon.setImageResource(R.drawable.category);
|
||||||
|
|
||||||
|
if (categoryData.getCategory().equalsIgnoreCase("Oral Health")) {
|
||||||
|
holder.categoryIcon.setImageResource(R.drawable.ohc);
|
||||||
|
} else if (categoryData.getCategory().equalsIgnoreCase("Wellness")) {
|
||||||
|
holder.categoryIcon.setImageResource(R.drawable.pdr);
|
||||||
|
} else if (categoryData.getCategory().equalsIgnoreCase("Nutritionals")) {
|
||||||
|
holder.categoryIcon.setImageResource(R.drawable.hfd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
holder.lay_menu.setOnClickListener(new View.OnClickListener() {
|
holder.lay_menu.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+25
-7
@@ -3,8 +3,10 @@ package cpm.com.gskmtorange.gsk_dailyentry;
|
|||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.support.design.widget.FloatingActionButton;
|
import android.support.design.widget.FloatingActionButton;
|
||||||
import android.support.design.widget.Snackbar;
|
import android.support.design.widget.Snackbar;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
@@ -34,6 +36,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
||||||
|
|
||||||
public class MSL_AvailabilityActivity extends AppCompatActivity {
|
public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||||
@@ -51,6 +54,9 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
String categoryName, categoryId, storeId;
|
String categoryName, categoryId, storeId;
|
||||||
|
|
||||||
|
private SharedPreferences preferences;
|
||||||
|
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -61,15 +67,27 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
|||||||
getSupportActionBar().setHomeButtonEnabled(true);
|
getSupportActionBar().setHomeButtonEnabled(true);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
db = new GSKOrangeDB(this);
|
|
||||||
db.open();
|
|
||||||
|
|
||||||
expandableListView = (ExpandableListView) findViewById(R.id.expandableListView);
|
expandableListView = (ExpandableListView) findViewById(R.id.expandableListView);
|
||||||
txt_mslAvailabilityName = (TextView) findViewById(R.id.txt_mslAvailabilityName);
|
txt_mslAvailabilityName = (TextView) findViewById(R.id.txt_mslAvailabilityName);
|
||||||
|
|
||||||
|
db = new GSKOrangeDB(this);
|
||||||
|
db.open();
|
||||||
|
|
||||||
|
//preference data
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||||
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
|
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||||
|
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||||
|
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||||
|
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||||
|
|
||||||
|
//Intent data
|
||||||
categoryName = getIntent().getStringExtra("categoryName");
|
categoryName = getIntent().getStringExtra("categoryName");
|
||||||
categoryId = getIntent().getStringExtra("categoryId");
|
categoryId = getIntent().getStringExtra("categoryId");
|
||||||
storeId = "";
|
|
||||||
|
|
||||||
//txt_mslAvailabilityName.setText(categoryName);
|
//txt_mslAvailabilityName.setText(categoryName);
|
||||||
txt_mslAvailabilityName.setText(getResources().getString(R.string.title_activity_msl__availability));
|
txt_mslAvailabilityName.setText(getResources().getString(R.string.title_activity_msl__availability));
|
||||||
@@ -89,10 +107,10 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
|||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
if (db.checkMsl_AvailabilityData(storeId, categoryId)) {
|
if (db.checkMsl_AvailabilityData(store_id, categoryId)) {
|
||||||
db.updateMSL_Availability(storeId, categoryId, hashMapListHeaderData, hashMapListChildData);
|
db.updateMSL_Availability(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
} else {
|
} else {
|
||||||
db.InsertMSL_Availability(storeId, categoryId, hashMapListHeaderData, hashMapListChildData);
|
db.InsertMSL_Availability(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
}
|
}
|
||||||
|
|
||||||
Toast.makeText(getApplicationContext(), "Data has been saved", Toast.LENGTH_LONG).show();
|
Toast.makeText(getApplicationContext(), "Data has been saved", Toast.LENGTH_LONG).show();
|
||||||
|
|||||||
+26
-11
@@ -4,6 +4,7 @@ import android.app.AlertDialog;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.ApplicationInfo;
|
import android.content.pm.ApplicationInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
@@ -11,6 +12,7 @@ import android.net.Uri;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.support.design.widget.FloatingActionButton;
|
import android.support.design.widget.FloatingActionButton;
|
||||||
import android.support.design.widget.Snackbar;
|
import android.support.design.widget.Snackbar;
|
||||||
@@ -61,13 +63,16 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
ExpandableListAdapter adapter;
|
ExpandableListAdapter adapter;
|
||||||
GSKOrangeDB db;
|
GSKOrangeDB db;
|
||||||
|
|
||||||
String categoryName, categoryId, storeId, Error_Message = "";
|
String categoryName, categoryId, Error_Message = "";
|
||||||
|
|
||||||
String path = "", str = "", _pathforcheck = "", img1 = "", img2 = "";
|
String path = "", str = "", _pathforcheck = "", img1 = "", img2 = "";
|
||||||
static int child_position = -1;
|
static int child_position = -1;
|
||||||
boolean isDialogOpen = true;
|
boolean isDialogOpen = true;
|
||||||
boolean checkflag = true;
|
boolean checkflag = true;
|
||||||
|
|
||||||
|
private SharedPreferences preferences;
|
||||||
|
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -84,9 +89,19 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
expandableListView = (ExpandableListView) findViewById(R.id.expandableListView);
|
expandableListView = (ExpandableListView) findViewById(R.id.expandableListView);
|
||||||
txt_stockFacingName = (TextView) findViewById(R.id.txt_stockFacingName);
|
txt_stockFacingName = (TextView) findViewById(R.id.txt_stockFacingName);
|
||||||
|
|
||||||
|
//preference data
|
||||||
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||||
|
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
|
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
|
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
|
||||||
|
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||||
|
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||||
|
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||||
|
|
||||||
categoryName = getIntent().getStringExtra("categoryName");
|
categoryName = getIntent().getStringExtra("categoryName");
|
||||||
categoryId = getIntent().getStringExtra("categoryId");
|
categoryId = getIntent().getStringExtra("categoryId");
|
||||||
storeId = "";
|
|
||||||
|
|
||||||
//txt_stockFacingName.setText(categoryName);
|
//txt_stockFacingName.setText(categoryName);
|
||||||
txt_stockFacingName.setText(getResources().getString(R.string.title_activity_stock_facing));
|
txt_stockFacingName.setText(getResources().getString(R.string.title_activity_stock_facing));
|
||||||
@@ -110,10 +125,10 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
db.open();
|
db.open();
|
||||||
|
|
||||||
if (db.checkStockAndFacingData(storeId, categoryId)) {
|
if (db.checkStockAndFacingData(store_id, categoryId)) {
|
||||||
db.updateStockAndFacing(storeId, categoryId, hashMapListHeaderData, hashMapListChildData);
|
db.updateStockAndFacing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
} else {
|
} else {
|
||||||
db.InsertStock_Facing(storeId, categoryId, hashMapListHeaderData, hashMapListChildData);
|
db.InsertStock_Facing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||||
}
|
}
|
||||||
|
|
||||||
Toast.makeText(getApplicationContext(), "Data has been saved", Toast.LENGTH_LONG).show();
|
Toast.makeText(getApplicationContext(), "Data has been saved", Toast.LENGTH_LONG).show();
|
||||||
@@ -292,10 +307,10 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
img_camera1.setOnClickListener(new View.OnClickListener() {
|
img_camera1.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
String date = new Date().toLocaleString().toString();
|
//String date = new Date().toLocaleString().toString();
|
||||||
String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
//String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
||||||
|
|
||||||
_pathforcheck = "Stock_Cam1_" + storeId + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck = "Stock_Cam1_" + store_id + "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||||
child_position = groupPosition;
|
child_position = groupPosition;
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
@@ -320,10 +335,10 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
|||||||
img_camera2.setOnClickListener(new View.OnClickListener() {
|
img_camera2.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
String date = new Date().toLocaleString().toString();
|
//String date = new Date().toLocaleString().toString();
|
||||||
String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
//String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
||||||
|
|
||||||
_pathforcheck = "Stock_Cam1_" + storeId + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
_pathforcheck = "Stock_Cam2_" + store_id + "_" + visit_date.replace("/", "") + "_" + getCurrentTime().replace(":", "") + ".jpg";
|
||||||
child_position = groupPosition;
|
child_position = groupPosition;
|
||||||
path = str + _pathforcheck;
|
path = str + _pathforcheck;
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.4 KiB |
@@ -16,6 +16,7 @@
|
|||||||
<string name="menu_daily_download">Günlük Veri Indir</string>
|
<string name="menu_daily_download">Günlük Veri Indir</string>
|
||||||
<string name="menu_upload_data">Veri Paylaş</string>
|
<string name="menu_upload_data">Veri Paylaş</string>
|
||||||
<string name="menu_geotag">Coğrafi Konum</string>
|
<string name="menu_geotag">Coğrafi Konum</string>
|
||||||
|
<string name="menu_export">Data Export</string>
|
||||||
<string name="menu_exit">Çıkış</string>
|
<string name="menu_exit">Çıkış</string>
|
||||||
<string name="menu_setting">Ayarlar</string>
|
<string name="menu_setting">Ayarlar</string>
|
||||||
<string name="menu_services">Hizmetler</string>
|
<string name="menu_services">Hizmetler</string>
|
||||||
|
|||||||
@@ -52,9 +52,11 @@
|
|||||||
<string name="menu_setting">Setting</string>
|
<string name="menu_setting">Setting</string>
|
||||||
<string name="menu_services">Services</string>
|
<string name="menu_services">Services</string>
|
||||||
|
|
||||||
<string name="title_activity_category_list">Category List</string>
|
|
||||||
<string name="title_activity_t2_pcompliance">T2P Compliance</string>
|
<string name="title_activity_t2_pcompliance">T2P Compliance</string>
|
||||||
|
|
||||||
|
<!--Gagan start code-->
|
||||||
|
|
||||||
|
<string name="title_activity_category_list">Category List</string>
|
||||||
<string name="title_activity_category_wise_performance">Categorywise Performance</string>
|
<string name="title_activity_category_wise_performance">Categorywise Performance</string>
|
||||||
<string name="title_activity_daily_main_menu">Daily Data Menu</string>
|
<string name="title_activity_daily_main_menu">Daily Data Menu</string>
|
||||||
<string name="title_activity_msl__availability">Must Stock Availability</string>
|
<string name="title_activity_msl__availability">Must Stock Availability</string>
|
||||||
@@ -78,25 +80,19 @@
|
|||||||
<string name="stock_facing_faceup">Facing</string>
|
<string name="stock_facing_faceup">Facing</string>
|
||||||
<string name="stock_facing_sos_target">SOS Target</string>
|
<string name="stock_facing_sos_target">SOS Target</string>
|
||||||
|
|
||||||
|
<!--Gagan end code-->
|
||||||
|
|
||||||
<string name="title_geo_tag_activity_upload_data">Store Uploaded</string>
|
<string name="title_geo_tag_activity_upload_data">Store Uploaded</string>
|
||||||
<string name="title_geo_tag_activity_geo_data">Store Geo Data Uploaded</string>
|
<string name="title_geo_tag_activity_geo_data">Store Geo Data Uploaded</string>
|
||||||
<string name="title_geo_tag_activity_geo_already_done">Store Already Geotagged</string>
|
<string name="title_geo_tag_activity_geo_already_done">Store Already Geotagged</string>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<string name="title_store_list_activity_store_already_done">Store Already Uploaded</string>
|
<string name="title_store_list_activity_store_already_done">Store Already Uploaded</string>
|
||||||
<string name="title_store_list_activity_store_data_uploaded">Store Data Uploaded</string>
|
<string name="title_store_list_activity_store_data_uploaded">Store Data Uploaded</string>
|
||||||
<string name="title_store_list_activity_store_already_checkout">Store Already Checkout</string>
|
<string name="title_store_list_activity_store_already_checkout">Store Already Checkout</string>
|
||||||
<string name="title_store_list_activity_store_again_uploaded">Please Store data again Uploaded</string>
|
<string name="title_store_list_activity_store_again_uploaded">Please Store data again Uploaded</string>
|
||||||
<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>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user