Esempio n. 1
0
        public static ListViewItem[] GenerateItems(Statistics statistics)
        {
            List <ListViewItem> collection = new List <ListViewItem>();

            if (statistics != null)
            {
                String dateTimeFormat            = "dd.MM.yyyy HH:mm";
                ManagerDataPresenters presenters = new ManagerDataPresenters();

                foreach (Order order in statistics.GetOrders())
                {
                    string[] row =
                    {
                        order.OrderTime.ToString(dateTimeFormat),
                        order.DeliveredTime == null ? "null" : order.DeliveredTime.Value.ToString(dateTimeFormat),
                        presenters.getPizzaRender(order).Render(),
                        presenters.getDriverRender(order).Render(),
                        presenters.getFilialAddressRender(order).Render(),
                        presenters.getDeliveryAddressRender(order).Render()
                    };

                    ListViewItem item = new ListViewItem(row);
                    collection.Add(item);
                }
            }

            return(collection.ToArray());
        }
Esempio n. 2
0
        private void OnUpdateRecomendationsInternal()
        {
            listViewRecomendations.Items.Clear();
            if (_recommendations != null)
            {
                ManagerDataPresenters presenters = new ManagerDataPresenters();

                foreach (KeyValuePair <int, int> pair in _recommendations.GetReplacements())
                {
                    string[] row =
                    {
                        presenters.getFilialAddressRender(pair.Key).Render(),
                        presenters.getFilialAddressRender(pair.Value).Render()
                    };

                    ListViewItem item = new ListViewItem(row);
                    listViewRecomendations.Items.Add(item);
                }
            }
        }