コード例 #1
0
 public void PrePopulateContractAllocations(long ukPrn, IList <SupplementaryDataModel> models, CancellationToken cancellationToken)
 {
     foreach (var model in models)
     {
         var fcsDeliverableCode = _mappingHelper.GetFcsDeliverableCode(model, cancellationToken);
         _cache.GetContractAllocation(model.ConRefNumber, fcsDeliverableCode, cancellationToken, ukPrn);
     }
 }
コード例 #2
0
 public ContractAllocationCacheModel GetContractAllocation(
     string conRefNum,
     int deliverableCode,
     CancellationToken cancellationToken,
     int?ukPrn = null)
 {
     return(_referenceDataCache.GetContractAllocation(conRefNum, deliverableCode, cancellationToken));
 }
        public bool Execute(SupplementaryDataModel model)
        {
            var fcsDeliverableCode = _mappingHelper.GetFcsDeliverableCode(model, CancellationToken.None);

            if (fcsDeliverableCode == 0)
            {
                return(false);
            }

            var contractAllocation = _referenceDataCache.GetContractAllocation(model.ConRefNumber, fcsDeliverableCode, CancellationToken.None);

            return(contractAllocation != null);
        }
        public bool Execute(SupplementaryDataModel model)
        {
            var year  = model.CalendarYear ?? 0;
            var month = model.CalendarMonth ?? 0;

            if (year == 0 || month == 0 || month < 1 || month > 12)
            {
                return(false);
            }

            var startDateMonthEnd = new DateTime(year, month, DateTime.DaysInMonth(year, month));

            var fcsDeliverableCode = _mappingHelper.GetFcsDeliverableCode(model, CancellationToken.None);
            var contractAllocation = _referenceDataCache.GetContractAllocation(model.ConRefNumber, fcsDeliverableCode, CancellationToken.None);

            return(contractAllocation != null && contractAllocation.StartDate < startDateMonthEnd);
        }