private async void orderClick(object sender, EventArgs e) { sendDumbyFocus(); if (lastClicked != null) { int orderNum = await Firebase.GetAsync <int>("", "next_order"); await Firebase.InsertAsync <int>("", "next_order", orderNum + 1); Order order = new Order { OrderNum = orderNum, OrderString = orderTextbox.Text, Status = "placed", TableNum = Helper.GetTableNumber(lastClicked), Waiter = user.username }; var orderKey = Helper.GetOrderKey(orderNum); await Firebase.InsertAsync <Order>("Orders", orderKey, order); orderTextbox.Text = ""; lastOrder = orderKey; undoButton.Enabled = true; comfirmLabel.Visible = true; Thread.Sleep(TimeSpan.FromSeconds(5)); comfirmLabel.Visible = false; } }
private async void SetClickAsync(object sender, EventArgs e) { var temp = new Waiter { Username = user.username, Clockout = Time_Box.Text }; await Firebase.InsertAsync <Waiter>("Waiters", temp.Username, temp); this.Close(); }
private async void confirmClick(object sender, EventArgs e) { if (firstBox.Text != "" && lastBox.Text != "" && passBox.Text != "" && typeBox.Text != "") { var temp = new Employee() { Username = firstBox.Text.ToLower(), FirstName = firstBox.Text, LastName = lastBox.Text, PassHash = Hash.ComputeSha256Hash(passBox.Text), UserType = typeBox.Text.ToLower() }; await Firebase.InsertAsync <Employee>("Employees", temp.Username, temp); this.Close(); } }