private void button4_Click(object sender, EventArgs e) { if (txtriesgo.Text != "Alto" && txtriesgo.Text != "Medio" && txtriesgo.Text != "Bajo") { MessageBox.Show("Llene todos los campos obligatorios"); return; } if (txtriesgo.Text == "Alto") { riesgo = 1; } if (txtriesgo.Text == "Medio") { riesgo = 2; } if (txtriesgo.Text == "Bajo") { riesgo = 3; } Base_de_datos.Actualizar_Riesgo(riesgo, txtcita.Text); MessageBox.Show("Se ha guardado con exito"); if (MessageBox.Show("Desea regresar al menu?", "Confirmar", MessageBoxButtons.YesNo) == DialogResult.Yes) { this.Hide(); } }
private void button5_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtriesgo.Text) == false) { MessageBox.Show("Llene todos los campos obligatorios"); return; } string h; h = txtriesgo.SelectedItem.ToString(); int B; B = Base_de_datos.Buscar_codigo_nivel(txtriesgo.SelectedItem.ToString()); Base_de_datos.Actualizar_Riesgo(B, txtcita.Text); Base_de_datos.cita = txtcita.Text; Generar_factura a = new Generar_factura(); a.ShowDialog(); }