private void createSampleOrders() { for (int i = 0; i < 7; i++) { samplePendingOrder[i] = new PendingOrderLayout(i + 1000 + "", "Pizza | Ketchup \n Cola(500ml)"); pendingOrdersPanel.Controls.Add(samplePendingOrder[i]); } }
private void getOrders() { /*String URL = "https://food-order-bbcce.firebaseio.com/Orders.json"; * JObject data = JObject.Parse(ConnectionHandler.getRequest(URL)); * //JArray dataarr = (JArray)data; * //String status = data.SelectToken("status"); * JProperty parent = (JProperty)data.Parent; * //String name = parent.Name; * MessageBox.Show(data.Root.ToString()); * //MessageBox.Show(data.Values<string>.ToString()); * samplePendingOrder[0] = new PendingOrderLayout(data.Children().Values().ToString() , data["-M9Te98tJAds8ga9RT0h"]["status"].ToString()); * pendingOrdersPanel.Controls.Add(samplePendingOrder[0]);*/ String ordersString = ConnectionHandler.SocketClient(); String[] ordersList = ordersString.Split('/'); int pendingOrderNumber = 0; String[] order; for (int i = 0; i < ordersList.Length; i++) { order = ordersList[i].Split('_'); String items = ""; for (int k = 1; k < order.Length; k++) { items += order[k].ToString(); } samplePendingOrder[pendingOrderNumber] = new PendingOrderLayout(order[0].ToString(), items); pendingOrdersPanel.Controls.Add(samplePendingOrder[pendingOrderNumber]); pendingOrderNumber++; } }