private bool checkPlumbing(Plumbing plumbing) { return(plumbing != null && ( checkPlumbingInfo(plumbing.MWA) || checkPlumbingInfo(plumbing.PWA) || checkPlumbingInfo(plumbing.Other) || plumbing.WaterNotRunningCount > 12 )); }
private double CalcPWA(Plumbing plumbing) { if (plumbing?.PWA?.Doing == true) { try { if (plumbing.PWA.PlumbingUsage.WaterQuantity == WaterQuantity.CubicMeterPerMonth) { return(plumbing.PWA.PlumbingUsage.CubicMeterPerMonth.Value * plumbing.WaterActivityPWA.Drink.Value * 12 / 100.0); } else if (plumbing.PWA.PlumbingUsage.WaterQuantity == WaterQuantity.WaterBill) { return(plumbing.PWA.PlumbingUsage.WaterBill.Value / WaterPricePlumping("PWA")); } } catch (System.Exception) { } return(0); } return(0); }
private double CalcOther(Plumbing plumbing) { if (plumbing?.Other?.Doing == true) { try { if (plumbing.Other.PlumbingUsage.WaterQuantity == WaterQuantity.CubicMeterPerMonth) { return(plumbing.Other.PlumbingUsage.CubicMeterPerMonth.Value * plumbing.WaterActivityOther.Drink.Value * 12 / 100.0); } else if (plumbing.Other.PlumbingUsage.WaterQuantity == WaterQuantity.WaterBill) { return((plumbing.Other.PlumbingUsage.WaterBill.Value - AvgRent) / AvgPrice); } } catch (System.Exception) { } return(0); } return(0); }
private double CalcPlumping(Plumbing plumbing) { var sum = CalcMWA(plumbing) + CalcPWA(plumbing) + CalcOther(plumbing); return(sum); }