示例#1
0
        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;
            }
        }
示例#2
0
        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();
        }
示例#3
0
        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();
            }
        }