コード例 #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;
 }
コード例 #2
0
 /// <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);
 }
コード例 #3
0
 public static string GetDeleteUrl(this FundingEvent fundingEvent)
 {
     return(DeleteUrlTemplate.ParameterReplace(fundingEvent.FundingEventID));
 }
コード例 #4
0
 /// <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));
 }
コード例 #5
0
 public static void DeleteFundingEvent(this IQueryable <FundingEvent> fundingEvents, FundingEvent fundingEventToDelete)
 {
     DeleteFundingEvent(fundingEvents, new List <FundingEvent> {
         fundingEventToDelete
     });
 }