Проверка на обязательные поля в новой форме
This commit is contained in:
@ -8,6 +8,7 @@ import android.database.SQLException;
|
||||
import android.database.sqlite.SQLiteConstraintException;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
@ -898,7 +899,8 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
{
|
||||
//В SQLIte можно только добавить столбец либо переименовать таблицу https://sqlite.org/lang_altertable.html поэтому обновление усложняется....
|
||||
String sql;
|
||||
|
||||
//if(oldVersion==152 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { //Для "RENAME COLUMN" Версия андроида должнв быть выше Android 11
|
||||
/*
|
||||
if(oldVersion==144)
|
||||
{
|
||||
sql = "create table if not exists frmlocustdel_new(" +
|
||||
@ -1371,7 +1373,8 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
|
||||
oldVersion=152;
|
||||
}
|
||||
if(oldVersion==152) {
|
||||
if(oldVersion==152 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { //Для "RENAME COLUMN" Версия андроида должнв быть выше Android 11
|
||||
|
||||
//Теперь дата в виде текстового поля храниться так как при синхронизации с сервера она приходит в виде даты
|
||||
db.execSQL("ALTER TABLE frmlocust ADD COLUMN date_temp TEXT;");
|
||||
db.execSQL("UPDATE frmlocust SET date_temp = date;");
|
||||
@ -1511,6 +1514,7 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
|
||||
oldVersion=153;
|
||||
}
|
||||
*/
|
||||
|
||||
if(oldVersion < newVersion) //Это условие выполняется: если совсем старые версии и не знаю что поменялось...
|
||||
{
|
||||
|
||||
@ -2928,394 +2928,134 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
eFields = true;
|
||||
}
|
||||
|
||||
// if (!eFields && !isGONE(spiFrmLocustDelFilled) && ((selectDB)spiFrmLocustDelFilled).getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(spiFrmLocustDelFilled);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Was_a_spray_monitoring_form_for_this_treatment_filled_out_by_the_control_team) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
if (!eFields && (!isGONE(edtLatCenter) && edtLatCenter.getText().toString().isBlank() || Tools.getDouble(edtLatCenter.getText().toString(),0.0) == 0))
|
||||
{
|
||||
scrollTo(edtLatCenter);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Lat_center) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
if (!eFields && (!isGONE(edtLonCenter) && edtLonCenter.getText().toString().isBlank() || Tools.getDouble(edtLonCenter.getText().toString(),0.0) == 0))
|
||||
{
|
||||
scrollTo(edtLonCenter);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Lon_center) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
if (!eFields && !isGONE(edtBrigadeCount) && edtBrigadeCount.getText().toString().isBlank())
|
||||
{
|
||||
scrollTo(edtBrigadeCount);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Number_of_agents_in_control_team) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
if (!eFields && !isGONE(edtBrigadeCountTrained) && edtBrigadeCountTrained.getText().toString().isBlank())
|
||||
{
|
||||
scrollTo(edtBrigadeCountTrained);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Number_of_agents_previously_trained_in_insecticide_handling_and_application) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
if (!eFields && !isGONE(spiCalibrConsumptionCheck) && ((selectDB)spiCalibrConsumptionCheck).getText().toString().isBlank())
|
||||
{
|
||||
scrollTo(spiCalibrConsumptionCheck);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Flow_rate_of_sprayer_verified_during_this_monitoring_visit) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
if (!eFields && !isGONE(spiCalibrPrecipitation) && ((selectDB)spiCalibrPrecipitation).getText().toString().isBlank())
|
||||
{
|
||||
scrollTo(spiCalibrPrecipitation);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Droplet_deposition_verified_during_this_monitoring_visit) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
|
||||
// if (!eFields && !isGONE(spiCountry) && ((selectDB)spiCountry).getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(spiCountry);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Country) + "\"!"; //@string/Country
|
||||
// eFields = true;
|
||||
// }
|
||||
// if (!eFields && !isGONE(spiRegion) && (((selectDB)spiRegion).getValue() == null || ((selectDB)spiRegion).getValue().equals("")))
|
||||
// {
|
||||
// scrollTo(spiRegion);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Region) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// if (!eFields && !isGONE(edtArea) && edtArea.getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(edtArea);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Area) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// if (!eFields && !isGONE(edtVillage) && edtVillage.getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(edtVillage);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Name_of_the_village) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// if(!eFields && !isGONE(edtObserver) && edtObserver.getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(edtObserver);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Name_of_survey_team_leader) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
//
|
||||
if(((selectDB)spiEffControl2).getValue().equals("1")){
|
||||
if (!eFields && !isGONE(edtEffMortality2) && edtEffMortality2.getText().toString().isBlank())
|
||||
{
|
||||
scrollTo(edtEffMortality2);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Biological_efficiency_of_treatment) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
if (!eFields && !isGONE(edtEffPassedTime2) && edtEffPassedTime2.getText().toString().isBlank())
|
||||
{
|
||||
scrollTo(edtEffPassedTime2);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Time_after_treatment_hours) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
}
|
||||
|
||||
// // TODO Не забыть раскоментировать при публикации новой версии
|
||||
// if (!eFields && (!isGONE(edtLatCenter) && edtLatCenter.getText().toString().isBlank() || Tools.getDouble(edtLatCenter.getText().toString(),0.0) == 0))
|
||||
// {
|
||||
// scrollTo(edtLatCenter);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Lat_center) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// if (!eFields && (!isGONE(edtLonCenter) && edtLonCenter.getText().toString().isBlank() || Tools.getDouble(edtLonCenter.getText().toString(),0.0) == 0))
|
||||
// {
|
||||
// scrollTo(edtLonCenter);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Lon_center) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
//
|
||||
// if (!eFields && !isGONE(edtInfestedArea))
|
||||
// {
|
||||
// if(edtInfestedArea.getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(edtInfestedArea);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Area_infested_ha) + "\"!";
|
||||
// eFields = true;
|
||||
// }else
|
||||
// if(!checkMinMaxI(edtInfestedArea,0,1000).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtInfestedArea);
|
||||
// atxt = checkMinMaxI(edtInfestedArea,0,1000) + " \"" + getResources().getString(R.string.Area_infested_ha) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// }
|
||||
// if (!eFields && !isGONE(edtTreatedArea))
|
||||
// {
|
||||
// if(edtTreatedArea.getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(edtTreatedArea);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Area_treated_ha) + "\"!";
|
||||
// eFields = true;
|
||||
// }else
|
||||
// if(!checkMinMaxI(edtTreatedArea,0,1000).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtTreatedArea);
|
||||
// atxt = checkMinMaxI(edtTreatedArea,0,1000) + " \"" + getResources().getString(R.string.Area_treated_ha) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// }
|
||||
// if (!eFields && !isGONE(spiVegType) && ((selectDB)spiVegType).getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(spiVegType);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Vegetation_type) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// if (!eFields && !isGONE(edtVegHeight))
|
||||
// {
|
||||
// if(edtVegHeight.getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(edtVegHeight);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Height_cm) + "\"!";
|
||||
// eFields = true;
|
||||
// }else
|
||||
// if(!checkMinMaxI(edtVegHeight,0,600).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtVegHeight);
|
||||
// atxt = checkMinMaxI(edtVegHeight,0,600) + " \"" + getResources().getString(R.string.Height_cm) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// }
|
||||
// if (!eFields && !isGONE(spiVegCover) && ((selectDB)spiVegCover).getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(spiVegCover);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Del_Vegetation_cover) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// if (!eFields && !isGONE(spiVegDamage) && ((selectDB)spiVegDamage).getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(spiVegDamage);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Damage) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// if (!eFields && !isGONE(edtVegDamageArea))
|
||||
// {
|
||||
// if(!checkMinMaxI(edtVegDamageArea,0,100000).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtVegDamageArea);
|
||||
// atxt = checkMinMaxI(edtVegDamageArea,0,100000) + " \"" + getResources().getString(R.string.Damage_area_ha) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// }
|
||||
// if (!eFields && !isGONE(edtInsName) && edtInsName.getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(edtInsName);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Trade_name) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// if (!eFields && !isGONE(edtInsActiveSubstance) && edtInsActiveSubstance.getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(edtInsActiveSubstance);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.The_active_substance) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// if (!eFields && !isGONE(edtInsConcentration))
|
||||
// {
|
||||
// if(edtInsConcentration.getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(edtInsConcentration);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Concentration_A_S) + "\"!";
|
||||
// eFields = true;
|
||||
// }/*else
|
||||
// if(!checkMinMaxI(edtInsConcentration,0,100).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtInsConcentration);
|
||||
// atxt = checkMinMaxI(edtInsConcentration,0,100) + " \"" + getResources().getString(R.string.Concentration_A_S) + "\"!";
|
||||
// eFields = true;
|
||||
// }*/
|
||||
// }
|
||||
// if (!eFields && !isGONE(spiInsFormulation) && ((selectDB)spiInsFormulation).getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(spiInsFormulation);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Formulation) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// if (!eFields && !isGONE(edtInsDose))
|
||||
// {
|
||||
// if(!checkMinMaxI(edtInsDose,0.005f,5).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtInsDose);
|
||||
// atxt = checkMinMaxI(edtInsDose,0.005f,5) + " \"" + getResources().getString(R.string.Dose_rate_l_of_commercial_product_ha) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// }
|
||||
// if (!eFields && !isGONE(edtInsRate))
|
||||
// {
|
||||
// if(!checkMinMaxI(edtInsRate,0.1f,600).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtInsRate);
|
||||
// atxt = checkMinMaxI(edtInsRate,0.1f,600) + " \"" + getResources().getString(R.string.Rate_of_working_solution_l_ha) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// }
|
||||
// if (!eFields && !isGONE(edtInsUsedVolume))
|
||||
// {
|
||||
// if(edtInsUsedVolume.getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(edtInsUsedVolume);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Total_volume_of_working_solution_actually_applied_l) + "\"!";
|
||||
// eFields = true;
|
||||
// }else
|
||||
// if(!checkMinMaxI(edtInsUsedVolume,1,450000).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtInsUsedVolume);
|
||||
// atxt = checkMinMaxI(edtInsUsedVolume,1,450000) + " \"" + getResources().getString(R.string.Total_volume_of_working_solution_actually_applied_l) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// }
|
||||
// if (!eFields && !isGONE(spiWeaTimeStart) && ((selectDB)spiWeaTimeStart).getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(spiWeaTimeStart);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Time_start) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// if (!eFields && !isGONE(spiWeaTimeEnd) && ((selectDB)spiWeaTimeEnd).getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(spiWeaTimeEnd);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Time_end) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// if (!eFields && !isGONE(edtWeaTemperatureStart))
|
||||
// {
|
||||
// if(!checkMinMaxI(edtWeaTemperatureStart,0,50).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtWeaTemperatureStart);
|
||||
// atxt = checkMinMaxI(edtWeaTemperatureStart,0,50) + " \"" + getResources().getString(R.string.Temperature_start) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// }
|
||||
// if (!eFields && !isGONE(edtWeaTemperatureEnd))
|
||||
// {
|
||||
// if(!checkMinMaxI(edtWeaTemperatureEnd,0,50).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtWeaTemperatureEnd);
|
||||
// atxt = checkMinMaxI(edtWeaTemperatureEnd,0,50) + " \"" + getResources().getString(R.string.Temperature_end) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (!eFields && !isGONE(edtWeaWindSpeedStart))
|
||||
// {
|
||||
// if(!checkMinMaxI(edtWeaWindSpeedStart,0,20).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtWeaWindSpeedStart);
|
||||
// atxt = checkMinMaxI(edtWeaWindSpeedStart,0,20) + " \"" + getResources().getString(R.string.Wind_speed_start_m_s) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// }
|
||||
// if (!eFields && !isGONE(edtWeaWindSpeedEnd))
|
||||
// {
|
||||
// if(!checkMinMaxI(edtWeaWindSpeedEnd,0,20).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtWeaWindSpeedEnd);
|
||||
// atxt = checkMinMaxI(edtWeaWindSpeedEnd,0,20) + " \"" + getResources().getString(R.string.Wind_speed_end_m_s) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// }
|
||||
// if (!eFields && !isGONE(spiLocSpecies) && ((selectDB)spiLocSpecies).getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(spiLocSpecies);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Type) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// if (!eFields && !isGONE(spiLocHoppers) && ((selectDB)spiLocHoppers).getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(spiLocHoppers);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Hopper_stages) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// if (!eFields && !isGONE(edtLocDensity))
|
||||
// {
|
||||
// if(edtLocDensity.getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(edtLocDensity);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Density_m2) + "\"!";
|
||||
// eFields = true;
|
||||
// }else
|
||||
// if(!checkMinMaxI(edtLocDensity,0,80000).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtLocDensity);
|
||||
// atxt = checkMinMaxI(edtLocDensity,0,80000) + " \"" + getResources().getString(R.string.Density_m2) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// }
|
||||
// if (!eFields && !isGONE(spiMainPurpose) && ((selectDB)spiMainPurpose).getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(spiMainPurpose);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Main_purpose_of_treatment) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
//// if (!eFields && !isGONE(spiKuliguli) && ((selectDB)spiKuliguli).getText().toString().isBlank())
|
||||
//// {
|
||||
//// scrollTo(spiKuliguli);
|
||||
//// atxt = atxt + ": \"" + getResources().getString(R.string.Bands) + "\"!";
|
||||
//// eFields = true;
|
||||
//// }
|
||||
//// if (!eFields && !isGONE(spiSwarm) && ((selectDB)spiSwarm).getText().toString().isBlank())
|
||||
//// {
|
||||
//// scrollTo(spiSwarm);
|
||||
//// atxt = atxt + ": \"" + getResources().getString(R.string.Swarms) + "\"!";
|
||||
//// eFields = true;
|
||||
//// }
|
||||
//// if (!eFields && !isGONE(spiSparse) && ((selectDB)spiSparse).getText().toString().isBlank())
|
||||
//// {
|
||||
//// scrollTo(spiSparse);
|
||||
//// atxt = atxt + ": \"" + getResources().getString(R.string.Del_Scattered) + "\"!";
|
||||
//// eFields = true;
|
||||
//// }
|
||||
// if (!eFields && !isGONE(spiSprPlatform) && ((selectDB)spiSprPlatform).getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(spiSprPlatform);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Spray_platform) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// if (!eFields && !isGONE(edtSprHeight))
|
||||
// {
|
||||
// if(!checkMinMaxI(edtSprHeight,1,100).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtSprHeight);
|
||||
// atxt = checkMinMaxI(edtSprHeight,1,100) + " \"" + getResources().getString(R.string.Atomizer_height_above_ground_m) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// }
|
||||
// if (!eFields && !isGONE(spiSprBarrier) && ((selectDB)spiSprBarrier).getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(spiSprBarrier);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Barriers) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
//// if (!eFields && !isGONE(edtSprBarrierWidth))
|
||||
//// {
|
||||
//// if(!checkMinMaxI(edtSprBarrierWidth,1,300).isEmpty())
|
||||
//// {
|
||||
//// scrollTo(edtSprBarrierWidth);
|
||||
//// atxt = checkMinMaxI(edtSprBarrierWidth,1,300) + " \"" + getResources().getString(R.string.Barrier_width_m) + "\"!";
|
||||
//// eFields = true;
|
||||
//// }
|
||||
//// }
|
||||
// if (!eFields && !isGONE(edtSprBarrierSpace))
|
||||
// {
|
||||
// if(!checkMinMaxI(edtSprBarrierSpace,1,1000).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtSprBarrierSpace);
|
||||
// atxt = checkMinMaxI(edtSprBarrierSpace,1,1000) + " \"" + getResources().getString(R.string.Spacing_of_barriers_m) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (!eFields && !isGONE(edtSprSpeed))
|
||||
// {
|
||||
// if(edtSprSpeed.getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(edtSprSpeed);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Forward_speed_km_h) + "\"!";
|
||||
// eFields = true;
|
||||
// }else
|
||||
// if(!checkMinMaxI(edtSprSpeed,1,300).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtSprSpeed);
|
||||
// atxt = checkMinMaxI(edtSprSpeed,1,300) + " \"" + getResources().getString(R.string.Forward_speed_km_h) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// }
|
||||
// if(!eFields && !isGONE(edtEffMortality) )
|
||||
// {
|
||||
// if(edtEffMortality.getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(edtEffMortality);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Biological_efficiency_of_treatment) + "\"!";
|
||||
// eFields = true;
|
||||
// }else
|
||||
// if(!checkMinMaxI(edtEffMortality,0,100).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtEffMortality);
|
||||
// atxt = checkMinMaxI(edtEffMortality,0,100) + " \"" + getResources().getString(R.string.Biological_efficiency_of_treatment) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// }
|
||||
// if(!eFields && !isGONE(edtEffTime))
|
||||
// {
|
||||
// if(edtEffTime.getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(edtEffTime);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Time_after_treatment_hours) + "\"!";
|
||||
// eFields = true;
|
||||
// }else
|
||||
// if(!checkMinMaxI(edtEffTime,0,240).isEmpty())
|
||||
// {
|
||||
// scrollTo(edtEffTime);
|
||||
// atxt = checkMinMaxI(edtEffTime,0,240) + " \"" + getResources().getString(R.string.Time_after_treatment_hours) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// }
|
||||
// if(!eFields && !isGONE(edtClothing) && edtClothing.getText().toString().isBlank())
|
||||
// {
|
||||
// scrollTo(edtClothing);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Protective_clothing) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
// if(!eFields && !isGONE(spiSafNonTarget) && ((selectDB)spiSafNonTarget).getText().toString().equals("")) // воздействие на нецелевые организмы
|
||||
// {
|
||||
// scrollTo(spiSafNonTarget);
|
||||
// atxt = atxt + ": \"" + getResources().getString(R.string.Effect_on_non_terget_organism) + "\"!";
|
||||
// eFields = true;
|
||||
// }
|
||||
if (!eFields && !isGONE(spiHlthProtectiveClothingClean) && ((selectDB)spiHlthProtectiveClothingClean).getText().toString().isBlank())
|
||||
{
|
||||
scrollTo(spiHlthProtectiveClothingClean);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Protective_clothing_clean_and_in_good_state) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
|
||||
if (!eFields && !isGONE(spiSafObservedPollution) && ((selectDB)spiSafObservedPollution).getText().toString().isBlank())
|
||||
{
|
||||
scrollTo(spiSafObservedPollution);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Accidental_contamination_observed_or_reported) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
|
||||
if (!eFields && !isGONE(spiSafNonTarget2) && ((selectDB)spiSafNonTarget2).getText().toString().isBlank())
|
||||
{
|
||||
scrollTo(spiSafNonTarget2);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Effects_on_non_target_organisms_observed_or_reported) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
|
||||
if (!eFields && !isGONE(spiRiskHouse) && ((selectDB)spiRiskHouse).getText().toString().isBlank())
|
||||
{
|
||||
scrollTo(spiRiskHouse);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Any_dwellings_or_housing_nearby_the_treatment) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
|
||||
if (!eFields && !isGONE(spiRiskWater) && ((selectDB)spiRiskWater).getText().toString().isBlank())
|
||||
{
|
||||
scrollTo(spiRiskWater);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Any_surface_waters_nearby_the_treatment) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
|
||||
if (!eFields && !isGONE(spiRiskApiary) && ((selectDB)spiRiskApiary).getText().toString().isBlank())
|
||||
{
|
||||
scrollTo(spiRiskApiary);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Any_apiculture_nearby_the_treatment) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
|
||||
if (!eFields && !isGONE(spiRiskAgricultural) && ((selectDB)spiRiskAgricultural).getText().toString().isBlank())
|
||||
{
|
||||
scrollTo(spiRiskAgricultural);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Any_crops_treated_or_exposed_by_the_insecticide) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
|
||||
if (!eFields && !isGONE(spiRiskSilk) && ((selectDB)spiRiskSilk).getText().toString().isBlank())
|
||||
{
|
||||
scrollTo(spiRiskSilk);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Any_sericulture_nearby_the_treatment) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
|
||||
if (!eFields && !isGONE(spiRiskPastures) && ((selectDB)spiRiskPastures).getText().toString().isBlank())
|
||||
{
|
||||
scrollTo(spiRiskPastures);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Any_grassland_or_grazing_land_treated) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
|
||||
if (!eFields && !isGONE(spiRiskPark) && ((selectDB)spiRiskPark).getText().toString().isBlank())
|
||||
{
|
||||
scrollTo(spiRiskPark);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Any_other_ecologically_sensitive_areas_nearby_the_treatment) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
|
||||
if (!eFields && !isGONE(spiRiskProbeAnalysis) && ((selectDB)spiRiskProbeAnalysis).getText().toString().isBlank())
|
||||
{
|
||||
scrollTo(spiRiskProbeAnalysis);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Samples_taken_for_residue_analysis) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
|
||||
if (eFields) // Если не заполнены все обязательные поля
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user