private void btnProductos_Click(object sender, EventArgs e)
        {
            ConsultarProductos ConPro = new ConsultarProductos();

            ConPro.ShowDialog();
            //double comparacion;
            //string extraer


            if (ConPro.DialogResult == DialogResult.OK)
            {
                double extraer = Convert.ToDouble(ConPro.dataGridView1.Rows[ConPro.dataGridView1.CurrentRow.Index].Cells[3].Value.ToString());
                if (extraer == 0)
                {
                    MessageBox.Show("No hay productos existentes");
                }
                else
                {
                    txtCodigoPro.Text   = ConPro.dataGridView1.Rows[ConPro.dataGridView1.CurrentRow.Index].Cells[0].Value.ToString();
                    txtDescripcion.Text = ConPro.dataGridView1.Rows[ConPro.dataGridView1.CurrentRow.Index].Cells[1].Value.ToString();
                    txtPrecio.Text      = ConPro.dataGridView1.Rows[ConPro.dataGridView1.CurrentRow.Index].Cells[2].Value.ToString();
                    txtCantidad.Focus();
                }
            }
        }
Пример #2
0
        private void productoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ConsultarProductos conPro = new ConsultarProductos();

            conPro.MdiParent = this;
            conPro.Show();
        }
        private void productosToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            ConsultarProductos ConPro = new ConsultarProductos(); //Se crea la instancia

            ConPro.MdiParent = this;                              //Se especifica que pertenece al contenedor mdi para que se muestre ahi.
            ConPro.Show();                                        //Se muestra.
        }
Пример #4
0
        private void btnProductos_Click(object sender, EventArgs e)
        {
            ConsultarProductos conPro = new ConsultarProductos();

            conPro.ShowDialog();
            if (conPro.DialogResult == DialogResult.OK)
            {
                txtCodigoPro.Text   = conPro.dataGridView1.Rows[conPro.dataGridView1.CurrentRow.Index].Cells[0].Value.ToString();
                txtDescripcion.Text = conPro.dataGridView1.Rows[conPro.dataGridView1.CurrentRow.Index].Cells[1].Value.ToString();
                txtPrecio.Text      = conPro.dataGridView1.Rows[conPro.dataGridView1.CurrentRow.Index].Cells[2].Value.ToString();
                txtCantidad.Focus();
            }
        }
Пример #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            ConsultarProductos ConCli = new ConsultarProductos();

            ConCli.ShowDialog();

            if (ConCli.DialogResult == DialogResult.OK)
            {
                txtIdPro.Text  = ConCli.dataGridView1.Rows[ConCli.dataGridView1.CurrentRow.Index].Cells[0].Value.ToString();
                txtNomPro.Text = ConCli.dataGridView1.Rows[ConCli.dataGridView1.CurrentRow.Index].Cells[1].Value.ToString();
                txtPrePro.Text = ConCli.dataGridView1.Rows[ConCli.dataGridView1.CurrentRow.Index].Cells[2].Value.ToString();
            }
        }