internal static decimal GetProductPrice(vProductAndDescripttionExtendedENOnly product) { if (product.DiscountActive != null && product.DiscountActive.Value) { return product.DiscountValue != null ? product.ListPrice - (decimal)product.DiscountValue.Value : product.ListPrice * (decimal)(1 - product.DiscountProcent.Value / 100); } return product.ListPrice; }
private void UpdateArticleChoiseDropDown(IOrderedQueryable<vProductAndDescripttionExtendedENOnly> products, vProductAndDescripttionExtendedENOnly activeProduct) { if (ddlArticleChoises.Items.Count == 0) { foreach (var product in products) { ddlArticleChoises.Items.Add( new ListItem( $"{(product.Size != null ? $"Size {product.Size} " : string.Empty)}{(product.Color ?? string.Empty)}", product.ProductID.ToString())); } } ddlArticleChoises.SelectedValue = activeProduct.ProductID.ToString(); panelArticleOptions.Visible = true; }