private Task <CalcOtherViewModel> GetOtherAsync(string fldName) { CalcOtherViewModel ovm = new CalcOtherViewModel(); ovm.fldName = fldName; ovm.others = new List <DisplayNutrientOther>(); List <NutrientOther> fldOthers = _ud.GetFieldNutrientsOthers(fldName); foreach (var m in fldOthers) { DisplayNutrientOther no = new DisplayNutrientOther() { otherId = m.id, description = m.description, ltN = m.ltN, ltP = m.ltP2o5, ltK = m.ltK, yrN = m.yrN, yrP = m.yrP2o5, yrK = m.yrK }; ovm.others.Add(no); } return(Task.FromResult(ovm)); }
private Task <CalcHeadingViewModel> GetHeadingAsync(string fldName) { CalcHeadingViewModel cvm = new CalcHeadingViewModel(); cvm.headingReqd = false; List <FieldCrop> crps = _ud.GetFieldCrops(fldName); if (crps.Count() > 0) { cvm.headingReqd = true; } List <NutrientManure> manures = _ud.GetFieldNutrientsManures(fldName); if (manures.Count() > 0) { cvm.headingReqd = true; } List <NutrientFertilizer> fertilizers = _ud.GetFieldNutrientsFertilizers(fldName); if (fertilizers.Count() > 0) { cvm.headingReqd = true; } List <NutrientOther> others = _ud.GetFieldNutrientsOthers(fldName); if (others.Count() > 0) { cvm.headingReqd = true; } cvm.unsavedData = _ud.FarmData().unsaved; return(Task.FromResult(cvm)); }