예제 #1
0
        public void Add(IInvoicePosition position)
        {
            position.CheckArgument(nameof(position));

            var pos = new InvoicePosition();

            pos.CopyProperties(position);
            PositionEntities.Add(pos);
        }
예제 #2
0
        public void Remove(IInvoicePosition position)
        {
            position.CheckArgument(nameof(position));

            var pos = PositionEntities.FirstOrDefault(i => (i.Id != 0 && i.Id == position.Id) || (i.Id == 0 && i.Text != null && i.Text.Equals(position.Text)));

            if (pos != null)
            {
                PositionEntities.Remove(pos);
            }
        }
예제 #3
0
        public void CopyProperties(IInvoicePosition other)
        {
            other.CheckArgument(nameof(other));

            Id            = other.Id;
            Order         = other.Order;
            Text          = other.Text;
            Quantity      = other.Quantity;
            Tax           = other.Tax;
            Price         = other.Price;
            InvoiceHeadId = other.InvoiceHeadId;
        }