public frmAltaHistoriaClinica(frmTurnos srmturnos, Medico medico, string dni, DateTime D) { InitializeComponent(); this.srmturnos = srmturnos; this.medico = medico; this.dni = dni; TurnosNegocio TN = new TurnosNegocio(); this.paciente = new Paciente(); TN.LeerPaciente(this.dni, ref this.paciente); HCNegocio = new HistoriaClinicaNegocio(); if (D.Date == DateTime.Now.Date && id == 2) { this.groupBox2.Enabled = true; } else { this.groupBox2.Enabled = false; } }
private void btnBuscar_Click(object sender, EventArgs e) { Paciente paciente = new Paciente(); if (TN.LeerPaciente(tbxDocumento.Text, ref paciente) == false) { MessageBox.Show("El paciente no existe"); Limpiar(); this.cbxEspecialidad.Enabled = false; this.cbxFecha.Enabled = false; this.cbxHora.Enabled = false; this.cbxMedico.Enabled = false; this.btnAceptar.Enabled = false; this.btnBuscar.Enabled = true; return; } tbxNombre.Text = paciente.nombre; tbxApellido.Text = paciente.apellido; tbxMail.Text = paciente.mail; tbxNAfiliado.Text = paciente.numeroAfiliado; tbxObraSocial.Text = paciente.obra_social.nombre; tbxPlan.Text = paciente.plan.nombre; tbxDocumento.Enabled = false; if (paciente.plan.estado == 0) { this.txbLeyenda.Text = "Plan dado de BAJA"; this.txbLeyenda.Visible = true; } else { if (TN.LeerCoseguros(ref paciente) == false) { MessageBox.Show("Error al buscar coseguro"); } else { if (paciente.plan.coseguro > 0) { this.label15.Visible = true; this.txtCoseguro.Text = "$" + paciente.plan.coseguro.ToString() + ",00"; this.txtCoseguro.Visible = true; } } } if (paciente.obra_social.suspendido == true) { this.txbLeyenda.Text = "Obra Social Suspendida"; this.txbLeyenda.Visible = true; } if (paciente.obra_social.estado == 0) { this.txbLeyenda.Text = "Obra Social con BAJA DEFINITIVA"; this.txbLeyenda.Visible = true; } this.tbxTelefono.Text = paciente.telefono; this.dtpFecha.Value = paciente.fecha_nacimiento; this.cbxEspecialidad.Enabled = true; this.cbxFecha.Enabled = true; this.cbxHora.Enabled = true; this.cbxMedico.Enabled = true; this.btnAceptar.Enabled = true; this.btnBuscar.Enabled = false; this.tbxObservaciones.Enabled = true; }