Пример #1
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public MaintenanceRecordObservation(MaintenanceRecord maintenanceRecord, TreatmentBMPTypeCustomAttributeType treatmentBMPTypeCustomAttributeType, TreatmentBMPType treatmentBMPType, CustomAttributeType customAttributeType) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.MaintenanceRecordObservationID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.MaintenanceRecordID            = maintenanceRecord.MaintenanceRecordID;
     this.MaintenanceRecord = maintenanceRecord;
     maintenanceRecord.MaintenanceRecordObservations.Add(this);
     this.TreatmentBMPTypeCustomAttributeTypeID = treatmentBMPTypeCustomAttributeType.TreatmentBMPTypeCustomAttributeTypeID;
     this.TreatmentBMPTypeCustomAttributeType   = treatmentBMPTypeCustomAttributeType;
     treatmentBMPTypeCustomAttributeType.MaintenanceRecordObservations.Add(this);
     this.TreatmentBMPTypeID = treatmentBMPType.TreatmentBMPTypeID;
     this.TreatmentBMPType   = treatmentBMPType;
     treatmentBMPType.MaintenanceRecordObservations.Add(this);
     this.CustomAttributeTypeID = customAttributeType.CustomAttributeTypeID;
     this.CustomAttributeType   = customAttributeType;
     customAttributeType.MaintenanceRecordObservations.Add(this);
 }
Пример #2
0
 public static string GetDetailUrl(this MaintenanceRecord maintenanceRecord)
 {
     return(DetailUrlTemplate.ParameterReplace(maintenanceRecord.MaintenanceRecordID));
 }
Пример #3
0
 public static string GetEditUrl(this MaintenanceRecord maintenanceRecord)
 {
     return(EditUrlTemplate.ParameterReplace(maintenanceRecord.FieldVisit.FieldVisitID));
 }
Пример #4
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static MaintenanceRecordObservation CreateNewBlank(MaintenanceRecord maintenanceRecord, TreatmentBMPTypeCustomAttributeType treatmentBMPTypeCustomAttributeType, TreatmentBMPType treatmentBMPType, CustomAttributeType customAttributeType)
 {
     return(new MaintenanceRecordObservation(maintenanceRecord, treatmentBMPTypeCustomAttributeType, treatmentBMPType, customAttributeType));
 }
 public static void DeleteMaintenanceRecord(this IQueryable <MaintenanceRecord> maintenanceRecords, MaintenanceRecord maintenanceRecordToDelete)
 {
     DeleteMaintenanceRecord(maintenanceRecords, new List <MaintenanceRecord> {
         maintenanceRecordToDelete
     });
 }