public CancelBlockVM() { IndividualBlock = new IndividualBlock(); Block = new ObservableCollection <Block>(db.Blocks.Where(o => o.BlockStatusID == 5).ToList()); CancelBlockCommand = new DelegateCommand(CancleBlockPredicate, CancelBlockAction); DashBoardPageCommand = new DelegateCommand((obj) => true, TradersDashBoardAction); var statusIdValue = db.Block_status.Where(o => o.StatusName == "New").Select(s => s.BlockStatusId).FirstOrDefault(); BlockCheckedList = new ObservableCollection <CheckedBlock>(BlockToCheckedBlockMapper.ToCheckedBlockList(db.Blocks.Where(o => o.BlockStatusID == statusIdValue).ToList())); }
public TraderDashboardVM() { IndividualOrder = new IndividualOrder(); IndividualBlock = new IndividualBlock(); OrderInBlock = new ObservableCollection <Order>(); Order = new ObservableCollection <CheckedOpenOrder>(CheckedOpenOrderToOrderMapper.ToCheckedOrderList(db.Orders.Where(o => o.BlockID == null).ToList())); // OrderInBlock = db.Orders.ToList().Where(o => o.BlockID == 8); Block = new ObservableCollection <CheckedBlock>(BlockToCheckedBlockMapper.ToCheckedBlockList(db.Blocks.ToList())); ViewBlockOrdersCommand = new DelegateCommand(ViewBlockOrdersPredicate, ViewBlockOrdersAction); CreateNewBlockCommand = new DelegateCommand(CreaetNewBlockPredicte, CreateNewBlockAction); AddToExistingCommand = new DelegateCommand(AddToExistingPredicate, AddToExistingAction); EditBlockOrdersCommand = new DelegateCommand((obj) => true, EditBlockOrdersAction); CancelBlockOrdersCommand = new DelegateCommand((obj) => true, CancelBlockOrdersAction); ViewBlockCommand = new DelegateCommand((obj) => true, ViewBlockAction); SendToExchangeCommand = new DelegateCommand(SendToExchangePredicate, SendToExchangeAction); }