Example #1
0
        public virtual void ChangeUnitGroup(UnitGroup newGroup)
        {
            if (newGroup == null || newGroup == UnitGroup)
            {
                return;
            }

            _unitGroup = newGroup;

            newGroup.AddUnit(this);
        }
Example #2
0
        public static Unit Create(UnitDto dto, UnitGroup group)
        {
            var unit = new Unit
            {
                Abbreviation = dto.Abbreviation,
                IsReference  = dto.IsReference,
                Name         = dto.Name,
                Multiplier   = dto.Multiplier
            };

            unit.SetUnitGroup(group);
            Validate(unit);
            return(unit);
        }
Example #3
0
 public virtual bool CannotChangeGroup(UnitGroup newGroup)
 {
     return(Products.UnitGroup.Equals(newGroup, _unitGroup, new UnitGroupComparer()));
 }
Example #4
0
 private void SetUnitGroup(UnitGroup group)
 {
     ChangeUnitGroup(group);
 }