Example #1
0
        private void btnNuevo_Click(object sender, EventArgs e)
        {
            FormIngresarVenta form2 = new FormIngresarVenta();

            form2.FormClosed += new FormClosedEventHandler(form2_FormClosed);
            form2.ShowDialog();
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (validar == 1)
            {
                FormIngresarVenta frm = Owner as FormIngresarVenta;
                if (dataGridView1.SelectedRows.Count > 0)
                {
                    frm.label10.Text  = dataGridView1.CurrentRow.Cells[0].Value.ToString();
                    frm.textBox1.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString() + " " + dataGridView1.CurrentRow.Cells[3].Value.ToString();

                    this.Close();
                }
                else
                {
                    MessageBox.Show("Debe seleccionar una fila");
                }
            }

            if (validar == 2)
            {
                FormActualizarVenta frm = Owner as FormActualizarVenta;
                if (dataGridView1.SelectedRows.Count > 0)
                {
                    frm.textBox1.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString() + " " + dataGridView1.CurrentRow.Cells[3].Value.ToString();
                    frm.label10.Text  = dataGridView1.CurrentRow.Cells[0].Value.ToString();

                    this.Close();
                }
                else
                {
                    MessageBox.Show("Debe seleccionar una fila");
                }
            }
        }