public async Task <IActionResult> Edit(int id, [Bind("BomboId,Num_bombo,Capacidad,FechaIngreso")] Bombo bombo)
        {
            if (id != bombo.BomboId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bombo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BomboExists(bombo.BomboId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(bombo));
        }
Exemple #2
0
    protected void OnBJugarClicked(object sender, EventArgs e)
    {
        int   x;
        Bombo bombo1 = new Bombo();

        x = bombo1.sacarBola();
    }
Exemple #3
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();
        Bombo bombo = new Bombo();
        Panel panel = new Panel(vbox);

        BJugar.Clicked += delegate {
            int numero = bombo.sacarBola();
            panel.Marcar(numero);
        };
    }
        public async Task <IActionResult> Create([Bind("BomboId,Num_bombo,Capacidad,FechaIngreso")] Bombo bombo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bombo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(bombo));
        }
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();

        Panel panel = new Panel(caja);
        Bombo bombo = new Bombo();

        buttonSiguiente.Clicked += delegate
        {
            int numero = bombo.sacarBola();
            panel.Marcar(numero);
            buttonSiguiente.Sensitive = bombo.quedanBolas();
            //if (!bombo.quedanBolas())
            //buttonSiguiente.Sensitive = false;
        };


        ////Button[] buttons = new Button[90]
        //Random random = new Random();
        //List<int> numeros = new List<int>();
        //numeros = rellenarLista(numeros);
        //List<Button> buttons = new List<Button>();

        //for (int i = 1; i < 91; i++){
        //    Button button = new Button();
        //    button.Label = i.ToString();
        //    buttons.Add(button);
        //}

        //int cont = 0;
        //for (int row = 0; row < 9; row++)
        //    for (int column = 0; column < 10; column++)
        //    {
        //        Button button = buttons[cont];
        //        cont++;
        //        table.Attach(button, (uint)column, (uint)column + 1, (uint)row, (uint)row+1);
        //    }

        //table.ShowAll();

        //cont = 90;
        //buttonSiguiente.Clicked += delegate {

        //    int numAleatorio = random.Next(cont)-1;
        //    labelNumero.Text = numeros[numAleatorio].ToString();

        //    buttons[numeros[numAleatorio]].ModifyBg(StateType.Normal, COLOR_GREEN);
        //    numeros.Remove(numeros[numAleatorio]);
        //    cont--;

        //};
    }
Exemple #6
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();
        Panel panel = new Panel(vBox);
        Bombo bombo = new Bombo();

        button2.Clicked += delegate {
            int numero = bombo.sacarBola();
            Console.WriteLine("Se ha de marcar el número: " + numero);
            panel.Marcar(numero);
            button2.Sensitive = bombo.quedanBolas();
        };
    }
Exemple #7
0
	public MainWindow () : base (Gtk.WindowType.Toplevel)
	{
		Build ();

		Panel panel = new Panel (vBoxMain);
		Bombo bombo = new Bombo ();

		Button.Adelante.Clicked += delegate {
			int bola = bombo.SacarBola ();
			panel.MarcarNumero(bola);

			//nuevo
			buttonAdelante.Sensitive = bombo.QuedanBolas();
		};
Exemple #8
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();

        Panel panel = new Panel(vbox);
        Bombo bombo = new Bombo();

        buttonAdelante.Clicked += delegate {
            int numero = bombo.sacarBola();
            panel.Marcar(32);
            buttonAdelante.Sensitive = bombo.quedanBolas();
            Console.WriteLine("Pulsado boton adelante");
        };
    }
Exemple #9
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();
        Panel panel = new Panel(vBox);
        Bombo bombo = new Bombo();

        buttonAdelante.Clicked += delegate
        {
            int num = bombo.SacarBola();
            panel.Marcar(num);
            buttonAdelante.Sensitive = bombo.quedanBolas();
            //if (!bombo.quedanBolas())
            // buttonAdelante.Sensitive = false;
        };
    }
Exemple #10
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();
        Panel panel = new Panel(vBox);
        Bombo bombo = new Bombo();

        buttonAdelante.Clicked += delegate {
            int numero = bombo.sacarBola();
            panel.Marcar(numero);
            buttonAdelante.Sensitive = bombo.quedanBolas();
            //if (!bombo.quedanBolas())
            //buttonAdelante.Sensitive = false;
            Console.WriteLine("buttonAdelante pulsado");
        };
    }
Exemple #11
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();
        Bombo bombo = new Bombo();
        Panel panel = new Panel();

        vBoxMain.Add(panel.Table);         // c#
        // vBoxMain.Add (panel.getTable()); //JAVA

        buttonGoForward.Clicked += delegate {
            int bola = bombo.SacarBola();
            panel.MarcarNumero(bola);
            Process.Start("espeak", " -v es " + EspeakHelper.ToEspeak(bola));
            buttonGoForward.Sensitive = bombo.QuedanBolas();
        };
    }
Exemple #12
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();
        Panel panel = new Panel(vbox1);
        Bombo bombo = new Bombo();

        buttonAdelante.Clicked += delegate
        {
            int numero = bombo.sacarBola();
            panel.Marcar(numero);
            if (!bombo.quedanBolas())
            {
                buttonAdelante.Sensitive = false;
            }
            Console.WriteLine("buttonAdelante pulsado");
        };


        //Button[] buttons = new Button[90];//

        /* List<Button> buttons = new List<Button>();
         *
         * int num = 1;
         * for (int row = 0; row < 9; row++)
         * {
         *   for (int column = 0; column < 10; column++)
         *   {
         *       Button button = new Button();
         *       button.Label = num++.ToString();
         *       table.Attach(button, (uint)column, (uint)column + 1, (uint)row, (uint)row + 1);
         *       buttons.Add(button);
         *   }
         * }
         *
         * table.ShowAll();
         *
         * Random random = new Random();
         * buttonAdelante.Clicked += delegate
         * {
         *   int numeroAleatorio = random.Next(90) + 1;
         *   labelNumero.Text = numeroAleatorio.ToString();
         *   buttons[numeroAleatorio - 1].ModifyBg(StateType.Normal, COLOR_CIAN);
         * };*/
    }
Exemple #13
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();

        Panel panel = new Panel(vBox);
        Bombo bombo = new Bombo();

        /*
         * //variables
         * Table table = new Table(3, 3, true);
         * int index = 0;
         *
         * for (int row = 0; row < 3; row++)
         *  for(int column = 0; column<3; column++)
         *  {
         *
         *      index++;
         *      Button button = new Button();
         *      table.Attach(button, (uint)column, (uint)column + 1, (uint)row, (uint)row + 1);
         *
         *      //añade una etiqueta un nombre a los botones
         *      //button.Label = "Button";
         *
         *      button.Label = index.ToString();
         *      button.Clicked +=delegate
         *      {
         *          //dar color a los botones
         *          button.ModifyBg(StateType.Normal, new Gdk.Color(100, 200, 250));
         *
         *      };
         *  }
         * //añade a la tabla los botones
         * vBox.Add(table);
         * //crea una tabla con los botones
         * table.ShowAll();*/
    }
Exemple #14
0
 public BOM()
 {
     BO = new Bombo();
 }