Example #1
0
 public FundingEventSimple(FundingEvent fundingEvent)
 {
     TreatmentBMPID             = fundingEvent.TreatmentBMPID;
     Year                       = fundingEvent.Year;
     FundingEventTypeID         = fundingEvent.FundingEventTypeID;
     Description                = fundingEvent.Description;
     FundingEventFundingSources = fundingEvent.FundingEventFundingSources
                                  .Select(x => new FundingEventFundingSourceSimple(x)).ToList();
     FundingEventID = fundingEvent.FundingEventID;
 }
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public FundingEventFundingSource(FundingSource fundingSource, FundingEvent fundingEvent) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.FundingEventFundingSourceID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.FundingSourceID             = fundingSource.FundingSourceID;
     this.FundingSource = fundingSource;
     fundingSource.FundingEventFundingSources.Add(this);
     this.FundingEventID = fundingEvent.FundingEventID;
     this.FundingEvent   = fundingEvent;
     fundingEvent.FundingEventFundingSources.Add(this);
 }
 public static string GetDeleteUrl(this FundingEvent fundingEvent)
 {
     return(DeleteUrlTemplate.ParameterReplace(fundingEvent.FundingEventID));
 }
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static FundingEventFundingSource CreateNewBlank(FundingSource fundingSource, FundingEvent fundingEvent)
 {
     return(new FundingEventFundingSource(fundingSource, fundingEvent));
 }
 public static void DeleteFundingEvent(this IQueryable <FundingEvent> fundingEvents, FundingEvent fundingEventToDelete)
 {
     DeleteFundingEvent(fundingEvents, new List <FundingEvent> {
         fundingEventToDelete
     });
 }