public TariffCountAndPrice GetTariffYearsAndPrice(DicTariff tariff) { var result = new TariffCountAndPrice(); var years = 0; for (int i = 0; i < tariff.ProtectionDocSupportYearsUntil; i++) { if (i + 1 <= SupportYear) { years++; } } result.YearsCount = years; decimal price = tariff.Price ?? 0; //switch (BeneficiaryType?.Code) //{ // case "SMB": // price = tariff.PriceBusiness ?? 0; // break; // case "VET": // price = tariff.PriceBeneficiary ?? 0; // break; //} //if (CustomerType?.Code != "2") //{ // price = tariff.PriceUl ?? 0; //} //else //{ // price = tariff.PriceFl ?? 0; //} result.Price = price / 100 * 112; return(result); }
public string GetSupportYearsStringKz(DicTariff tariff) { var years = new List <int>(); for (int i = 0; i < tariff.ProtectionDocSupportYearsUntil; i++) { if (i + 1 <= SupportYear) { years.Add(i + 1); } } return($"{string.Join(", ", years)} жылдарына"); }
public string GetSupportTariffSumString(DicTariff tariff) { var yearsAndPrice = GetTariffYearsAndPrice(tariff); return($"{yearsAndPrice.Price:F2} тенге x {yearsAndPrice.YearsCount} = {yearsAndPrice.Price * yearsAndPrice.YearsCount:F2} тг"); }
private static bool IsNewTariff(DicTariff t) { return(t.Price == null); }