|
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
+using System.Windows.Media;
|
|
|
|
|
|
namespace OOO_WriteAndClear.DBModels
|
|
|
{
|
|
@@ -17,5 +18,27 @@ namespace OOO_WriteAndClear.DBModels
|
|
|
public decimal OrderDiscount => OrderCostWithoutDiscount - OrderCost;
|
|
|
|
|
|
public decimal OrderDiscountPercent => 1 - (OrderCost / OrderCostWithoutDiscount);
|
|
|
+
|
|
|
+ public SolidColorBrush OrderBackGround
|
|
|
+ {
|
|
|
+ get
|
|
|
+ {
|
|
|
+ SolidColorBrush brush = (SolidColorBrush)new BrushConverter().ConvertFrom("#20b2aa");
|
|
|
+ foreach (var item in OrderProducts)
|
|
|
+ {
|
|
|
+ if (item.ProductArticleNumberNavigation.ProductQuantityInStock == 0)
|
|
|
+ {
|
|
|
+ brush = (SolidColorBrush)new BrushConverter().ConvertFrom("#ff8c00");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (item.ProductArticleNumberNavigation.ProductQuantityInStock <= 3)
|
|
|
+ {
|
|
|
+ brush = (SolidColorBrush)new BrushConverter().ConvertFrom("#ffffff");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return brush;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|