/// <summary>
 /// Constructor for building a new simple object with the POCO class
 /// </summary>
 public PerformanceMeasureActualUpdateSimple(PerformanceMeasureActualUpdate performanceMeasureActualUpdate) : this()
 {
     PerformanceMeasureActualUpdateID = performanceMeasureActualUpdate.PerformanceMeasureActualUpdateID;
     ProjectUpdateBatchID             = performanceMeasureActualUpdate.ProjectUpdateBatchID;
     PerformanceMeasureID             = performanceMeasureActualUpdate.PerformanceMeasureID;
     CalendarYear = performanceMeasureActualUpdate.CalendarYear;
     ActualValue  = performanceMeasureActualUpdate.ActualValue;
     PerformanceMeasureActualSubcategoryOptionUpdates = PerformanceMeasureValueSubcategoryOption.GetAllPossibleSubcategoryOptions(performanceMeasureActualUpdate);
 }
 public PerformanceMeasureActualSubcategoryOptionUpdateSimple(PerformanceMeasureValueSubcategoryOption performanceMeasureActualSubcategoryOption,
                                                              PerformanceMeasureActualUpdate performanceMeasureActualUpdate)
     : this(
         performanceMeasureActualSubcategoryOption.PrimaryKey,
         performanceMeasureActualUpdate.PerformanceMeasureActualUpdateID,
         performanceMeasureActualSubcategoryOption.PerformanceMeasureSubcategoryOptionID,
         performanceMeasureActualSubcategoryOption.PerformanceMeasureID,
         performanceMeasureActualSubcategoryOption.PerformanceMeasureSubcategoryID)
 {
 }
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public PerformanceMeasureActualSubcategoryOptionUpdate(PerformanceMeasureActualUpdate performanceMeasureActualUpdate, PerformanceMeasureSubcategoryOption performanceMeasureSubcategoryOption, PerformanceMeasure performanceMeasure, PerformanceMeasureSubcategory performanceMeasureSubcategory) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.PerformanceMeasureActualSubcategoryOptionUpdateID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.PerformanceMeasureActualUpdateID = performanceMeasureActualUpdate.PerformanceMeasureActualUpdateID;
     this.PerformanceMeasureActualUpdate   = performanceMeasureActualUpdate;
     performanceMeasureActualUpdate.PerformanceMeasureActualSubcategoryOptionUpdates.Add(this);
     this.PerformanceMeasureSubcategoryOptionID = performanceMeasureSubcategoryOption.PerformanceMeasureSubcategoryOptionID;
     this.PerformanceMeasureSubcategoryOption   = performanceMeasureSubcategoryOption;
     performanceMeasureSubcategoryOption.PerformanceMeasureActualSubcategoryOptionUpdates.Add(this);
     this.PerformanceMeasureID = performanceMeasure.PerformanceMeasureID;
     this.PerformanceMeasure   = performanceMeasure;
     performanceMeasure.PerformanceMeasureActualSubcategoryOptionUpdates.Add(this);
     this.PerformanceMeasureSubcategoryID = performanceMeasureSubcategory.PerformanceMeasureSubcategoryID;
     this.PerformanceMeasureSubcategory   = performanceMeasureSubcategory;
     performanceMeasureSubcategory.PerformanceMeasureActualSubcategoryOptionUpdates.Add(this);
 }
コード例 #4
0
        /// <summary>
        /// Only public for unit testing
        /// </summary>
        public static PerformanceMeasureActualUpdate ClonePerformanceMeasureValue(ProjectUpdateBatch projectUpdateBatch,
                                                                                  IPerformanceMeasureValue performanceMeasureValueToClone,
                                                                                  int newCalendarYear,
                                                                                  double?actualValue)
        {
            var performanceMeasureActualUpdate = new PerformanceMeasureActualUpdate(projectUpdateBatch, performanceMeasureValueToClone.PerformanceMeasure, newCalendarYear)
            {
                ActualValue = actualValue
            };

            performanceMeasureActualUpdate.PerformanceMeasureActualSubcategoryOptionUpdates =
                performanceMeasureValueToClone.PerformanceMeasureSubcategoryOptions.Select(
                    performanceMeasureActualSubcategoryOption =>
                    new PerformanceMeasureActualSubcategoryOptionUpdate(performanceMeasureActualUpdate,
                                                                        performanceMeasureActualSubcategoryOption.PerformanceMeasureSubcategoryOption,
                                                                        performanceMeasureActualSubcategoryOption.PerformanceMeasure,
                                                                        performanceMeasureActualSubcategoryOption.PerformanceMeasureSubcategory)).ToList();
            return(performanceMeasureActualUpdate);
        }
