public Order CancelLineItem(string sku) { if (States.Count > 1) { throw new CannotCancelOrderProductItemException(); } var product = OrderProducts.FirstOrDefault(x => x.Sku == sku); OrderProducts.Remove(product); CanceledOrderProducts.Add(product); TotalPrice -= product.Price * product.Quantity; TotalPriceWithVat -= product.PriceWithVat * product.Quantity; TotalVat -= product.Vat * product.Quantity; return(this); }
private void DeleteOrderCommand() { OrderProducts.Remove(ParameterOrder); RaisePropertyChangedEvent(nameof(OrderFillter)); LogAddDeleteOrder(); }