private void button1_Click(object sender, EventArgs e) { if (dgvClientes.SelectedCells.Count > 0) { idcliente = Convert.ToInt32(dgvClientes.SelectedCells[0].Value.ToString()); Presupuesto.AnadirPresupuesto presupuesto = new Presupuesto.AnadirPresupuesto(false, idcliente, 0); presupuesto.ShowDialog(); } else { MessageBox.Show("Selecciona un Cliente"); } }
private void btnModificar_Click(object sender, EventArgs e) { //Si un cliente no tiene presupuesto no puede modificar presupuesto if (dgvPresupuesto.SelectedCells.Count > 0) { idcliente = Convert.ToInt32(dgvPresupuesto.SelectedCells[0].Value.ToString()); idpresupuesto = Convert.ToInt32(dgvPresupuesto.SelectedCells[1].Value.ToString()); AnadirPresupuesto anadir = new AnadirPresupuesto(true, idcliente, idpresupuesto); anadir.ShowDialog(); actualizarDGV(); } else { MessageBox.Show("Selecciona un registro"); } }
private void btnAñadirclientepresu_Click(object sender, EventArgs e) { idcliente = Convert.ToInt32(dgvClientes.SelectedCells[0].Value.ToString()); if (Ventana == true) { AnadirContrato contrato = new AnadirContrato(); contrato.ShowDialog(); this.Close(); } else { Presupuesto.AnadirPresupuesto presupuesto = new Presupuesto.AnadirPresupuesto(false, idcliente, 0); presupuesto.ShowDialog(); this.Close(); } }