public RegistroPacientes(int id, int av) { controladorpacientes = new ControladorPacientes(); InitializeComponent(); operacion = 1; idpaciente = id; llenarCombos(); aviso = av; Model model = new Model(); pacientes pac = new pacientes(); pac = model.Entidades.pacientes.Single(a => a.idpaciente == id); txtNombre.Text = pac.nombres; txtApellido.Text = pac.apellidos; txtDireccion.Text = pac.direccion; txtDui.Text = pac.dui; txtTelefono.Text = pac.telefono; dateTimePicker1.Value = pac.fecha_nacimiento; cmbGenero.Text = pac.genero; departamentos dep = new departamentos(); dep = model.Entidades.departamentos.Single(a => a.id_departamento == pac.id_departamento); cmbDepartamento.Text = dep.nombredepartamento; municipios m = new municipios(); m = model.Entidades.municipios.Single(a => a.idmunicipio == pac.id_municipio); cmbMunicipio.Text = m.nombremunicipio; txtNombreEncargado.Text = pac.nombreencargado; txtApellidosEncargado.Text = pac.apellidoencargado; txtTelefonoEncargado.Text = pac.telefono_encargado; txtDuiEncargado.Text = pac.duiencargado; }
public bool modificarPaciente(int id, pacientes pac) { try { Model model = new Model(); pacientes original = model.Entidades.pacientes.Find(id); original.nombres = pac.nombres; original.apellidos = pac.apellidos; original.direccion = pac.direccion; original.dui = pac.dui; original.telefono = pac.telefono; original.telefono_encargado = pac.telefono_encargado; original.nombreencargado = pac.nombreencargado; original.duiencargado = pac.duiencargado; original.apellidoencargado = pac.apellidoencargado; original.id_departamento = pac.id_departamento; original.id_municipio = pac.id_municipio; original.fecha_nacimiento = pac.fecha_nacimiento; original.genero = pac.genero; model.Entidades.SaveChanges(); model.cerrarConexion(); } catch (Exception ex) { return(false); } return(true); }
public List <pacientes> Paciente_Apellido(string Apellido) { List <pacientes> lista = new List <pacientes>(); DAL.HospitalDataSetTableAdapters.H3_Buscar_TitularTableAdapter adapter = new DAL.HospitalDataSetTableAdapters.H3_Buscar_TitularTableAdapter(); DAL.HospitalDataSet.H3_Buscar_TitularDataTable aTable = adapter.GetData(Apellido); int pos = 0; foreach (DAL.HospitalDataSet.H3_Buscar_TitularRow row in aTable.Rows) { pacientes p = new pacientes(); pos++; p.Nro_Busqueda = pos; p.Paciente = row.apellido; p.Documento = row.documento; if (!row.IstelefonoNull() && row.telefono.Length > 5) { p.Telefono = row.telefono; } else { p.Telefono = ""; } p.NHC = row.cuil; p.HC_UOM = row.HC_UOM_CENTRAL; lista.Add(p); } return(lista); }
private void Impresion_Load(object sender, EventArgs e) { //Form1 parent = (Form1)this.Owner; //Deberia crear una tabla que relacione Nro de practica y subpractica, con un una lista de cantidad de tubos necesarios, //Como del tipo de tubo, si este tubo o tubos se pueden mezclar o si son tubos separados, ejemplo //Hemograma 1 tubo EDTA (Se puede juntar) //Electroforesis de hg 4 tubos EDTA (No se pueden juntar) //Hematocrito 1 tubo EDTA (Se puede juntar) //Glucosa 1 tubo suero (Se puede juntar) //Glocusa Curva 4 tubos (El primero se puede juntar pero los otros 3 NO) pacientes paciente = new pacientes(); lbl_sexo.Text = parent.lbl_sexo.Text; lbl_PacienteOculto.Text = parent.lbl_PacienteOculto.Text; lbl_Numero.Text = parent.lbl_CodigoBarra.Text; lbl_cama.Text = parent.cbo_Cama.Text; lbl_edad.Text = parent.lbl_edad.Text; lbl_resumen.Text = parent.lbl_resumen.Text; if (parent.txt_Observacion.Text.Length > 8) { lbl_observaciones.Text = parent.txt_Observacion.Text.Substring(0, 8); } else { lbl_observaciones.Text = parent.txt_Observacion.Text; } lbl_TMuestra.Text = parent.cbo_TipoOrden.SelectedValue.ToString(); lb_fingreso.Text = parent.fechaDia.Text + " " + parent.horaDia.Text; }
private void mantcli_Click(object sender, EventArgs e) { pacientes p = new pacientes(); p.MdiParent = this; p.Show(); }
private void txtDui_TextChanged(object sender, EventArgs e) { if (aviso == 0) { try { if (txtDui.Text.Length == 10) { Model model = new Model(); pacientes p = new pacientes(); p = model.Entidades.pacientes.Single(a => a.dui.Equals(txtDui.Text)); if (txtDui.Text == p.dui) { MessageBox.Show("DUI YA EXISTE, POR FAVOR INGRESE OTRO NUMERO"); txtDui.Text = ""; } } } catch (Exception ee) { } } }
public ActionResult DeleteConfirmed(int id) { pacientes pacientes = db.pacientesSet.Find(id); db.pacientesSet.Remove(pacientes); db.SaveChanges(); return(RedirectToAction("Sair", "Account")); }
public string retornarPaciente(int id) { Model model = new Model(); pacientes paciente = new pacientes(); paciente = model.Entidades.pacientes.Single(a => a.idpaciente == id); return(paciente.nombres + " " + paciente.apellidos); }
public ActionResult DeleteConfirmed(int id) { pacientes pacientes = db.pacientes.Find(id); db.pacientes.Remove(pacientes); db.SaveChanges(); return(RedirectToAction("Index")); }
private void Impresion_Automatica_Load(object sender, EventArgs e) { //Form1 parent = (Form1)this.Owner; //Deberia crear una tabla que relacione Nro de practica y subpractica, con un una lista de cantidad de tubos necesarios, //Como del tipo de tubo, si este tubo o tubos se pueden mezclar o si son tubos separados, ejemplo //Hemograma 1 tubo EDTA (Se puede juntar) //Electroforesis de hg 4 tubos EDTA (No se pueden juntar) //Hematocrito 1 tubo EDTA (Se puede juntar) //Glucosa 1 tubo suero (Se puede juntar) //Glocusa Curva 4 tubos (El primero se puede juntar pero los otros 3 NO) pacientes paciente = new pacientes(); lbl_PacienteOculto.Text = parent.lbl_PacienteOculto.Text; lbl_Numero.Text = parent.lbl_CodigoBarra.Text; lbl_cama.Text = parent.cbo_Cama.Text; lbl_edad.Text = parent.lbl_edad.Text; lbl_resumen.Text = parent.lbl_resumen.Text; if (parent.txt_Observacion.Text.Length > 8) { lbl_observaciones.Text = parent.txt_Observacion.Text.Substring(0, 8); } else { lbl_observaciones.Text = parent.txt_Observacion.Text; } lbl_TMuestra.Text = parent.cbo_TipoOrden.SelectedValue.ToString(); lb_fingreso.Text = parent.fechaDia.Text + " " + parent.horaDia.Text; //lbl_PacienteOculto.Text = "IMPRESION DE PRUEBA"; //lbl_Numero.Text = "*0100030109*"; //lbl_cama.Text = "1"; //lbl_edad.Text = "30"; //lbl_resumen.Text = "SIN RESUMEN"; //lbl_observaciones.Text = "OBS..."; //lbl_TMuestra.Text = "D"; //lb_fingreso.Text = "29/10/2014 15:41"; DAL.Impresion_AutomaticaDALTableAdapters.H2_Laboratorio_Impresion_Grupo_etiquetasTableAdapter adapter = new DAL.Impresion_AutomaticaDALTableAdapters.H2_Laboratorio_Impresion_Grupo_etiquetasTableAdapter(); DAL.Impresion_AutomaticaDAL.H2_Laboratorio_Impresion_Grupo_etiquetasDataTable aTable = adapter.GetData(lbl_Numero.Text.Replace("*", "")); foreach (DAL.Impresion_AutomaticaDAL.H2_Laboratorio_Impresion_Grupo_etiquetasRow row in aTable) { etiquetas_laboratorio el = new etiquetas_laboratorio(); el.cant_etiquetas = row.grupo_cant_etiqueta; el.grupo = row.grupo_nombre; lista.Add(el); string[] rows = new string[] { el.grupo.ToString(), el.cant_etiquetas.ToString(), "Más", "Menos", "Borrar" }; gv.Rows.Add(rows); } //gv.DataSource = lista; }
public void CargarPacienteID(long Id) { pacientes p = Paciente_ID(Id); if (p != null) { CargarPaciente_id(); } }
public ActionResult Edit([Bind(Include = "id,nombre,apellido,telefono,fechaNac,tipoSangre")] pacientes pacientes) { if (ModelState.IsValid) { db.Entry(pacientes).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pacientes)); }
public ActionResult Create([Bind(Include = "id,nombre,apellido,telefono,fechaNac,tipoSangre")] pacientes pacientes) { if (ModelState.IsValid) { db.pacientes.Add(pacientes); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pacientes)); }
// GET: pacientes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } pacientes pacientes = db.pacientesSet.Find(id); if (pacientes == null) { return(HttpNotFound()); } return(View(pacientes)); }
public pacientes CargarPacienteID(long Documento) { pacientes p = Paciente_ID(Documento, true); if (p != null) { //MessageBox.Show("Ya encontro paciente ahora lo devuelvo"); return(p); } else { return(null); } }
public pacientes CargarPacienteHC_UOM_Solouno(string HC) { pacientes p = Paciente_NHC_OUM_Solouno(HC); if (p != null) { //MessageBox.Show("Ya encontro paciente ahora lo devuelvo"); return(p); } else { return(null); } }
// GET: pacientes/Details/5 public ActionResult Details() { int id = Convert.ToInt16(Session["idUsuario"]); //if (id == null) //{ // return new HttpStatusCodeResult(HttpStatusCode.BadRequest); //} pacientes pacientes = db.pacientesSet.Find(id); if (pacientes == null) { return(HttpNotFound()); } return(View(pacientes)); }
public bool insertarPaciente(pacientes p) { try { Model model = new Model(); model.Entidades.pacientes.Add(p); model.Entidades.SaveChanges(); model.cerrarConexion(); } catch (Exception ex) { return(false); } return(true); }
private void txt_Documento_Leave(object sender, EventArgs e) { int doc = 0; if (int.TryParse(txt_Documento.Text, out doc)) { if (doc != 0) { pacientes p = Paciente_DOC(doc, false, cbo_tipo_documento.Text); if (p != null) { MessageBox.Show("Se encontró un paciente cargado con ese documento \n\n Nombre: " + p.Paciente + "\n\n CUIT: " + p.cuil); } } } }
// GET: pacientes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } pacientes pacientes = db.pacientesSet.Find(id); if (pacientes == null) { return(HttpNotFound()); } ViewBag.convenios_idConvenio = new SelectList(db.conveniosSet, "idConvenio", "descricao", pacientes.convenios_idConvenio); return(View(pacientes)); }
public bool eliminarPaciente(int id) { try { Model model = new Model(); pacientes copia = model.Entidades.pacientes.Find(id); model.Entidades.pacientes.Remove(copia); model.Entidades.SaveChanges(); model.cerrarConexion(); } catch (Exception ex) { return(false); } return(true); }
public ActionResult redefinirSenha([Bind(Include = "senha")] pacientes userPaciente) { try { if (ModelState.IsValid) { db.Entry(userPaciente).State = EntityState.Modified; db.SaveChanges(); return(View("_LayoutDadosAlterados")); } return(View(userPaciente)); } catch (Exception) { throw; } }
public ActionResult Cita(int id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } pacientes pacientes = db.pacientes.FirstOrDefault(p => p.id == id); var cita = new citas(); //cita.nombrePaciente = pacientes.id; if (pacientes == null) { return(HttpNotFound()); } return(RedirectToAction("Create", "citas")); }
public ActionResult Edit([Bind(Include = "idPaciente,nome,cpf,endereco,cidade,estado,telefone,celular,email,senha,confirmarSenha,convenios_idConvenio")] pacientes pacientes) { try { if (ModelState.IsValid) { db.Entry(pacientes).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.convenios_idConvenio = new SelectList(db.conveniosSet, "idConvenio", "descricao", pacientes.convenios_idConvenio); return(View(pacientes)); } catch (Exception) { throw; } }
public List <pacientes> Paciente_Apellido(string Apellido) { List <pacientes> lista = new List <pacientes>(); DAL.HospitalDataSetTableAdapters.H2_Gente_BuscarPacientes_ApellidoTableAdapter adapter = new DAL.HospitalDataSetTableAdapters.H2_Gente_BuscarPacientes_ApellidoTableAdapter(); DAL.HospitalDataSet.H2_Gente_BuscarPacientes_ApellidoDataTable aTable = adapter.GetData(Apellido); int pos = 0; foreach (DAL.HospitalDataSet.H2_Gente_BuscarPacientes_ApellidoRow row in aTable.Rows) { pacientes p = new pacientes(); pos++; p.Nro_Busqueda = pos; p.Paciente = row.apellido; p.Documento = row.documento; if (!row.IstelefonoNull() && row.telefono.Length > 5) { p.Telefono = row.telefono; } else { p.Telefono = ""; } p.HC_UOM = row.HC_UOM_CENTRAL; //if (!row.IsApellidoTitularNull()) p.Titular = row.ApellidoTitular; else p.Titular = ""; p.NHC = row.cuil; p.Documento_real = row.documento_real; p.Tipo_Documento = row.Tipo_doc; lista.Add(p); if (!row.IsComentarioNull()) { p.Comentario = row.Comentario; } } return(lista); }
public ActionResult Create(pacientes pacientes, string[] estado) { try { if (ModelState.IsValid) { db.pacientesSet.Add(pacientes); db.SaveChanges(); return(View("_LayoutCadastroRealizado")); } } catch (Exception) { throw; } clinicasController estados = new clinicasController(); ViewBag.listaEstados = estados.listaEstados(); ViewBag.convenios_idConvenio = new SelectList(db.conveniosSet, "idConvenio", "descricao", pacientes.convenios_idConvenio); return(View(pacientes)); }
//public string Edad(DateTime FNaci) //{ // //double edad = DateTime.Now.Subtract(FNaci).TotalDays / 365.25; // double edad = (DateTime.Now.Year - FNaci.Year); // if (DateTime.Now.Month < FNaci.Month || (DateTime.Now.Month == FNaci.Month && DateTime.Now.Day < FNaci.Day)) // { // edad--; // } // if (edad < 0) { edad = 0; } // return edad.ToString(); //} private void button2_Click(object sender, EventArgs e) { if (txt_NroHC_UOM.Text.Trim() == "") { MessageBox.Show("Falta cargar la HC del paciente", "Falta Hc del paciente", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } DAL.HospitalDataSetTableAdapters.H3_Persona_DNITableAdapter dniadapter = new DAL.HospitalDataSetTableAdapters.H3_Persona_DNITableAdapter(); DAL.HospitalDataSet.H3_Persona_DNIDataTable aTableDNI = dniadapter.GetData(int.Parse(txt_Documento.Text), Documento); if (aTableDNI.Count > 0) { MessageBox.Show("El nro de documento ya existe en el sistema, no se guardar el paciente", "DNI Duplicado", MessageBoxButtons.OK, MessageBoxIcon.Error); txt_NroHC_UOM.Text = ""; txt_NroHC_UOM.Focus(); button1_Click(null, null); return; } if (Documento == 0) { List <empresas> lista = new List <empresas>(); DAL.HospitalDataSetTableAdapters.H3_Datos_NHCTableAdapter adapter = new DAL.HospitalDataSetTableAdapters.H3_Datos_NHCTableAdapter(); DAL.HospitalDataSet.H3_Datos_NHCDataTable aTable = adapter.GetData(txt_NroHC_UOM.Text); int pos = 0; if (aTable.Count > 0) { MessageBox.Show("El nro de HC: " + aTable[0].HC_UOM_CENTRAL + " ya se ha utilizado en el paciente " + aTable[0].apellido, "HC en uso", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); txt_NroHC_UOM.Text = ""; txt_NroHC_UOM.Focus(); return; } } if (Documento == 0) { List <empresas> lista = new List <empresas>(); DAL.HospitalDataSetTableAdapters.H2_Afiliado_Encabezado_DOCTableAdapter adapter_DOC = new DAL.HospitalDataSetTableAdapters.H2_Afiliado_Encabezado_DOCTableAdapter(); DAL.HospitalDataSet.H2_Afiliado_Encabezado_DOCDataTable aTable_dOC = adapter_DOC.GetData(int.Parse(txt_Documento.Text), "0"); if (aTable_dOC.Count > 0) { if (aTable_dOC[0].IsFecha_BajaNull()) { MessageBox.Show("El nro de documento ya se ha utilizado en otro paciente", "Documento en uso", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); txt_Documento.Focus(); return; } } } if (Convert.ToInt32(cbo_seccional.SelectedValue) == 0) { MessageBox.Show("Falta cargar la seccional del paciente", "Falta seccional", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } bool error = false; //if (txt_telefono.Text.Trim() == "") //{ // MessageBox.Show("Falta ingresar el nro de teléfono", "Teléfono",MessageBoxButtons.OK,MessageBoxIcon.Error); // txt_telefono.Focus(); // error = true; //} if (cbo_discapacidad.SelectedValue == "0") { //MessageBox.Show("Falta indicar discapacidad", "Discapacidad", MessageBoxButtons.OK, MessageBoxIcon.Error); //cbo_discapacidad.Focus(); //error = true; cbo_discapacidad.SelectedValue = "0"; } if (txt_Documento.Text.Trim() == "") { MessageBox.Show("Falta ingresar Nro de Documento", "Documento", MessageBoxButtons.OK, MessageBoxIcon.Error); txt_Documento.Focus(); error = true; } if (cbo_sexof.Checked == false && cbo_sexom.Checked == false) { MessageBox.Show("Falta indicar el sexo", "Sexo", MessageBoxButtons.OK, MessageBoxIcon.Error); error = true; } if (txt_cuil.Text.Trim() == "") { MessageBox.Show("Falta el nro de cuil", "CUIL", MessageBoxButtons.OK, MessageBoxIcon.Error); txt_cuil.Focus(); error = true; } if (txt_cuiltitu.Text.Trim() == "") { txt_cuiltitu.Text = "0"; //error = true; } if (txt_cuilempresas.Text.Trim() == "") { //MessageBox.Show("Falta el nro de cuit empresas", "CUIT EMPRESAS", MessageBoxButtons.OK, MessageBoxIcon.Error); //txt_cuilempresas.Focus(); //error = true; txt_cuilempresas.Text = "0"; } if (!error) { long pac_id = GuardarAfiliado(); MessageBox.Show("Paciente Actualizado", "Actualizado", MessageBoxButtons.OK, MessageBoxIcon.Information); //this.Close(); Principal parent = (Principal)this.Owner; pacientes paciente = new pacientes(); paciente = CargarPacienteID(pac_id); //MessageBox.Show("Ya devolvio al paciente"); if (paciente != null) { string sexo = "Masculino"; if (paciente.sexo == "2") { sexo = "Femenino"; } parent.paciente_id.Text = pac_id.ToString(); parent.lbl_ApellidoyNombre.Text = "HC: " + paciente.HC_UOM + " Paciente: " + paciente.Paciente + " (" + Edad(Convert.ToDateTime(paciente.fecha_nacimiento)) + ") - Sexo: " + sexo; parent.lbl_DNI.Text = paciente.Tipo_Documento + ": " + paciente.Documento_real + " CUIL: " + paciente.NHC + " Teléfono: " + paciente.Telefono; parent.lbl_Seccional.Text = "Seccional: " + paciente.Seccional; parent.lbl_PacienteOculto.Text = paciente.Paciente; parent.lbl_DNIAux.Text = paciente.documento.ToString(); parent.lbl_NHCOculto.Text = paciente.HC_UOM; //string edad = (DateTime.Now.Year - Convert.ToDateTime(paciente.fecha_nacimiento).Year).ToString(); string edad = Edad(Convert.ToDateTime(paciente.fecha_nacimiento)); //try //{ // if (Convert.ToInt32(edad) > 105) { edad = ""; } //} //catch //{ // edad = ""; //} parent.lbl_edad.Text = edad; parent.lbl_sexo.Text = sexo.Substring(0, 1).ToUpper(); //CARGA LA IMAGEN DEL PACIENTE //try //{ // var request = WebRequest.Create(VariablesGlobales.LinkImagenes + paciente.NHC + ".jpg"); // using (var response = request.GetResponse()) // using (var stream = response.GetResponseStream()) // { // parent.img_Paciente.Image = Bitmap.FromStream(stream); // } //} //catch //{ //} this.Close(); } } }
public pacientes Paciente_DOC(Int32 DOC, bool MostrarMensaje, string T_Doc) { List <pacientes> lista = new List <pacientes>(); DAL.HospitalDataSetTableAdapters.H2_Afiliado_Encabezado_DOCTableAdapter adapter = new DAL.HospitalDataSetTableAdapters.H2_Afiliado_Encabezado_DOCTableAdapter(); DAL.HospitalDataSet.H2_Afiliado_Encabezado_DOCDataTable aTable = adapter.GetData(DOC, T_Doc); int pos = 0; pacientes p = new pacientes(); foreach (DAL.HospitalDataSet.H2_Afiliado_Encabezado_DOCRow row in aTable.Rows) { pos++; p.Nro_Busqueda = pos; p.cuil_titu = row.cuil_titu; p.cuil = row.cuil; p.documento = row.documento; if (!row.Isfecha_nacimientoNull()) { p.fecha_nacimiento = row.fecha_nacimiento; } if (!row.IsSeccionalNull()) { p.Seccional = row.Seccional; } if (!row.IsLocalidadNull()) { p.localidad = row.Localidad; } p.Paciente = row.apellido; if (!row.IsNro_SeccionalNull()) { p.Nro_Seccional = row.Nro_Seccional.ToString(); } else { p.Nro_Seccional = "999"; } if (!row.IstelefonoNull()) { p.Telefono = row.telefono; } p.Titular = ""; if (!row.IsOSNull()) { p.ObraSocial = row.OS; } else { p.ObraSocial = "Sin Seccionalizar"; } if (!row.IsOSIdNull()) { p.OSId = row.OSId; } else { p.OSId = 999; } if (!row.IsDiscapacidadNull()) { p.Discapacidad = Convert.ToInt32(row.Discapacidad); } else { p.Discapacidad = 0; } p.HC_UOM = row.HC_UOM_CENTRAL; p.NHC = row.cuil; lista.Add(p); } if (lista.Count > 0) { return(lista[0]); } else { if (MostrarMensaje) { MessageBox.Show("No se encontraron pacientes con ese nro de documento", "Paciente no encontado", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } return(null); }
public ActionResult Report(DateTime fecha) { pacientes sells = db.pacientes.FirstOrDefault(p => p.fechaNac == fecha); return(View(db.pacientes.GroupBy(p => p.fechaNac.Equals("yyyy/mm/dd")).ToList())); }
private void CargarPaciente_id() { Principal parent = (Principal)this.Owner; pacientes paciente = new pacientes(); paciente = Paciente_ID(Convert.ToInt64(txt_paciente_id.Text.Replace("-", ""))); if (paciente.Nro_Seccional == "1" || paciente.Nro_Seccional == "0") { MessageBox.Show("Revise la seccional del paciente", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } string sexo = "Masculino"; if (paciente.sexo == "2") { sexo = "Femenino"; } parent.lbl_ApellidoyNombre.Text = "HC: " + paciente.HC_UOM + " Paciente: " + paciente.Paciente + " (" + Edad(Convert.ToDateTime(paciente.fecha_nacimiento)) + ") - Sexo: " + sexo; parent.lbl_DNI.Text = paciente.Tipo_Documento + ": " + paciente.Documento_real + " CUIL: " + paciente.NHC + " Teléfono: " + paciente.Telefono; parent.lbl_Seccional.Text = "Seccional: " + paciente.Seccional; parent.lbl_PacienteOculto.Text = paciente.Paciente; parent.lbl_DNIAux.Text = paciente.documento.ToString(); parent.lbl_NHCOculto.Text = paciente.HC_UOM; parent.paciente_id.Text = paciente.documento.ToString(); parent.Falta_Seccional = false; if (paciente.Seccional == "" || paciente.Seccional == null) { parent.Falta_Seccional = true; } //string edad = (DateTime.Now.Year - Convert.ToDateTime(paciente.fecha_nacimiento).Year).ToString(); string edad = Edad(Convert.ToDateTime(paciente.fecha_nacimiento)); //try //{ // if (Convert.ToInt32(edad) > 100) { edad = ""; } //} //catch //{ // edad = ""; //} parent.lbl_sexo.Text = sexo.Substring(0, 1).ToUpper(); parent.lbl_edad.Text = edad; if (paciente.Comentario != null && paciente.Comentario.Trim() != "") { MessageBox.Show(paciente.Comentario, "Comentario", MessageBoxButtons.OK, MessageBoxIcon.Information); } DAL.BonoDALTableAdapters.H3_BONO_COBRA_BONO_PACIENTETableAdapter adapter_bono_cobra = new DAL.BonoDALTableAdapters.H3_BONO_COBRA_BONO_PACIENTETableAdapter(); DAL.BonoDAL.H3_BONO_COBRA_BONO_PACIENTEDataTable aTable_bono_cobra = adapter_bono_cobra.GetData(Convert.ToInt32(paciente.documento)); if (aTable_bono_cobra.Count > 0) { if (!aTable_bono_cobra[0].IsDiscapacidadNull()) { if (!aTable_bono_cobra[0].IsPagaBonoNull()) { if (aTable_bono_cobra[0].PagaBono == "S") { try { TimeSpan span = DateTime.Now - aTable_bono_cobra[0].Fecha_Discapacidad; if (span.TotalDays > 0) { MessageBox.Show(aTable_bono_cobra[0].Discapacidad + "- (CERT. VENCIDO) -", "¡¡ATENCION!!", MessageBoxButtons.OK, MessageBoxIcon.Stop); } } catch { MessageBox.Show("¡¡¡EL PACIENTE NO POSEE FECHA DE VENCIMIENTO DEL CERTIFICADO DE DISCAPACIDAD!!!", "¡¡ATENCION!!", MessageBoxButtons.OK, MessageBoxIcon.Stop); } } } } if (!aTable_bono_cobra[0].IsFV_PMINull()) { TimeSpan span = DateTime.Now - aTable_bono_cobra[0].FV_PMI; if (span.TotalDays > 0) { MessageBox.Show("¡¡¡¡PLAN MATERNO INFANTIL VENCIDO!!!!", "¡¡ATENCION!!", MessageBoxButtons.OK, MessageBoxIcon.Stop); } } } this.Close(); }