示例#1
0
        private void SendUpdates_Click(object sender, EventArgs e)
        {
            List <Update> updates = Database.GetUpdates();

            if (updates.Count == 0)
            {
                sendProgress.Text = "No Updates to Send.";
                return;
            }

            if (BlueTooth.Test())
            {
                sendProgress.Text = "Failed to Send Updates.";
                return;
            }
            else
            {
                sendProgress.Text = "Sending Updates...";

                foreach (Update update in updates)
                {
                    BlueTooth.SendRecord(update.UpdateText);
                }
            }

            sendProgress.Text = "Updates Sent.";

            Database.ClearUpdates();
        }
示例#2
0
        public void SendOrder(OrderModel model)
        {
            BlueTooth.SaveOrder(model);

            foreach (OrderItemModel itemModel in model.OrderItems)
            {
                BlueTooth.AddOrderItem(itemModel);

                foreach (OrderItemComponentModel componentModel in itemModel.ComponentModels)
                {
                    //OrderItemComponent newComponent = new OrderItemComponent(0, itemModel.Id, componentModel.Id, componentModel.Portions);
                    BlueTooth.AddOrderItemComponent(componentModel);

                    foreach (OrderItemComponentComponentModel subComponentModel in componentModel.Components)
                    {
                        BlueTooth.AddOrderItemComponentComponent(subComponentModel);
                    }
                }
            }

            BlueTooth.SendRecord("END_OF_ORDER");
        }