Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form inic = new Inicio();

            inic.Close();

            Form new_pac = new nuevo_pacien();

            new_pac.Show();

            this.Hide();
        }
Beispiel #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            Form inic = new Inicio();

            inic.Close();

            Form pac_recu = new paciente_recurrente();

            pac_recu.Show();

            this.Hide();
        }
Beispiel #3
0
        private void button4_Click(object sender, EventArgs e)
        {
            Form inic = new Inicio();

            inic.Close();

            Form new_pac = new Historial();

            new_pac.Show();

            this.Hide();
        }
Beispiel #4
0
 private void btnactu_Click(object sender, EventArgs e)
 {
     if (txtnombre.Text == "" || txtedad.Text == "" || txtocu.Text == "" || txttel.Text == "")
     {
         MessageBox.Show("Faltan campos por rellenar");
     }
     else
     {
         try
         {
             cmd = new MySqlCommand(" update paciente set edad = '" + txtedad.Text + "', ocupa ='" + txtocu.Text + "', tel='" + txttel.Text + "',nombre='" + txtnombre.Text + "' where idpaciente ='" + id + "';", Conexion.obtenerconexion());
             cmd.ExecuteNonQuery();
             MessageBox.Show($"Se modificó correctamente al paciente con ID {id}.");
             Form volver = new Inicio();
             volver.Show();
             this.Hide();
         }
         catch (Exception ex)
         {
             MessageBox.Show("Error de modificación" + ex.ToString());
         }
     }
 }
Beispiel #5
0
        private void btnguardar_Click(object sender, EventArgs e)  //Metodo para agregar nuevo paciente
        {
            if (txtnombre.Text == "" || txtedad.Text == "" || txtocu.Text == "" || txttel.Text == "")
            {
                MessageBox.Show("Faltan campos por rellenar");
            }
            else
            {
                string sexo, leer, diabe, hiper, aler, ciru, trauma, gota, lente, glauco, hfdiabe, hfhiper, hfglauco;

                if (checkBox1.Checked == true)
                {
                    sexo = "H";
                }
                else
                {
                    sexo = "M";
                } if (checkBox1.Checked == false && checkBox2.Checked == false)
                {
                    MessageBox.Show("Falto establecer el sexo");
                }
                else
                {
                    if (leersi.Checked == true)
                    {
                        leer = "Si";
                    }
                    else
                    {
                        leer = "No";
                    }
                    if (diabetesSi.Checked == true)
                    {
                        diabe = "Si";
                    }
                    else
                    {
                        diabe = "No";
                    }
                    if (hiperSi.Checked == true)
                    {
                        hiper = "Si";
                    }
                    else
                    {
                        hiper = "No";
                    }
                    if (alerSi.Checked == true)
                    {
                        aler = "Si";
                    }
                    else
                    {
                        aler = "No";
                    }
                    if (ciruSi.Checked == true)
                    {
                        ciru = "Si";
                    }
                    else
                    {
                        ciru = "No";
                    }
                    if (traumaSi.Checked == true)
                    {
                        trauma = "Si";
                    }
                    else
                    {
                        trauma = "No";
                    }
                    if (gotaSi.Checked == true)
                    {
                        gota = "Si";
                    }
                    else
                    {
                        gota = "No";
                    }
                    if (lenteSi.Checked == true)
                    {
                        lente = "Si";
                    }
                    else
                    {
                        lente = "No";
                    }
                    if (glaucoSi.Checked == true)
                    {
                        glauco = "Si";
                    }
                    else
                    {
                        glauco = "No";
                    }
                    if (hfdiabeSi.Checked == true)
                    {
                        hfdiabe = "Si";
                    }
                    else
                    {
                        hfdiabe = "No";
                    }
                    if (hfhiperSi.Checked == true)
                    {
                        hfhiper = "Si";
                    }
                    else
                    {
                        hfhiper = "No";
                    }
                    if (hfglaucoSi.Checked == true)
                    {
                        hfglauco = "Si";
                    }
                    else
                    {
                        hfglauco = "No";
                    }

                    try
                    {
                        cmd = new MySqlCommand(" insert into paciente(nombre,edad,sexo,lee,tel,ocupa,app_diabetes,dia_anios,dia_tratamiento,app_hiper,hiper_anios,hiper_tratamiento,alergia,alergia_cual,cirugia,cirugia_cual,trauma,cuando,gotas,gotas_cual,lente,gx_act,od,oi,app_glau,hf_diabetes,hf_dia_quien,hf_hiper,hf_hiper_quien,hf_glau,hf_glau_quien,observa) values ('" + txtnombre.Text + "','" + txtedad.Text + "','" + sexo + "','" + leer + "','" + txttel.Text + "','" + txtocu.Text + "','" + diabe + "','" + txtanos1.Text + "','" + txttrata1.Text + "','" + hiper + "','" + txtanos2.Text + "','" + txttrata2.Text + "','" + aler + "','" + txtalergias.Text + "','" + ciru + "','" + txtciru.Text + "','" + trauma + "','" + txttrauma.Text + "','" + gota + "','" + txtgotas.Text + "','" + lente + "','" + txtgx.Text + "','" + txtod.Text + "','" + txtoi.Text + "','" + glauco + "','" + hfdiabe + "','" + txtdiabe.Text + "','" + hfhiper + "','" + txthiper.Text + "','" + hfglauco + "','" + txtglauco.Text + "','" + richTextBox5.Text + "');", Conexion.obtenerconexion());
                        cmd.ExecuteNonQuery();
                        MessageBox.Show("Se guardo correctamente");

                        Form volver = new Inicio();
                        volver.Show();
                        this.Hide();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Error de inserción" + ex.ToString());
                    }
                }
            }
        }