private void btnDrinkOrder_click(object sender, EventArgs e)
        {
            // Get values for a drink
            Drink drink = new Drink();

            drink.strIngredient1 = TransporterClass.listContainer[0].Name;
            drink.strMeasure1    = FindViewById <EditText>(Resource.Id.txtbAmount1).Text + "cl";

            drink.strIngredient2 = TransporterClass.listContainer[1].Name;
            drink.strMeasure2    = FindViewById <EditText>(Resource.Id.txtbAmount2).Text + "cl";

            drink.strIngredient3 = TransporterClass.listContainer[2].Name;
            drink.strMeasure3    = FindViewById <EditText>(Resource.Id.txtbAmount3).Text + "cl";

            drink.strIngredient4 = TransporterClass.listContainer[3].Name;
            drink.strMeasure4    = FindViewById <EditText>(Resource.Id.txtbAmount4).Text + "cl";

            drink.strIngredient5 = TransporterClass.listContainer[4].Name;
            drink.strMeasure5    = FindViewById <EditText>(Resource.Id.txtbAmount5).Text + "cl";

            drink.strIngredient6 = TransporterClass.listContainer[5].Name;
            drink.strMeasure6    = FindViewById <EditText>(Resource.Id.txtbAmount6).Text + "cl";

            // Send values
            BarBot barbot = new BarBot(TransporterClass.bluetoothService);

            barbot.SendCocktailOrder(drink);
        }
Ejemplo n.º 2
0
        private void BtnConnect_Click(object sender, EventArgs e)
        {
            btService = TransporterClass.bluetoothService;
            barBot    = TransporterClass.barBot;

            Button btnSend = FindViewById <Button>(Resource.Id.btnSend);

            btnSend.Clickable = true;
            btnSend.Enabled   = true;
            FindViewById <Button>(Resource.Id.btnDisConnect).Enabled   = true;
            FindViewById <Button>(Resource.Id.btnUpdateBottle).Enabled = true;
            FindViewById <Button>(Resource.Id.btnOrderDrink).Enabled   = true;
        }
Ejemplo n.º 3
0
        private void BtnConnect_Click(object sender, EventArgs e)
        {
            // TODO: Dev deactivate

            Thread th = new Thread(() =>
            {
                bluetoothService = new BluetoothService(this);

                TransporterClass.bluetoothService = bluetoothService;

                barBot = new BarBot(bluetoothService);

                TransporterClass.barBot = barBot;


                if (bluetoothService.ConnectActivateBluetooth())
                {
                    barBot.GetIngridients(5000, TransporterClass.listContainer);

                    Thread.Sleep(750);

                    var newActivity = new Intent(this, typeof(CocktailListview));

                    StartActivity(newActivity);


                    this.Finish();

                    OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut);
                }
                else
                {
                    bluetoothService.ShowToastMessage("Could not connect", ToastLength.Long);
                }
            });

            th.Start();
        }
Ejemplo n.º 4
0
        private void DrinkOrder_Click(object sender, EventArgs e)
        {
            BarBot barbot = new BarBot(TransporterClass.bluetoothService);

            barbot.SendCocktailOrder(drink);
        }