示例#1
0
        private void button8_Click(object sender, EventArgs e) //Buscar empleado con membresia para cancelarla.............................
        {
            if (Txt_dpiMembe.TextLength == 13)
            {
                Erp_error.SetError(Txt_dpiMembe, "");
                try
                {
                    Gpb_datosMembe.Visible = true;
                    OdbcDataAdapter sda   = new OdbcDataAdapter("SELECT pa.sNombre, pa.sNit, me.sDescripcion FROM paciente pa, membresia me, membresiadepaciente mp WHERE pa.nIdPaciente = mp.nNoExpediente AND me.iNoMembresia = mp.iNoMembresia AND pa.nIdPaciente ='" + Convert.ToInt64(Txt_dpiMembe.Text) + "'", conexion.ObtenerConexion());
                    DataTable       datos = new DataTable();
                    sda.Fill(datos);

                    Txt_nombreMembe.Text = datos.Rows[0][0].ToString();
                    Txt_nitMembe.Text    = datos.Rows[0][1].ToString();
                    Txt_membreMembe.Text = datos.Rows[0][2].ToString();

                    //Deshabilitar los textbox donde se cargó la información
                    Txt_nombreMembe.Enabled = false;
                    Txt_nitMembe.Enabled    = false;
                    Txt_membreMembe.Enabled = false;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Intente de nuevo.", "Error en la búsqueda.", MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation);
                    //MessageBox.Show("error:" + ex);
                }
            }
            else
            {
                Erp_error.SetError(Txt_dpiMembe, "Deben ingresarse 13 dígitos.");
            }
        }
示例#2
0
        private void Btn_buscarEmpm_Click(object sender, EventArgs e) //BUSCAR EMPLEADO PARA MODIFICARLO.............................................
        {
            if (Txt_dpiEmpm.TextLength == 13)
            {
                Erp_error.SetError(Txt_dpiEmpm, "");
                try
                {
                    Gpb_datosEmpm.Visible = true;
                    OdbcDataAdapter sda   = new OdbcDataAdapter("SELECT em.sNombre, em.sApellido, em.sDireccion, te.itelefono, co.sCorreo, em.fSueldo, ca.sDescripcion, em.dFechaDeNacimiento FROM empleado em, telefono te, correo co, cargo ca WHERE em.nIdEmpleado = te.nIdPaciente AND em.nIdEmpleado = co.nIdPaciente AND em.iIdCargo = ca.iIdCargo AND em.nIdEmpleado ='" + Convert.ToInt64(Txt_dpiEmpm.Text) + "'", conexion.ObtenerConexion());
                    DataTable       datos = new DataTable();
                    sda.Fill(datos);

                    Txt_nombreEmpm.Text   = datos.Rows[0][0].ToString();
                    Txt_apellidoEmpm.Text = datos.Rows[0][1].ToString();
                    Txt_direEmpm.Text     = datos.Rows[0][2].ToString();
                    Txt_telEmpm.Text      = datos.Rows[0][3].ToString();
                    Txt_correoEmpm.Text   = datos.Rows[0][4].ToString();
                    Txt_sueldoEmpm.Text   = datos.Rows[0][5].ToString();
                    Txt_cargoEmpm.Text    = datos.Rows[0][6].ToString();
                    Dtp_fechaEmpm.Text    = datos.Rows[0][7].ToString();

                    Txt_cargoEmpm.Enabled = false;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Intente de nuevo.", "Error en la búsqueda.", MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation);
                    //MessageBox.Show("error:"+ex);
                }
            }
            else
            {
                Erp_error.SetError(Txt_dpiEmpm, "Deben ingresarse 13 dígitos.");
            }
        }
示例#3
0
        private void Btn_buscarm_Click(object sender, EventArgs e) //Buscar médico para modificar..........................................
        {
            if (Txt_colegiadoM.TextLength == 13)
            {
                Erp_error.SetError(Txt_colegiadoM, "");
                try
                {
                    Gpb_datos.Visible = true;
                    OdbcDataAdapter sda   = new OdbcDataAdapter("SELECT me.sNombre, me.sApellido, te.itelefono, me.sDireccion, co.sCorreo, es.sEspecialidad, em.sEmpresa, me.dFechaDeNacimiento FROM medicosasociados me, telefono te, correo co, especialidad es, empresa em  WHERE me.nNoColegiado = te.nIdPaciente AND me.nNoColegiado = co.nIdPaciente AND me.iIdEspecialidad = es.iIdEspecialidad AND me.iIdEmpresa = em.iIdEmpresa AND me.nNoColegiado = '" + Convert.ToInt64(Txt_colegiadoM.Text) + "'", conexion.ObtenerConexion());
                    DataTable       datos = new DataTable();
                    sda.Fill(datos);

                    Txt_nombreMedicoM.Text       = datos.Rows[0][0].ToString();
                    Txt_apellidoMedicoM.Text     = datos.Rows[0][1].ToString();
                    Txt_telefonoMedicoM.Text     = datos.Rows[0][2].ToString();
                    Txt_direMedicoM.Text         = datos.Rows[0][3].ToString();
                    Txt_correoMedicoM.Text       = datos.Rows[0][4].ToString();
                    Txt_especialidadMedicoM.Text = datos.Rows[0][5].ToString();
                    Txt_empresaMedicoM.Text      = datos.Rows[0][6].ToString();
                    Dtp_nacimiento.Text          = datos.Rows[0][7].ToString();

                    Txt_especialidadMedicoM.Enabled = false;
                    Txt_empresaMedicoM.Enabled      = false;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Intente de nuevo.", "Error en la búsqueda.", MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation);
                }
            }
            else
            {
                Erp_error.SetError(Txt_colegiadoM, "Deben ingresarse 13 dígitos.");
            }
        }
