private double CalcPrivate(PrivateGroundWater privateGroundWater)
 {
     if (privateGroundWater?.Doing == true)
     {
         return(privateGroundWater.WaterResourceCount > 0 ? privateGroundWater.WaterResources.Where(it => it != null).Sum(it =>
         {
             try
             {
                 if (it.UsageType.GroundWaterQuantity == GroundWaterQuantity.CubicMeterPerMonth)
                 {
                     return it.UsageType.UsageCubicMeters.Value * it.WaterActivities.Drink.Value * 12 / 100.0;
                 }
                 else if (it.UsageType.GroundWaterQuantity == GroundWaterQuantity.WaterBill)
                 {
                     return it.UsageType.WaterBill.Value / WaterPrice(it.Location);
                 }
                 else if (it.UsageType.GroundWaterQuantity == GroundWaterQuantity.Unknown && it.HasPump.Value)
                 {
                     return CalcPumps(it.Pumps, true);
                 }
             }
             catch (System.Exception) { }
             return 0;
         }) : 0);
     }
     return(0);
 }
Exemplo n.º 2
0
 private bool checkPrivate(PrivateGroundWater ground)
 {
     return(ground != null && (
                ground.AllCount > 10 ||
                ground.WaterResources.Any(it =>
                                          it.UsageType?.UsageCubicMeters > 1000 ||
                                          it.UsageType?.WaterBill > 100000 ||
                                          checkPumps(it.Pumps))
                ));
 }