コード例 #1
0
        /// <summary>
        /// Loads the content of the datagrids
        /// </summary>
        /// <returns></returns>
        public async Task LoadDataGridData()
        {
            _orderRepo = new IncOrderRepository();

            // Gets all the incoming orders
            IncOrderList = new ObservableCollection <RudycommerceData.Entities.Orders.IncomingOrder>((await _orderRepo.GetAllAsync()));

            // Instanciate the ViewSource of the picking list datagrid
            ViewSourcePickingList = new CollectionViewSource()
            {
                Source = IncOrderList.Where(x => x.StatusCode == 0)
            };
            dgOrderOverview.ItemsSource = ViewSourcePickingList.View;
            dgOrderOverview.DataContext = IncOrderList;

            // Instanciate the ViewSource of the ready to be picked up orders datagrid
            ViewSourceToBePickedUp = new CollectionViewSource()
            {
                Source = IncOrderList.Where(x => x.StatusCode == 1)
            };
            dgOrderOverviewToBePickedUp.ItemsSource = ViewSourceToBePickedUp.View;
            dgOrderOverviewToBePickedUp.DataContext = IncOrderList;

            // Instanciate the ViewSource of the picking list datagrid
            ViewSourceUnderWay = new CollectionViewSource()
            {
                Source = IncOrderList.Where(x => x.StatusCode == 2)
            };
            dgOrderUnderWay.ItemsSource = ViewSourceUnderWay.View;
            dgOrderUnderWay.DataContext = IncOrderList;

            // Instanciate the ViewSource of the ready to be picked up orders datagrid
            ViewSourceDelivered = new CollectionViewSource()
            {
                Source = IncOrderList.Where(x => x.StatusCode == 3)
            };
            dgOrderDelivered.ItemsSource = ViewSourceDelivered.View;
            dgOrderDelivered.DataContext = IncOrderList;

            BindData();
        }
コード例 #2
0
        public OrderDetails(int id)
        {
            InitializeComponent();

            _orderRepo = new IncOrderRepository();
            _prodRepo  = new ProductRepository();

            // Gets the order
            OrderModel = _orderRepo.Get(id);

            // Sets the display language
            _preferredLanguage = Properties.Settings.Default.CurrentUser.PreferredLanguage;
            SetLanguageDictionary();

            // Gets all the product IDs from the incoming order lines, belonging to the incoming order.
            List <int> productIDs = OrderModel.IncomingOrderLines.Select(c => c.ProductID).Distinct().ToList();

            // Gets all the products that match the list of product IDs from the order
            ProductList = _prodRepo.GetAllQueryable().Where(x => productIDs.Contains(x.ID)).ToList();

            DisplayOrderLines();
        }
コード例 #3
0
 public OrdersController()
 {
     _clientRepo   = new ClientRepository();
     _prodRepo     = new ProductRepository();
     _incOrderRepo = new IncOrderRepository();
 }