private void btnCrearTipoGasto_Click(object sender, EventArgs e) { FormPermiso fp = new FormPermiso(); DialogResult DialogForm2 = fp.ShowDialog(); if (fp.Valor == true) { FormAgregarTipoDeGasto fm = new FormAgregarTipoDeGasto(user, "agregar", -1); DialogResult DialogForm = fm.ShowDialog(); if (fm.Valor != string.Empty) { cargarTodosLosGastos(); mostrarLabelStatus(fm.Valor, true); } } else { MessageBox.Show("El usuario o la contraseña son incorrectos para poder editar el viaje cerrado.", "No se pudo editar viaje.", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnEditarGasto_Click(object sender, EventArgs e) { if (filaSeleccionadaGasto >= 0) { FormPermiso fp = new FormPermiso(); DialogResult DialogForm2 = fp.ShowDialog(); if (fp.Valor == true) { FormAgregarTipoDeGasto fm = new FormAgregarTipoDeGasto(user, "editar", int.Parse(dgvGastos["idTipoGasto", filaSeleccionadaGasto].Value.ToString())); DialogResult DialogForm = fm.ShowDialog(); if (fm.Valor != string.Empty) { cargarTodosLosGastos(); mostrarLabelStatus(fm.Valor, true); } } else { MessageBox.Show("El usuario o la contraseña son incorrectos para poder editar el viaje cerrado.", "No se pudo editar viaje.", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }