예제 #1
0
        double? EenCalculate()
        {
            var tariffs = new TariffsManager().GetCurrentTariff(new ServiceManager().GetServiceId("ElectricPower"));
            int dif;

            if (!int.TryParse(DifferenceEEn.Text, out dif))
                return null;

            if (dif <= 100)
            {
                return dif * tariffs.Price;
            }

            return (dif - 100) * tariffs.Overexpenditure + 100 * tariffs.Price;
        }
예제 #2
0
        double? HovCalculate()
        {
            int difG, difH;
            var tariff = new TariffsManager().GetCurrentTariff(new ServiceManager().GetServiceId("ColdWater"));

            if (!int.TryParse(DifferenceGov.Text, out difG) ||
                !int.TryParse(DifferenceHov.Text, out difH))
                return null;

            return (difG + difH) * tariff.Price;
        }
예제 #3
0
        double? KanCalculate()
        {
            int difG, difK;
            var tariff = new TariffsManager().GetCurrentTariff(new ServiceManager().GetServiceId("WateDrain"));

            if (!int.TryParse(DifferenceGov.Text, out difG) ||
                !int.TryParse(DifferenceKan.Text, out difK))
                return null;

            return (difG + difK) * tariff.Price;
        }
예제 #4
0
        double? GovCalculate()
        {
            int dif;
            var tariff = new TariffsManager().GetCurrentTariff(new ServiceManager().GetServiceId("HotWater"));

            if (!int.TryParse(DifferenceGov.Text, out dif))
                return null;

            return dif * tariff.Price;
        }