Merge branch 'master' into yy_temp

This commit is contained in:
YadavendraSinghYaduvanshi
2017-01-20 18:18:34 +05:30
committed by GitHub
4 changed files with 68 additions and 10 deletions
@@ -3306,4 +3306,59 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
} }
return filled; return filled;
} }
public boolean isMappingAdditionalPromotionData() {
boolean filled = false;
Cursor dbcursor = null;
try {
dbcursor = db.rawQuery("SELECT * FROM MAPPING_ADDITIONAL_PROMOTION ", null);
if (dbcursor != null) {
dbcursor.moveToFirst();
int icount = dbcursor.getInt(0);
dbcursor.close();
if (icount > 0) {
filled = true;
} else {
filled = false;
}
}
} catch (Exception e) {
Log.d("Exception ", " when fetching Records!!!!!!!!!!!!!!!!!!!!! " + e.toString());
return filled;
}
return filled;
}
public boolean checkAdditionalPromoComplianceData(String store_id, String category_id) {
Log.d("PromoCompliance ", "AdditionalPromoCompliance data--------------->Start<------------");
ArrayList<Promo_Compliance_DataGetterSetter> list = new ArrayList<>();
Cursor dbcursor = null;
try {
dbcursor = db.rawQuery("Select * from Additional_Promo_Compliance_Data " +
"where CATEGORY_ID='" + category_id + "' and STORE_ID='" + store_id + "'", null);
if (dbcursor != null) {
if (dbcursor.moveToFirst()) {
do {
Promo_Compliance_DataGetterSetter sb = new Promo_Compliance_DataGetterSetter();
sb.setSku_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_ID")));
list.add(sb);
} while (dbcursor.moveToNext());
}
dbcursor.close();
return list.size() > 0;
}
} catch (Exception e) {
Log.d("Exception ", "when fetching Records!!!!!!!!!!!!!!!!!!!!!" + e.toString());
return false;
}
Log.d("Stock_Facing ", "midday---------------------->Stop<-----------");
return false;
}
} }
@@ -268,6 +268,7 @@ public class LoginActivity extends AppCompatActivity {
// There was an error; don't attempt login and focus the first // There was an error; don't attempt login and focus the first
// form field with an error. // form field with an error.
focusView.requestFocus(); focusView.requestFocus();
} else if(!isuseridValid(userid)){ } else if(!isuseridValid(userid)){
Snackbar.make(museridView,getString(R.string.error_incorrect_username),Snackbar.LENGTH_SHORT).show(); Snackbar.make(museridView,getString(R.string.error_incorrect_username),Snackbar.LENGTH_SHORT).show();
}else if(!isPasswordValid(password)){ }else if(!isPasswordValid(password)){
@@ -278,7 +279,6 @@ public class LoginActivity extends AppCompatActivity {
// perform the user login attempt. // perform the user login attempt.
new AuthenticateTask().execute(); new AuthenticateTask().execute();
} }
} }
@@ -163,8 +163,9 @@ public class DailyDataMenuActivity extends AppCompatActivity {
//data.setCategory_name("Promo Compliance"); //data.setCategory_name("Promo Compliance");
data.setCategory_name(getResources().getString(R.string.daily_data_menu_promo_compliance)); data.setCategory_name(getResources().getString(R.string.daily_data_menu_promo_compliance));
if (db.isMappingPromotionData()) { if (db.isMappingPromotionData() || db.isMappingAdditionalPromotionData()) {
if (db.checkPromoComplianceData(store_id, categoryId)) { if (db.checkPromoComplianceData(store_id, categoryId) ||
db.checkAdditionalPromoComplianceData(store_id, categoryId)) {
data.setCategory_img(R.mipmap.promo_compliance_done); data.setCategory_img(R.mipmap.promo_compliance_done);
} else { } else {
data.setCategory_img(R.mipmap.promo_compliance); data.setCategory_img(R.mipmap.promo_compliance);
@@ -259,7 +260,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background)); holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
} }
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) { } else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
if (db.isMappingPromotionData()) { if (db.isMappingPromotionData() || db.isMappingAdditionalPromotionData()) {
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark)); holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
} else { } else {
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background)); holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
@@ -291,7 +292,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
} }
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) { } else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
if (db.isMappingPromotionData()) { if (db.isMappingPromotionData() || db.isMappingAdditionalPromotionData()) {
Intent intent = new Intent(DailyDataMenuActivity.this, PromoComplianceActivity.class); Intent intent = new Intent(DailyDataMenuActivity.this, PromoComplianceActivity.class);
intent.putExtra("categoryName", dailyData.getCategory_name()); intent.putExtra("categoryName", dailyData.getCategory_name());
intent.putExtra("categoryId", categoryId); intent.putExtra("categoryId", categoryId);
@@ -9,7 +9,9 @@
android:id="@+id/card_view" android:id="@+id/card_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="5dp" android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
card_view:cardCornerRadius="10dp"> card_view:cardCornerRadius="10dp">
<LinearLayout <LinearLayout