예제 #1
0
        private FundingSource GetFundingSource(CreatePieceModel model)
        {
            FundingSource fundingSource = null;

            if (model.AcquisitionFundingSourceId >= 0)
            {
                fundingSource = repository.GetFundingSource(model.AcquisitionFundingSourceId.Value);
            }
            else if (model.AcquisitionFundingSourceId < 0 && !string.IsNullOrWhiteSpace(model.FundingSourceName))
            {
                fundingSource = repository.GetFundingSources().SingleOrDefault(f => f.Name == model.FundingSourceName && f.MuseumId == model.MuseumId);
                if (fundingSource == null)
                {
                    fundingSource = fundingSourceFactory.Create(model.FundingSourceName, model.MuseumId);

                    repository.AddFundingSource(fundingSource);
                }
            }

            return(fundingSource);
        }
예제 #2
0
 public override void Visit(LineItem lineItem)
 {
     lineItem.FundingSource = fundingSourceFactory.Create(lineItem);
 }