Ejemplo n.º 1
0
        private Task <PricePeriod[]> GetPricePeriods(string customerNo, string priceAreaId, string agreementType, string productionItemId = "", string grainTypeId = "")
        {
            if (string.IsNullOrEmpty(agreementType) || agreementType.Equals(AgreementType.SportAndForwardAvtal))
            {
                return(_agreementRepository.GetPricePeriodsForSpotAndForwardAgreementsAsync(customerNo, priceAreaId));
            }
            if (agreementType.Equals(AgreementType.Depaavtal))
            {
                return(_agreementRepository.GetPricePeriodsForStorageAgreementsAsync(customerNo, priceAreaId));
            }
            if (agreementType.Equals(AgreementType.Poolavtal))
            {
                return(_agreementRepository.GetPricePeriodsForPoolAgreementsAsync(customerNo, priceAreaId));
            }
            if (agreementType.Equals(AgreementType.PrissakringDepaavtal))
            {
                return(_agreementRepository.GetPricePeriodsForPriceProtectingStorageAgreementAsync(priceAreaId, productionItemId, grainTypeId));
            }

            return(Task.FromResult(new PricePeriod[0]));
        }