示例#1
0
        private void dgvClientes_DoubleClick(object sender, EventArgs e)
        {
            switch (tipoForma)
            {
            case "F":
                Factura fac = (Factura)Owner;
                fac.txtCodCliente.Text    = dgvClientes.CurrentRow.Cells[1].Value.ToString();
                fac.txtNombreCliente.Text = dgvClientes.CurrentRow.Cells[2].Value.ToString();
                fac.agegarCliente();
                this.Close();
                break;

            case "P":
                Pedido ped = (Pedido)Owner;
                ped.txtCodCliente.Text    = dgvClientes.CurrentRow.Cells[1].Value.ToString();
                ped.txtNombreCliente.Text = dgvClientes.CurrentRow.Cells[2].Value.ToString();
                this.Close();
                break;

            case "D":
                Devolucion dev = (Devolucion)Owner;
                dev.txtCodCliente.Text    = dgvClientes.CurrentRow.Cells[1].Value.ToString();
                dev.txtNombreCliente.Text = dgvClientes.CurrentRow.Cells[2].Value.ToString();
                this.Close();
                break;

            case "FP":
                FacturarPedido fped = (FacturarPedido)Owner;
                fped.txtCodCliente.Text    = dgvClientes.CurrentRow.Cells[1].Value.ToString();
                fped.txtNombreCliente.Text = dgvClientes.CurrentRow.Cells[2].Value.ToString();
                this.Close();
                break;

            case "C":
                Compra com = (Compra)Owner;
                com.txtCodCliente.Text    = dgvClientes.CurrentRow.Cells[1].Value.ToString();
                com.txtNombreCliente.Text = dgvClientes.CurrentRow.Cells[2].Value.ToString();
                this.Close();
                break;
            }
        }
示例#2
0
        private void dgvArticulos_DoubleClick(object sender, EventArgs e)
        {
            switch (tipoForma)
            {
            case "F":
                Factura fac = (Factura)Owner;
                fac.articuloSeleccionado = dgvArticulos.CurrentRow.Cells[0].Value.ToString();
                fac.agregarArticulo();
                this.Close();
                break;

            case "P":
                Pedido ped = (Pedido)Owner;
                ped.articuloSeleccionado = dgvArticulos.CurrentRow.Cells[0].Value.ToString();
                this.Close();
                break;

            case "D":
                Devolucion dev = (Devolucion)Owner;
                dev.articuloSeleccionado = dgvArticulos.CurrentRow.Cells[0].Value.ToString();
                this.Close();
                break;

            case "FP":
                FacturarPedido fped = (FacturarPedido)Owner;
                fped.articuloSeleccionado = dgvArticulos.CurrentRow.Cells[0].Value.ToString();
                this.Close();
                break;

            case "C":
                Compra com = (Compra)Owner;
                com.articuloSeleccionado = dgvArticulos.CurrentRow.Cells[0].Value.ToString();
                this.Close();
                break;
            }
        }