string CalculateAmountColor(CarLoadDocumentItem item) { if (item.Amount > item.AmountInStock) return "red"; if(item.Equipment == null) { if (item.AmountInRouteList < item.AmountLoaded + item.Amount) return "orange"; if (item.AmountInRouteList == item.AmountLoaded + item.Amount) return "green"; if (item.AmountInRouteList > item.AmountLoaded + item.Amount) return "blue"; } else { if (1 < item.AmountLoaded + item.Amount) return "orange"; if (1 == item.AmountLoaded + item.Amount) return "green"; if (1 > item.AmountLoaded + item.Amount) return "blue"; } return "black"; }
public virtual void AddItem(CarLoadDocumentItem item) { item.Document = this; ObservableItems.Add (item); }