private void buAgregar_Click(object sender, EventArgs e) { CapaDeNegocios.Paciente.cPaciente oGestante = new CapaDeNegocios.Paciente.cPaciente(); int indice = 0; if (dgvGestante.Rows.Count > 0 && !seleccionado) { indice = dgvGestante.Rows.Count - 1; llenar_datos_gestante(indice); DialogResult = DialogResult.OK; } if (dgvGestante.Rows.Count == 0) { MessageBox.Show("No hay gestantes disponibles.", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } if (seleccionado) { indice = dgvGestante.CurrentRow.Index; llenar_datos_gestante(indice); DialogResult = DialogResult.OK; } }
private void bindingNavigatorMoveLastItem_Click(object sender, EventArgs e) { CapaDeNegocios.Paciente.cPaciente oGestante = new CapaDeNegocios.Paciente.cPaciente(); bnpiGestante.Text = cantidad_total_registros.ToString(); int pagina = (Convert.ToInt16(bnpiGestante.Text) - 1) * cantidad_registros; oGestante.idtestablecimientosalud = IdtEstablecimientoSalud; dgvGestante.DataSource = oGestante.ListarPacienteXIdEstablecimientoSalud(pagina, cantidad_registros); }
public cHistoriaClinica() { oPaciente = new CapaDeNegocios.Paciente.cPaciente(); CitasPrenatales = new List <CitaPreNatal.cCitaPrenatal>(); VisitasDomiciliariaPuerpera = new List <VisitaDomiciliaria.cVisitaDomiciliariaPuerperaRN>(); VisitasDomiciliariasGestante = new List <VisitaDomiciliaria.cVisitaDomiciliariaGestante>(); Baterias = new List <cBateria>(); ControlesPuerpero = new List <ControlPeuperio.cControlPeuperio>(); ControlesRecienNacido = new List <RecienNacido.cRecienNacido>(); }
private void frmGestante_Load(object sender, EventArgs e) { DataTable odtGestante = new DataTable(); CapaDeNegocios.Paciente.cPaciente oGestante = new CapaDeNegocios.Paciente.cPaciente(); frmMenu fMenu = new frmMenu(); oGestante.idtestablecimientosalud = IdtEstablecimientoSalud; dgvGestante.DataSource = oGestante.ListarPacienteXIdEstablecimientoSalud(pagina, cantidad_registros); if (dgvGestante.Rows.Count > 0) { idtpaciente = dgvGestante.Rows[0].Cells[1].Value.ToString(); nombres = dgvGestante.Rows[0].Cells[2].Value.ToString(); app = dgvGestante.Rows[0].Cells[3].Value.ToString(); apm = dgvGestante.Rows[0].Cells[4].Value.ToString(); DNI = Convert.ToString(dgvGestante.Rows[0].Cells[5].Value); fn = Convert.ToDateTime(dgvGestante.Rows[0].Cells[6].Value); } else { MessageBox.Show("No hay registros de gestantes.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Information); } oGestante.idtestablecimientosalud = IdtEstablecimientoSalud; odtGestante = oGestante.ListarCantidadPacientes(); cantidad_total_registros = Convert.ToUInt16(odtGestante.Rows[0][0]); /*hallando datos de barra de navegacion */ decimal dcantidad_registros = Convert.ToDecimal(cantidad_registros); decimal dcantidad_total_registros = Convert.ToDecimal(cantidad_total_registros); int total_registros = Convert.ToInt16(odtGestante.Rows[0][0].ToString()); decimal total_registros_paciente = dcantidad_total_registros / dcantidad_registros; total_registros_paciente = Math.Ceiling(total_registros_paciente); cantidad_total_registros = Convert.ToInt16(total_registros_paciente); bnpiGestante.Text = "1"; bnctGestante.Text = "de " + total_registros_paciente; bnGestante.Enabled = true; bindingNavigatorMoveNextItem.Enabled = true; bindingNavigatorMoveLastItem.Enabled = true; bindingNavigatorMovePreviousItem.Enabled = true; bindingNavigatorMoveFirstItem.Enabled = true; dgvGestante.Columns[1].Visible = false; cbBuscar.SelectedItem = cbBuscar.Items[0]; }
private void llenar_datos_gestante(DataGridViewCellEventArgs e) { CapaDeNegocios.Paciente.cPaciente oGestante = new CapaDeNegocios.Paciente.cPaciente(); if (e.RowIndex != -1) { idtpaciente = dgvGestante.Rows[e.RowIndex].Cells[1].Value.ToString(); nombres = dgvGestante.Rows[e.RowIndex].Cells[2].Value.ToString(); app = dgvGestante.Rows[e.RowIndex].Cells[3].Value.ToString(); apm = dgvGestante.Rows[e.RowIndex].Cells[4].Value.ToString(); DNI = Convert.ToString(dgvGestante.Rows[e.RowIndex].Cells[5].Value); fn = Convert.ToDateTime(dgvGestante.Rows[e.RowIndex].Cells[6].Value); } }
private void llenar_datos_gestante(DataGridViewCellEventArgs e) { CapaDeNegocios.Paciente.cPaciente oGestante = new CapaDeNegocios.Paciente.cPaciente(); if (e.RowIndex != -1) { idtpaciente = dgvGestante.Rows[e.RowIndex].Cells[1].Value.ToString(); codigohistoriaclinica = dgvGestante.Rows[e.RowIndex].Cells[2].Value.ToString(); nombres = dgvGestante.Rows[e.RowIndex].Cells[3].Value.ToString(); app = dgvGestante.Rows[e.RowIndex].Cells[4].Value.ToString(); apm = dgvGestante.Rows[e.RowIndex].Cells[5].Value.ToString(); DNI = Convert.ToString(dgvGestante.Rows[e.RowIndex].Cells[6].Value); fn = Convert.ToDateTime(dgvGestante.Rows[e.RowIndex].Cells[7].Value); sdireccion = Convert.ToString(dgvGestante.Rows[e.RowIndex].Cells[8].Value); stelefono = Convert.ToString(dgvGestante.Rows[e.RowIndex].Cells[9].Value); seleccionado = true; } }
private void txtBuscar_TextChanged(object sender, EventArgs e) { CapaDeNegocios.Paciente.cPaciente oGestante = new CapaDeNegocios.Paciente.cPaciente(); string buscar = txtBuscar.Text; string seleccionado = this.cbBuscar.GetItemText(this.cbBuscar.SelectedItem); oGestante.apellidopaterno = buscar; oGestante.idtestablecimientosalud = IdtEstablecimientoSalud; switch (seleccionado) { case "Apellido Paterno": oGestante.apellidopaterno = buscar; dgvGestante.DataSource = oGestante.ListarPacienteXApellidoPaterno(); dgvGestante.Columns[1].Visible = false; break; case "Apellido Materno": oGestante.apellidomaterno = buscar; dgvGestante.DataSource = oGestante.ListarPacienteXApellidoMaterno(); dgvGestante.Columns[1].Visible = false; break; case "Nombres": oGestante.nombres = buscar; dgvGestante.DataSource = oGestante.ListarPacienteXNombres(); dgvGestante.Columns[1].Visible = false; break; case "DNI": oGestante.dni = buscar; dgvGestante.DataSource = oGestante.ListarPacienteXDNI(); dgvGestante.Columns[1].Visible = false; break; } if (buscar.Length == 0) { dgvGestante.DataSource = oGestante.ListarPacienteXIdEstablecimientoSalud(pagina, cantidad_registros); } }
private void CargarDatos() { DataTable odtGestante = new DataTable(); CapaDeNegocios.Paciente.cPaciente oGestante = new CapaDeNegocios.Paciente.cPaciente(); oGestante.idtestablecimientosalud = IdtEstablecimientoSalud; int rowIndex = 0; string item = "", searchValue = ""; /*hallando datos de barra de navegacion */ decimal dcantidad_registros = 0; decimal dcantidad_total_registros = 0; oGestante.idtestablecimientosalud = IdtEstablecimientoSalud; odtGestante = oGestante.ListarCantidadPacientes(); cantidad_total_registros = Convert.ToUInt16(odtGestante.Rows[0][0]); int total_registros = Convert.ToInt16(odtGestante.Rows[0][0].ToString()); dcantidad_registros = Convert.ToDecimal(cantidad_registros); dcantidad_total_registros = Convert.ToDecimal(cantidad_total_registros); int registros = 0; if (cantidad_total_registros > 10) { registros = Math.Abs(cantidad_total_registros - 10); } else { registros = 0; } dgvGestante.DataSource = oGestante.ListarPacienteXIdEstablecimientoSalud(registros, cantidad_registros); /*Buscando indice del item agregado o modificado*/ searchValue = cantidad_total_registros.ToString(); for (int i = 0; i < dgvGestante.Rows.Count; i++) { item = dgvGestante.Rows[i].Cells[0].Value.ToString(); if (item.Trim() == searchValue.Trim()) { rowIndex = i; break; } } decimal total_registros_paciente = dcantidad_total_registros / dcantidad_registros; total_registros_paciente = Math.Ceiling(total_registros_paciente); cantidad_total_registros = Convert.ToInt16(total_registros_paciente); bnpiGestante.Text = cantidad_total_registros.ToString(); bnctGestante.Text = "de " + total_registros_paciente; bnctGestante.ForeColor = Color.White; bnGestante.Enabled = true; bindingNavigatorMoveNextItem.Enabled = true; bindingNavigatorMoveLastItem.Enabled = true; bindingNavigatorMovePreviousItem.Enabled = true; bindingNavigatorMoveFirstItem.Enabled = true; dgvGestante.Columns[1].Visible = false; cbBuscar.SelectedItem = cbBuscar.Items[0]; if (dgvGestante.Rows.Count > 0) { idtpaciente = dgvGestante.Rows[0].Cells[1].Value.ToString(); codigohistoriaclinica = dgvGestante.Rows[0].Cells[2].Value.ToString(); nombres = dgvGestante.Rows[0].Cells[3].Value.ToString(); app = dgvGestante.Rows[0].Cells[4].Value.ToString(); apm = dgvGestante.Rows[0].Cells[5].Value.ToString(); DNI = Convert.ToString(dgvGestante.Rows[0].Cells[6].Value); fn = Convert.ToDateTime(dgvGestante.Rows[0].Cells[7].Value); sdireccion = Convert.ToString(dgvGestante.Rows[0].Cells[8].Value); stelefono = Convert.ToString(dgvGestante.Rows[0].Cells[9].Value); dgvGestante.Rows[rowIndex].Selected = true; dgvGestante.CurrentCell = dgvGestante.Rows[rowIndex].Cells[2]; } else { MessageBox.Show("No hay registros de gestantes.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void txtBuscar_TextChanged(object sender, EventArgs e) { string buscar = txtBuscar.Text; CapaDeNegocios.cHistoriaClinica oHistoriaClinica = new CapaDeNegocios.cHistoriaClinica(); CapaDeNegocios.Paciente.cPaciente oPaciente = new CapaDeNegocios.Paciente.cPaciente(); CapaDeNegocios.cUtilitarios oUtilitarios = new CapaDeNegocios.cUtilitarios(); string seleccionado = this.cbBuscar.GetItemText(this.cbBuscar.SelectedItem); if (seleccionado == "Historia Clinica") { if (buscar.Length > 1) { if (buscar.Length >= 10) { oHistoriaClinica.oPaciente.codigohistoriaclinica = buscar.Substring(0, 9); } if (buscar.Length <= 10) { oHistoriaClinica.oPaciente.codigohistoriaclinica = buscar; } oHistoriaClinica.Idtobstetra = IdObstetra; oHistoriaClinica.Idtestablecimientosalud = IdtEstablecimientoSalud; dgvHC.DataSource = oUtilitarios.enumerar_datatable(oHistoriaClinica.ListarHistoriaClinicaXHistoriaClinica(), 0); dgvHC.Columns[1].Visible = false; } } if (seleccionado == "Apellido Paterno") { if (buscar.Length > 1) { if (buscar.Length >= 150) { oPaciente.apellidopaterno = buscar.Substring(0, 149); } if (buscar.Length <= 150) { oPaciente.apellidopaterno = buscar; } oPaciente.idtobstetra = IdObstetra; oPaciente.idtestablecimientosalud = IdtEstablecimientoSalud; dgvHC.DataSource = oUtilitarios.enumerar_datatable(oPaciente.ListarHistoriaClinicaXApellidoPaterno(), 0); dgvHC.Columns[1].Visible = false; } } if (seleccionado == "Apellido Materno") { if (buscar.Length > 1) { if (buscar.Length >= 150) { oPaciente.apellidomaterno = buscar.Substring(0, 149); } if (buscar.Length <= 150) { oPaciente.apellidomaterno = buscar; } oPaciente.idtobstetra = IdObstetra; oPaciente.idtestablecimientosalud = IdtEstablecimientoSalud; dgvHC.DataSource = oUtilitarios.enumerar_datatable(oPaciente.ListarHistoriaClinicaXApellidoMaterno(), 0); dgvHC.Columns[1].Visible = false; } } if (seleccionado == "Nombres") { if (buscar.Length > 1) { if (buscar.Length >= 150) { oPaciente.nombres = buscar.Substring(0, 149); } if (buscar.Length <= 150) { oPaciente.nombres = buscar; } oPaciente.idtobstetra = IdObstetra; oPaciente.idtestablecimientosalud = IdtEstablecimientoSalud; dgvHC.DataSource = oUtilitarios.enumerar_datatable(oPaciente.ListarHistoriaClinicaXNombres(), 0); dgvHC.Columns[1].Visible = false; } } if (seleccionado == "DNI") { if (buscar.Length > 1) { if (buscar.Length >= 8) { oPaciente.dni = buscar.Substring(0, 7); } if (buscar.Length <= 8) { oPaciente.dni = buscar; } oPaciente.idtobstetra = IdObstetra; oPaciente.idtestablecimientosalud = IdtEstablecimientoSalud; dgvHC.DataSource = oUtilitarios.enumerar_datatable(oPaciente.ListarHistoriaClinicaXDNI(), 0); dgvHC.Columns[1].Visible = false; } } if (buscar.Length < 1) { oHistoriaClinica.Idtobstetra = IdObstetra; oHistoriaClinica.Idtestablecimientosalud = IdtEstablecimientoSalud; oHistoriaClinica.mes = mes; oHistoriaClinica.año = año; dgvHC.DataSource = oUtilitarios.enumerar_datatable(oHistoriaClinica.ListarHistoriaClinica(), 0); dgvHC.Columns[1].Visible = false; } }