private void BotonCrearFicha_Click(object sender, EventArgs e) { TexboxFecha.Text = Date.Value.ToString(); textBoxNombreYApellido.Text = textBoxNombre.Text + " " + textBoxApellido.Text; try { objetoCN.InsertarAdmi(textBoxNada.Text, textBoxNombreYApellido.Text, textBoxNada.Text, TexboxFecha.Text, textBoxNada.Text, textBoxDNI.Text, textBoxNada.Text, textBoxNada.Text, textBoxNada.Text, textBoxNada.Text, textBoxNada.Text, textBoxTel.Text, textBoxNada.Text, ComboboxObraSocial.SelectedValue.ToString(), textBoxNada.Text, textBoxNada.Text); MessageBox.Show("Ficha de Admision creada.\n Modifica los datos que aparecen con:000 "); } catch (Exception ex) { MessageBox.Show("Error:" + ex); } }
private void BotonGuardad_Click(object sender, EventArgs e) { if (textBoxHCN.Text != "") { if (textBoxNombreYApellido.Text != "") { if (textBoxEdad.Text != "") { if (TexboxFecha.Text != "") { if (textBoxNacionalidad.Text != "") { if (textBoxTipoYNDocumento.Text != "") { if (ComboboxEstadoCivil.selectedIndex != -1) { if (textBoxOcupacion.Text != "") { if (textBoxColegio.Text != "") { if (textBoxDomicilio.Text != "") { if (textBoxLocalidad.Text != "") { if (textBoxTelefono.Text != "") { if (textBoxTelAux.Text != "") { if (textBoxDerivadoPor.Text != "") { if (textBoxAcompañadoPor.Text != "") { if (Edit == false) { TexboxFecha.Text = Date.Value.ToString(); try { cn_pacientes.InsertarAdmi(textBoxHCN.Text, textBoxNombreYApellido.Text, textBoxEdad.Text, TexboxFecha.Text, textBoxNacionalidad.Text, textBoxTipoYNDocumento.Text, ComboboxEstadoCivil.selectedValue, textBoxOcupacion.Text, textBoxColegio.Text, textBoxDomicilio.Text, textBoxLocalidad.Text, textBoxTelefono.Text, textBoxTelAux.Text, ComboboxObraSocial.SelectedValue.ToString(), textBoxDerivadoPor.Text, textBoxAcompañadoPor.Text); MessageBox.Show("Guardado"); } catch (Exception ex) { MessageBox.Show("Error:" + ex); } } if (Edit == true) { try { cn_pacientes.EditarAdmi(textBoxHCN.Text, textBoxNombreYApellido.Text, textBoxEdad.Text, TexboxFecha.Text, textBoxNacionalidad.Text, textBoxTipoYNDocumento.Text, ComboboxEstadoCivil.selectedValue, textBoxOcupacion.Text, textBoxColegio.Text, textBoxDomicilio.Text, textBoxLocalidad.Text, textBoxTelefono.Text, textBoxTelAux.Text, ComboboxObraSocial.SelectedValue.ToString(), textBoxDerivadoPor.Text, textBoxAcompañadoPor.Text, textBoxFichaDEAdmision.Text); MessageBox.Show("Editado"); Edit = false; } catch (Exception ex) { MessageBox.Show("Error:" + ex); } } } else { msError("Colocar acompañado por"); } } else { msError("Colocar derivado por"); } } else { msError("Colocar otro numero de telefono"); } } else { msError("Colocar un numero de telefono"); } } else { msError("Colocar la localidad del paciente"); } } else { msError("Colocar domicilio del paciente"); } } else { msError("Colocar colegio del paciente"); } } else { msError("Coloque la ocupacion/escolaridad del paciente"); } } else { msError("Selecione un estado civil"); } } else { msError("Colocar DNI del paciente"); } } else { msError("Colocar la nacionalidad del paciente"); } } else { msError("Colocar la fecha de nacimiento del paciente"); } } else { msError("Colocar la edad del paciente"); } } else { msError("Colocar nombre y apellido del paciente"); } } else { msError("Colocar HCN°"); } }