示例#4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void button2_Click(object sender, EventArgs e)  //Buscar paciente para modificarlo................................
 {
     if (Txt_expe.TextLength == 13)
     {
         Erp_error.SetError(Txt_expe, "");
         try
         {
             Pnl_modificarP.Visible = true;
             OdbcDataAdapter sda   = new OdbcDataAdapter("SELECT pa.sNombre, te.iTelefono  , pa.sNit, sa.sGrupoSanguineo, pa.sDireccion, co.sCorreo, pa.sAlergia, pa.sRefiere, pa.sGenero FROM paciente pa, telefono te, correo co, tipodesangre sa WHERE pa.nIdPaciente = te.nIdPaciente AND pa.nIdPaciente = co.nIdPaciente AND pa.iIdTipoDeSangre = sa.iIdTipoDeSangre AND pa.nIdPaciente='" + Convert.ToInt64(Txt_expe.Text) + "'", conexion.ObtenerConexion());
             DataTable       datos = new DataTable();
             sda.Fill(datos);
             //Llenar todos los campos con los datos del paciente encontrado................................
             Txt_nombre.Text     = datos.Rows[0][0].ToString();
             Txt_telefono.Text   = datos.Rows[0][1].ToString();
             Txt_nit.Text        = datos.Rows[0][2].ToString();
             Txt_tipoSangre.Text = datos.Rows[0][3].ToString();
             Txt_direccion.Text  = datos.Rows[0][4].ToString();
             Txt_correo.Text     = datos.Rows[0][5].ToString();;
             Txt_alergias.Text   = datos.Rows[0][6].ToString();
             Txt_refiere.Text    = datos.Rows[0][7].ToString();
             Cmb_sexo.Text       = datos.Rows[0][8].ToString();
             //Txt_tipoSangre.Enabled = false;
         }
         catch (Exception ex)
         {
             MessageBox.Show("Intente de nuevo DPI.", "Error en la búsqueda.", MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation);
         }
     }
     else
     {
         Erp_error.SetError(Txt_expe, "Deben ingresarse 13 dígitos.");
     }
 }
示例#5
0
 private void Txt_expe_Validating(object sender, CancelEventArgs e)
 {
     if (Txt_expe.TextLength != 8)
     {
         Erp_error.SetError(Txt_expe, "El DPI debe contener 13 dígitos.");
     }
     else
     {
         Erp_error.SetError(Txt_expe, "");
     }
 }
示例#6
0
        private void Btn_buscar_Click(object sender, EventArgs e)//BUSCAR SI EXISTE CLIENTE, SI NO... INGRESARLO.
        {
            if (Txt_dpi.TextLength == 13)
            {
                Erp_error.SetError(Txt_dpi, "");
                try
                {
                    OdbcDataAdapter sda   = new OdbcDataAdapter("SELECT sNombre, sNit, sDireccion FROM paciente WHERE nIdPaciente ='" + Convert.ToInt64(Txt_dpi.Text) + "'", conexion.ObtenerConexion());
                    DataTable       datos = new DataTable();
                    sda.Fill(datos);

                    if (datos.Rows.Count > 0)
                    {
                        Txt_nombrep.Text        = datos.Rows[0][0].ToString();
                        Txt_nitp.Text           = datos.Rows[0][1].ToString();
                        Txt_direp.Text          = datos.Rows[0][2].ToString();
                        Pnl_datosp.Enabled      = true;
                        Gpb_detalleCita.Enabled = true;
                    }
                    else
                    {
                        this.Hide();
                        new Paciente().ShowDialog();
                        this.Show();
                    }
                    //cargar el # de cita actual
                    obtenerId();
                    Lbl_numeroCita.Text = Convert.ToString(id + 1);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error al buscar paciente..");
                }
            }
            else
            {
                Erp_error.SetError(Txt_dpi, "Deben ingresarse 13 dígitos.");
            }
        }