private void cmdEditar_Click(object sender, EventArgs e) { if (cmdEditar.Text != "Seleccionar") { if (cmdEditar.Text == "Agregar") { _altaCliente = new AltaCliente(this, cmdEditar.Text[0]); } else { _altaCliente = AltaCliente.Crear(this, cmdEditar.Text[0], dgvClientes.SelectedRows[0].Cells["Id"].Value.ToString()); } _altaCliente.Show(); this.Hide(); } else { if (dgvClientes.SelectedRows.Count > 0) { if (_altaFactura != null) { _altaFactura.CargarCliente(dgvClientes.SelectedRows[0].Cells["Id"].Value.ToString(), dgvClientes.SelectedRows[0].Cells["Nombre"].Value.ToString() + " " + dgvClientes.SelectedRows[0].Cells["Apellido"].Value.ToString()); _altaFactura.Show(); } else { _listarFacturas.CargarCliente(dgvClientes.SelectedRows[0].Cells["Id"].Value.ToString(), dgvClientes.SelectedRows[0].Cells["Nombre"].Value.ToString() + " " + dgvClientes.SelectedRows[0].Cells["Apellido"].Value.ToString()); _listarFacturas.Show(); } this.Close(); } } }
private void button1_Click(object sender, EventArgs e) { Form alta = new AbmFactura.AltaFactura(this); alta.Show(); this.Hide(); }