namespace BeWo.Core { public class ServiceLogic { // public static CostRatePeriodDC GetActualRateFactor(OrganisationDC costBearer) // { // return GetActualCostRatePeriod(costBearer, CostRatePeriodType.RateFactor); // } // public static CostRatePeriodDC GetActualHourlyRate(OrganisationDC costBearer) // { // return GetActualCostRatePeriod(costBearer, CostRatePeriodType.HourlyRate); // } // public static CostRatePeriodDC GetActualMinuteInterval(OrganisationDC costBearer) // { // return GetActualCostRatePeriod(costBearer, CostRatePeriodType.MinutesIntervall); // } // public static CostRatePeriodDC GetActualCostRatePeriod(OrganisationDC costBearer, CostRatePeriodType costRateType) // { // if (costBearer.CostRatePeriods != null) // { // foreach (CostRatePeriodDC crp in costBearer.CostRatePeriods) // { // if (crp.CostRateType == costRateType && crp.EndDate == null) // { // return crp; // } // } // } // return null; // } // public static decimal GetActualRateFactor(CompactOrganisationDC costBearer) // { // decimal val = 0; // CostRatePeriodDC crp = GetActualCostRatePeriod(costBearer, CostRatePeriodType.RateFactor); // if (crp != null && crp.CostRateValue.HasValue) // { // val = crp.CostRateValue.Value; // } // return val; // } // public static decimal GetActualHourlyRate(CompactOrganisationDC costBearer) // { // decimal val = 0; // CostRatePeriodDC crp = GetActualCostRatePeriod(costBearer, CostRatePeriodType.HourlyRate); // if (crp != null && crp.CostRateValue.HasValue) // { // val = crp.CostRateValue.Value; // } // return val; // } // public static int GetActualMinuteInterval(CompactOrganisationDC costBearer) // { // int val = 1; // CostRatePeriodDC crp = GetActualCostRatePeriod(costBearer, CostRatePeriodType.MinutesIntervall); // if (crp != null && crp.CostRateValue.HasValue) // { // val = (int)crp.CostRateValue.Value; // } // return val; // } // public static CostRatePeriodDC GetActualCostRatePeriod(CompactOrganisationDC costBearer, CostRatePeriodType costRateType) // { // //if (costBearer.CostRatePeriods != null) // //{ // // foreach (CostRatePeriodDC crp in costBearer.CostRatePeriods) // // { // // if (crp.CostRateType == costRateType && crp.EndDate == null) // // { // // return crp; // // } // // } // //} // return null; // } } }