コード例 #5
0
        /// <summary>
        /// Only public for unit testing
        /// </summary>
        public static PerformanceMeasureActualUpdate ClonePerformanceMeasureValue(ProjectUpdateBatch projectUpdateBatch,
                                                                                  IPerformanceMeasureValue performanceMeasureValueToClone,
                                                                                  int newCalendarYear,
                                                                                  double?actualValue)
        {
            var performanceMeasureReportingPeriod = HttpRequestStorage.DatabaseEntities.PerformanceMeasureReportingPeriods.GetOrCreatePerformanceMeasureReportingPeriod(newCalendarYear);

            Check.EnsureNotNull(performanceMeasureReportingPeriod, "We need to have a performance measure reporting period here");
            var performanceMeasureActualUpdate = new PerformanceMeasureActualUpdate(projectUpdateBatch, performanceMeasureValueToClone.PerformanceMeasure, performanceMeasureReportingPeriod)
            {
                ActualValue = actualValue
            };

            performanceMeasureActualUpdate.PerformanceMeasureActualSubcategoryOptionUpdates =
                performanceMeasureValueToClone.GetPerformanceMeasureSubcategoryOptions().Select(
                    performanceMeasureActualSubcategoryOption =>
                    new PerformanceMeasureActualSubcategoryOptionUpdate(performanceMeasureActualUpdate,
                                                                        performanceMeasureActualSubcategoryOption.PerformanceMeasureSubcategoryOption,
                                                                        performanceMeasureActualSubcategoryOption.PerformanceMeasure,
                                                                        performanceMeasureActualSubcategoryOption.PerformanceMeasureSubcategory)).ToList();
            return(performanceMeasureActualUpdate);
        }
コード例 #6
0
        public static List <PerformanceMeasureActualSubcategoryOptionUpdateSimple> GetAllPossibleSubcategoryOptions(PerformanceMeasureActualUpdate performanceMeasureActualUpdate)
        {
            var allPossibleSubcategoryOptionsForPerformanceMeasureValue = GetAllPossibleSubcategoryOptionsForPerformanceMeasureValue(performanceMeasureActualUpdate);

            return(allPossibleSubcategoryOptionsForPerformanceMeasureValue.Select(x => new PerformanceMeasureActualSubcategoryOptionUpdateSimple(x, performanceMeasureActualUpdate)).ToList());
        }
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static PerformanceMeasureActualSubcategoryOptionUpdate CreateNewBlank(PerformanceMeasureActualUpdate performanceMeasureActualUpdate, PerformanceMeasureSubcategoryOption performanceMeasureSubcategoryOption, PerformanceMeasure performanceMeasure, PerformanceMeasureSubcategory performanceMeasureSubcategory)
 {
     return(new PerformanceMeasureActualSubcategoryOptionUpdate(performanceMeasureActualUpdate, performanceMeasureSubcategoryOption, performanceMeasure, performanceMeasureSubcategory));
 }
 public static void DeletePerformanceMeasureActualUpdate(this IQueryable <PerformanceMeasureActualUpdate> performanceMeasureActualUpdates, PerformanceMeasureActualUpdate performanceMeasureActualUpdateToDelete)
 {
     DeletePerformanceMeasureActualUpdate(performanceMeasureActualUpdates, new List <PerformanceMeasureActualUpdate> {
         performanceMeasureActualUpdateToDelete
     });
 }