Example #1
0
 public EntityEntitySales(EntitySales pos)
 {
     Id          = pos.Id;
     BasePointId = pos.BasePointId;
     Address     = pos.Address;
     Deal        = pos.Deal;
 }
        public EntityEntity(EntitySales pos, EntityNumber Entity, EntitySystematicType Systematic, DateTime validFrom, DateTime?validTo = null, bool isTest = false)
        {
            Id = Guid.NewGuid();
            if (pos == null)
            {
                throw new ArgumentNullException(nameof(pos));
            }
            if (pos.Id == Guid.Empty)
            {
                throw new InvalidOperationException("Пустой идентификатор пункта продажи");
            }
            if (pos.Deal == null)
            {
                throw new InvalidOperationException("Пустая информация об агенте");
            }
            if (pos.Deal.Code == null)
            {
                throw new InvalidOperationException("Пустой код агента");
            }

            EntitySales = new EntityEntitySales(pos);

            Number     = Entity.NumberAsIs;
            Systematic = Systematic;
            ValidFrom  = validFrom;
            ValidTo    = validTo ?? DefaultDateTo;
            IsTest     = isTest;
            _Places    = new List <EntityPlace>();
            _SrnPools  = new List <SrnPool>();
        }