private void BtnGuardar_Click(object sender, EventArgs e) { string msj; if (id == null) { msj = obj.Insert(txtDetalle.Text, "alta", Convert.ToInt32(cbPaciente.SelectedValue), dpFecha.Value.Date, txtHora.Text, Convert.ToInt32(cbMedico.SelectedValue), objE.RecuperarUltimo()); MessageBox.Show(msj, "Clinica", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { msj = obj.Edit(id, txtDetalle.Text, "edit", Convert.ToInt32(cbPaciente.SelectedValue), dpFecha.Value.Date, txtHora.Text, Convert.ToInt32(cbMedico.SelectedValue), objE.RecuperarUltimo()); MessageBox.Show(msj, "Clinica", MessageBoxButtons.OK, MessageBoxIcon.Information); } this.Close(); }