public void Add(IInvoicePosition position) { position.CheckArgument(nameof(position)); var pos = new InvoicePosition(); pos.CopyProperties(position); PositionEntities.Add(pos); }
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); } }
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; }