Exemplo n.º 1
0
        public virtual void AddAddress(DeliveryPoint point)
        {
            var last = LastAddressesChanges;

            if (Addresses.Any(x => x.DeliveryPoint.Id == point.Id && x.StartAt == last))
            {
                logger.Warn("Адрес '{0}' уже добавлен, пропускаем.", point.CompiledAddress);
                return;
            }

            var address = new ContractLongLeaseAddress()
            {
                Contract      = this,
                DeliveryPoint = point,
                StartAt       = last
            };

            Addresses.Add(address);
            OnAddressesChanged(last);
        }
Exemplo n.º 2
0
 public virtual void RemoveAddress(ContractLongLeaseAddress address)
 {
     Addresses.Remove(address);
     OnAddressesChanged(address.StartAt);
 }