Esempio n. 1
0
        public UnitIndex(AbstractUnitIndexId abstractUnitIndexId, Period period, SharedUnitIndex sharedUnitIndex, UnitIndexGroup group, bool isInquireable, long calculationLevel = 1, int calculationOrder = 1)
        {
            if (period == null)
            {
                throw new ArgumentNullException("period");
            }
            period.CheckAssigningUnitIndex();
            if (sharedUnitIndex == null)
            {
                throw new ArgumentNullException("sharedUnitIndex");
            }
            if (group == null)
            {
                throw new ArgumentNullException("group");
            }

            if (!group.PeriodId.Equals(period.Id))
            {
                throw new UnitIndexCompareException("UnitIndex", "UnitIndexGroup", "Period");
            }
            this.calculationLevel = calculationLevel;

            // must be check periodId
            id                    = abstractUnitIndexId;
            periodId              = period.Id;
            this.group            = group;
            this.sharedUnitIndex  = sharedUnitIndex;
            this.isInquireable    = isInquireable;
            this.calculationOrder = calculationOrder;
        }