Exemplo n.º 1
0
        public CourierMain(ref Courier cour)
        {
            linCourier = cour;
            InitializeComponent();
            CreateMyListView();
            listView1.Visible = false;
            listener          = db.CreateQueryForListener("orders", "CourierID", cour.CourierID).Listen(
                snapshot =>
            {
                orders = new List <Order>();
                foreach (DocumentSnapshot documentSnapshot in snapshot.Documents)
                {
                    Order o   = documentSnapshot.ConvertTo <Order>();
                    o.OrderID = documentSnapshot.Id;
                    orders.Add(o);
                }

                //orders.Sort((x, y) => x.Status.CompareTo(y.Status));

                orders = orders.OrderBy(order => order.Status).ToList();
                listView1.Invoke(new Action(() => { refreshOrdersList(); }));
            });
            //db.changeAvailabity(linCourier.CourierID, false);
        }
Exemplo n.º 2
0
        public async Task <WriteResult> AddCourier(Courier courier)
        {
            WriteResult writeResult = await Root.Collection("couriers").Document(courier.CourierID).SetAsync(courier);

            return(writeResult);
        }