コード例 #1
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            int Cortos = ToInt(CantidadCortosTextBox.Text);
            int Largos = ToInt(CantidadLargosTextBox.Text);

            MyTimer.Enabled = false;
            if (VendidosDataGridView.DataSource == null)
            {
                MessageBox.Show("No hay valores", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            else
            {
                Grafico form = new Grafico(Cortos, Largos);
                form.ShowDialog();
            }
        }
コード例 #2
0
        private void Iniciar()
        {
            int    Cantidad = 1;
            int    Precio   = 0;
            string Tipo     = "";
            Random random   = new Random();
            int    rand     = 0;

            for (int i = 1; i <= Conteo; i++)
            {
                rand = random.Next(1, 5);
                if (rand == 2 || rand == 4)
                {
                    Tipo   = "Corto";
                    Precio = 100;
                }
                if (rand == 3 || rand == 1)
                {
                    Tipo   = "Largo";
                    Precio = 200;
                }

                TipoTextBox.Text     = Tipo;
                PrecioTextBox.Text   = Precio.ToString();
                CantidadTextBox.Text = Cantidad.ToString();

                Cantidad++;
                random = new Random();
            }
            if (Conteo == 168)
            {
                int     Cortos = ToInt(CantidadCortosTextBox.Text);
                int     Largos = ToInt(CantidadLargosTextBox.Text);
                Grafico form   = new Grafico(Cortos, Largos);
                form.ShowDialog();
            }
        }