Exemple #1
0
 public EditViewData(Models.FundingEvent fundingEvent,
                     List <FundingSourceSimple> allFundingSources, List <FundingEventType> allFundingEventTypes)
 {
     AllFundingSources    = allFundingSources;
     TreatmentBMPID       = fundingEvent.TreatmentBMPID;
     AllFundingEventTypes = allFundingEventTypes.ToSelectListWithDisabledEmptyFirstRow(
         x => x.FundingEventTypeID.ToString(CultureInfo.InvariantCulture),
         x => x.FundingEventTypeDisplayName, "Select a Funding Event Type");
 }
Exemple #2
0
        public void UpdateModel(Models.FundingEvent currentFundingEvent, IList <Models.FundingEventFundingSource> allFundingEventFundingSources)
        {
            currentFundingEvent.Description        = FundingEvent.Description;
            currentFundingEvent.FundingEventTypeID = FundingEvent.FundingEventTypeID;
            currentFundingEvent.Year = FundingEvent.Year;


            var fundingEventFundingSourcesToUpdate =
                FundingEvent?.FundingEventFundingSources?.Select(x => x.ToFundingEventFundingSource()).ToList() ?? new List <FundingEventFundingSource>();

            currentFundingEvent.FundingEventFundingSources.Merge(fundingEventFundingSourcesToUpdate,
                                                                 allFundingEventFundingSources,
                                                                 (z, w) => z.FundingEventID == w.FundingEventID && z.FundingSourceID == w.FundingSourceID,
                                                                 (z, w) => z.Amount = w.Amount);
        }
Exemple #3
0
 public EditViewModel(Models.FundingEvent fundingEvent)
 {
     FundingEvent = new FundingEventSimple(fundingEvent);
 }