private void btnAgregarTRA_Click(object sender, EventArgs e) { if (tratamientoSeleccionado != null) { ConsultaDetalle detalle = new ConsultaDetalle(); detalle.Item = tratamientoSeleccionado; detalle.Observaciones = txtObservacionesTRA.Text; detalle.Resultado = txtResultadoTRA.Text; int index = -1; foreach (ConsultaDetalle itemDetalle in listaTRA.Items) { if (itemDetalle.Item.Id == tratamientoSeleccionado.Id && itemDetalle.Item.Nombre.Equals(tratamientoSeleccionado.Nombre)) { index = listaTRA.Items.IndexOf(itemDetalle); } } if (index >= 0) { listaTRA.Items.RemoveAt(index); } listaTRA.Items.Add(detalle); listaTRA.ClearSelected(); LimpiarTratamiento(); } }
private void DetalleToolStripMenuItem_Click(object sender, EventArgs e) { Form formulario = new ConsultaDetalle(); formulario.MdiParent = this; formulario.Show(); }
private void btnAgregarPAT_Click(object sender, EventArgs e) { if (patologiaSeleccionada != null) { ConsultaDetalle detalle = new ConsultaDetalle(); detalle.Item = patologiaSeleccionada; detalle.Observaciones = txtObservacionesPAT.Text; int index = -1; foreach (ConsultaDetalle itemDetalle in listaPAT.Items) { if (itemDetalle.Item.Id == patologiaSeleccionada.Id) { index = listaPAT.Items.IndexOf(itemDetalle); } } if (index >= 0) { listaPAT.Items.RemoveAt(index); } listaPAT.Items.Add(detalle); listaPAT.ClearSelected(); LimpiarPatologia(); } }
private void btnBuscarEJ_Click(object sender, EventArgs e) { ConsultarEjercicio dialog = new ConsultarEjercicio(); dialog.Seleccionado = tratamientoSeleccionado as Ejercicio; dialog.PalabrasClave = ArmarPalabraClave(); if (dialog.ShowDialog(this) == DialogResult.OK) { tratamientoSeleccionado = dialog.Seleccionado; if (tratamientoSeleccionado != null) { txtDescripcionTRA.Text = tratamientoSeleccionado.ToString(); } detalleTRAT = null; txtObservacionesTRA.Text = string.Empty; txtResultadoTRA.Text = string.Empty; } else { LimpiarTratamiento(); } dialog.Dispose(); listaTRA.ClearSelected(); }
private void button1_Click(object sender, EventArgs e) { ConsultaDetalle dd = new ConsultaDetalle(); dd.paciente = (Paciente)cmbPaciente.SelectedItem; dd.doctor = (Doctor)cmbNombreDoctor.SelectedItem; dd.Diagnostico = txtDiagnostico.Text; dd.FechaConsulta = dtpFechaConsulta.Value.Date; dd.Sucursal = (Sucursal)cmbSucursal.SelectedItem; dd.tipourgencia = (TipoUrgencia)cmbTipoUrgencia.SelectedItem; consulta.detalle_consulta.Add(dd); ActualizarDataGrid(); consulta.paciente = (Paciente)cmbPaciente.SelectedItem; consulta.doctor = (Doctor)cmbNombreDoctor.SelectedItem; Consulta.Agregar(consulta); MessageBox.Show("La Consulta ha sido guardado con éxito"); Limpiar(); //dtgDetalleConsulta.DataSource = null; cmbPaciente.SelectedItem = null; cmbNombreDoctor.SelectedItem = null; dtgDetalleConsulta.DataSource = Consulta.ObtenerConsultasPendientes(); CargarDT(); consulta = new Consulta(); LimpiarForm(); }
public static List <ConsultaDetalle> BuscarDetalle(Consulta param) { ConsultaDetalle detalle = null; List <ConsultaDetalle> lista = new List <ConsultaDetalle>(); SqlParameter[] parametros = new SqlParameter[1]; parametros[0] = new SqlParameter("@id_consulta", param.Id); DataTable tabla = SqlHelper.getInstance().leer(Tabla2 + "_leer", parametros); foreach (DataRow item in tabla.Rows) { int ejercicio = int.Parse(item["id_ejercicio"].ToString()); int entrenamiento = int.Parse(item["id_entrenamiento"].ToString()); int tratamiento = int.Parse(item["id_tratamiento"].ToString()); int patologia = int.Parse(item["id_patologia"].ToString()); detalle = new ConsultaDetalle(); if (ejercicio != 0) { detalle.Item = new Ejercicio() { Id = ejercicio } } ; if (entrenamiento != 0) { detalle.Item = new Entrenamiento() { Id = entrenamiento } } ; if (tratamiento != 0) { detalle.Item = new Tratamiento() { Id = tratamiento } } ; if (patologia != 0) { detalle.Item = new Patologia() { Id = patologia } } ; detalle.Resultado = item["resultado"].ToString(); detalle.Observaciones = item["observaciones"].ToString(); detalle.DVH = int.Parse(item["DVH"].ToString()); lista.Add(detalle); } return(lista); }
private void btnEliminar_Click(object sender, EventArgs e) { ConsultaDetalle dd = (ConsultaDetalle)dtgDetalleConsulta.CurrentRow.DataBoundItem; if (dd != null) { consulta.detalle_consulta.Remove(dd); } ActualizarDataGrid(); }
private void listaPAT_SelectedIndexChanged(object sender, EventArgs e) { ConsultaDetalle detalle = listaPAT.SelectedItem as ConsultaDetalle; detallePAT = detalle; if (detalle != null) { patologiaSeleccionada = (Patologia)detalle.Item; txtDescripcionPAT.Text = patologiaSeleccionada.ToString(); txtObservacionesPAT.Text = detalle.Observaciones; } }
private void listaTRA_SelectedIndexChanged(object sender, EventArgs e) { ConsultaDetalle detalle = listaTRA.SelectedItem as ConsultaDetalle; detalleTRAT = detalle; if (detalle != null) { tratamientoSeleccionado = (DatoBase)detalle.Item; txtDescripcionTRA.Text = tratamientoSeleccionado.ToString(); txtObservacionesTRA.Text = detalle.Observaciones; txtResultadoTRA.Text = detalle.Resultado; } }
public static int InsertarDetalle(int id, ConsultaDetalle detalle) { DatoBase item = detalle.Item; SqlParameter[] parametros = new SqlParameter[8]; parametros[0] = new SqlParameter("@id_consulta", id); parametros[1] = new SqlParameter("@id_ejercicio", (item is Ejercicio) ? item.Id:0); parametros[2] = new SqlParameter("@id_entrenamiento", (item is Entrenamiento) ? item.Id : 0); parametros[3] = new SqlParameter("@id_tratamiento", (item is Tratamiento) ? item.Id : 0); parametros[4] = new SqlParameter("@id_patologia", (item is Patologia) ? item.Id : 0); parametros[5] = new SqlParameter("@resultado", (detalle.Resultado != null) ? detalle.Resultado : ""); parametros[6] = new SqlParameter("@observaciones", (detalle.Observaciones != null) ? detalle.Observaciones : ""); parametros[7] = new SqlParameter("@dvh", Util.DigitoVerificador.CalcularDV(detalle.getDVH())); return(SqlHelper.getInstance().escribir(Tabla2 + "_alta", parametros)); }
private void btnBuscarPAT_Click(object sender, EventArgs e) { ConsultarPatologia dialog = new ConsultarPatologia(); dialog.Seleccionado = patologiaSeleccionada; if (dialog.ShowDialog(this) == DialogResult.OK) { patologiaSeleccionada = dialog.Seleccionado; detallePAT = null; txtDescripcionPAT.Text = patologiaSeleccionada.ToString(); txtObservacionesPAT.Text = string.Empty; } else { LimpiarPatologia(); } dialog.Dispose(); listaPAT.ClearSelected(); }
private void btnRemoverTRA_Click(object sender, EventArgs e) { listaTRA.Items.Remove(listaTRA.SelectedItem); detalleTRAT = null; LimpiarTratamiento(); }
private void btnRemoverPAT_Click(object sender, EventArgs e) { listaPAT.Items.Remove(listaPAT.SelectedItem); detallePAT = null; LimpiarPatologia(); }