private bool checkPublic(PublicGroundWater ground) { return(ground != null && ( ground.WaterResources.Any(it => it.CubicMeterPerMonth > 1000 || checkPumps(it.Pumps)) )); }
private double CalcPublic(PublicGroundWater publicGroundWater) { if (publicGroundWater?.Doing == true) { return(publicGroundWater.WaterResourceCount > 0 ? publicGroundWater.WaterResources.Sum(it => { if (it.HasCubicMeterPerMonth == true) { return it.CubicMeterPerMonth.Value * it.WaterActivities.Drink.Value * 12 / 100.0; } else if (it.HasPump == true) { return CalcPumps(it.Pumps, true); } return 0; }) : 0); } return(0); }
private double CalcPublic(PublicGroundWater publicGroundWater) { if (publicGroundWater?.Doing == true) { return(publicGroundWater.WaterResourceCount > 0 ? publicGroundWater.WaterResources.Where(it => it != null).Sum(it => { try { if (it.HasCubicMeterPerMonth == true) { return it.CubicMeterPerMonth.Value * it.WaterActivities.Drink.Value * 12 / 100.0; } else if (it.HasPump == true) { return CalcPumps(it.Pumps, true); } } catch (System.Exception) { } return 0; }) : 0); } return(0); }