Exemple #1
0
        private async void refreshOrdersList()
        {
            listView1.Columns.Clear();
            listView1.Items.Clear();
            listView1.Sorting = SortOrder.None;
            ListViewItem order;

            //orders = await db.ListRestaurantOrders(linRestaurant.RestaurantID);
            for (int i = 0; i < orders.Count; ++i)
            {
                string names = "";
                foreach (var food in orders[i].Foods)
                {
                    names += $"{food.Name}({food.Quantity}),";
                }
                //Debug.WriteLine(names.Length);
                names = names.Remove(names.Length - 1); // Leveszi az utolso vesszot

                order     = new ListViewItem(names, i);
                order.Tag = orders[i].OrderID;
                order.SubItems.Add(orders[i].OrderDate);
                order.SubItems.Add(orders[i].TakeAway?"Igen":"Nem");
                order.SubItems.Add(orders[i].Status.ToString());
                if (orders[i].CourierID != null)
                {
                    String name = await db.GetCourierName(orders[i].CourierID);

                    order.SubItems.Add(name);
                }
                else
                {
                    order.SubItems.Add("Nincs");
                }

                listView1.Items.Add(order);
            }
            listView1.Columns.Add("Ételek(db)", 40, HorizontalAlignment.Center);
            listView1.Columns.Add("Rendelési idő", 40, HorizontalAlignment.Center);
            listView1.Columns.Add("Elvitel", 40, HorizontalAlignment.Center);
            listView1.Columns.Add("Állapot", 40, HorizontalAlignment.Center);
            listView1.Columns.Add("Futár", 40, HorizontalAlignment.Center);
            listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
            acceptRefuseButton.Visible   = true;
            giveToDeliveryButton.Visible = true;
            DiscountButton.Visible       = false;
            orderShow           = true;
            doneButton.Visible  = true;
            readyButton.Visible = true;
        }
Exemple #2
0
        private async void refreshOrdersList()
        {
            listView1.Columns.Clear();
            listView1.Items.Clear();
            listView1.Sorting = SortOrder.None;
            ListViewItem order;

            //orders = await db.ListRestaurantOrders(linRestaurant.RestaurantID);
            for (int i = 0; i < orders.Count; ++i)
            {
                string names = "";
                foreach (var food in orders[i].Foods)
                {
                    names += $"{food.Name}({food.Quantity}),";
                }
                //Debug.WriteLine(names.Length);
                names = names.Remove(names.Length - 1); // Leveszi az utolso vesszot

                order     = new ListViewItem(orders[i].Address.ToString(), i);
                order.Tag = orders[i].OrderID;
                order.SubItems.Add(names);
                order.SubItems.Add(orders[i].OrderDate);
                order.SubItems.Add(orders[i].EstimatedDeliveryTime.ToString() + " perc");
                order.SubItems.Add(orders[i].Status.ToString());
                if (orders[i].CourierID != null)
                {
                    String name = await db.GetCourierName(orders[i].CourierID);

                    order.SubItems.Add(name);
                }
                else
                {
                    order.SubItems.Add("Nincs");
                }

                listView1.Items.Add(order);
            }
            listView1.Columns.Add("Cím", 40, HorizontalAlignment.Center);
            listView1.Columns.Add("Ételek(db)", 40, HorizontalAlignment.Center);
            listView1.Columns.Add("Rendelési idő", 40, HorizontalAlignment.Center);
            listView1.Columns.Add("Várható kiszállítási idő", 40, HorizontalAlignment.Center);
            listView1.Columns.Add("Állapot", 40, HorizontalAlignment.Center);
            listView1.Columns.Add("Futár", 40, HorizontalAlignment.Center);
            listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
        }