Exemplo n.º 1
0
        private void ServirCopa(object sender, EventArgs e)
        {
            PictureBox pb      = (PictureBox)sender;
            Botella    botella = (Botella)pb.Tag;
            // Muevo la botella a ser servida



            Point ubicacion = pb.Location;

            pb.Location = new System.Drawing.Point(125, 125);

            int cantidadServida = botella.ServirMedida();

            if (cantidadServida == 0)
            {
                MessageBox.Show("No hay mas Liquido!");
            }
            else
            {
                MessageBox.Show(string.Format("SIRVIENDO! {1}ml\n{0}", botella.ToString(), cantidadServida), "Cantinero", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

            pb.Location = ubicacion;
        }
Exemplo n.º 2
0
        private void ServirCopa(object sender, EventArgs e)
        {
            PictureBox pb      = (PictureBox)sender;
            Botella    botella = (Botella)pb.Tag;
            // Muevo la botella a ser servida
            Point ubicacion = pb.Location;

            pb.Location = new System.Drawing.Point(125, 125);
            string mensaje = "SIRVIENDO!";

            int cantidadServida = botella.ServirMedida();

            if (cantidadServida == 0)
            {
                mensaje = "No queda más líquido!";
            }
            MessageBox.Show(string.Format("{2} {1}ml\n{0}", botella.ToString(), cantidadServida, mensaje), "Cantinero", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

            pb.Location = ubicacion;
        }