Пример #1
0
        public DataTable TipoTratamiento()
        {
            string           consulta = "Select nombreTipoTratamiento from tbl_tipotratamiento order by codigoTipoTratamiento;";
            MySqlCommand     comando  = new MySqlCommand(consulta, con.abrir_conexion());
            MySqlDataAdapter da       = new MySqlDataAdapter(comando);

            using (DataTable dt = new DataTable())
            {
                da.Fill(dt);
                con.cerrar_Conexion();
                return(dt);
            }
        }
Пример #2
0
 public void agregarPaciente(String ced, String nom1, String nom2, String ape1, String ape2, String gen, String tel, String cel, String dir, String enc, String corr, String fechN, String fechI, String nom1Enc, String nom2Enc, String ape1Enc, String ape2Enc, String generoEnc, String telEnc, String celEnc, String dirEnc, String correoEnc, String parentezco)
 {
     if (enc.Equals(""))
     {
         consultar.ejecutar_consulta("INSERT INTO tbl_paciente (`cedulaPaciente`, `nombre1Paciente`, `nombre2Paciente`, `apellido1Paciente`, `apellido2Paciente`, `generoPaciente`, `telefonoPaciente`, `celularPaciente`, `direccionPaciente`, `correoPaciente`, `fechaNacimientoPaciente`, `fechaInscripcionPaciente`) VALUES('" + ced + "','" + nom1 + "','" + nom2 + "','" + ape1 + "','" + ape2 + "','" + gen + "','" + tel + "','" + cel + "','" + dir + "','" + corr + "','" + fechN + "','" + fechI + "');", con.abrir_conexion()).ExecuteNonQuery();
         con.cerrar_Conexion();
     }
     else
     {
         consultar.ejecutar_consulta("INSERT INTO tbl_encargado (`cedulaEncargado`, `nombre1Encargado`, `nombre2Encargado`, `apellido1Encargado`, `apellido2Encargado`, `generoEncargado`, `telefonoEncargado`, `celularEncargado`, `direccionEncargado`, `parentescoEncargado`, `correoEncargado`) VALUES('" + enc + "', '" + nom1Enc + "', '" + nom2Enc + "','" + ape1Enc + "','" + ape2Enc + "','" + generoEnc + "','" + telEnc + "','" + celEnc + "','" + dirEnc + "','" + parentezco + "','" + correoEnc + "');", con.abrir_conexion()).ExecuteNonQuery();
         con.cerrar_Conexion();
         consultar.ejecutar_consulta("INSERT INTO tbl_paciente (`cedulaPaciente`, `nombre1Paciente`, `nombre2Paciente`, `apellido1Paciente`, `apellido2Paciente`, `generoPaciente`, `telefonoPaciente`, `celularPaciente`, `direccionPaciente`, `cedulaEncargado`, `correoPaciente`, `fechaNacimientoPaciente`, `fechaInscripcionPaciente`) VALUES('" + ced + "','" + nom1 + "', '" + nom2 + "', '" + ape1 + "','" + ape2 + "','" + gen + "','" + tel + "','" + cel + "','" + dir + "','" + enc + "','" + corr + "','" + fechN + "','" + fechI + "');", con.abrir_conexion()).ExecuteNonQuery();
         con.cerrar_Conexion();
     }
 }
Пример #3
0
        public void agregarExpediente(string cedulaEx, string fecharegistro, string pregunta1, string pregunta2, string pregunta3, string pregunta4, string pregunta5, string anemia, string pregunta6, string pregunta7, string donde, string cuanto, string pregunta8, string pregunta9, string pregunta10, string pregunta11, string pregunta12, string pregunta13, string pregunta14, string pregunta15, string pregunta16, string pregunta17, string pregunta18, string pregunta19, string pregunta20, string peso, string pregunta21, string pregunta22, string pregunta23, string pregunta24, string pregunta25, string pregunta26, string pregunta27, string pregunta28, string pregunta29, string cigarros, string cuanto2, string bebedor, string pregunta30, string pregunta31, string pregunta32, String descripción)
        {
            //try
            //{
            MySqlDataReader agregar = consultar.ejecutar_consulta("Insert into tbl_expediente (cedulaPaciente,fechaRegistro,enfermedadesCardiacos,presionArterial,fiebreReumatica,`VIH+SIDA`,derrame,anemia,transfusionSangre,fueraDelPais,lugarFueraDelPais,tiempoFueraDelPais,moretes,problemasDeRinnon,problemasGastrointestinales,problemasVision,tratamientosCorticoesteroides,diabetes,epilepsia,enfermedadesRespiratorias,radioterapiaQuimioterapia,reumatismo," +
                                                                  "problemasHepaticos,virusHerpes,perdidaDePeso,aumentoDePeso,artitris,tratamientoPsiquiatrico,problemaDeTiroides,enfermedadesTransmisionSexual,osteoporosis,migranna,tratamientoBifosfonados,consumeDrogas,fumador,cigarrosXdia,periodoFumado,bebedor" +
                                                                  ",frecuenciaBebedor,`cicatrices/tatuajes`,shockAnafilactico,observacionExpediente) values( '" + cedulaEx + "','" + fecharegistro + "', '" + pregunta1 + "', '" + pregunta2 + "', '" + pregunta3 + "', '" + pregunta4 + "', '" + pregunta5 + "', '" + anemia + "', " +
                                                                  "'" + pregunta6 + "', '" + pregunta7 + "', '" + donde + "', '" + cuanto + "', '" + pregunta8 + "','" + pregunta9 + "', '" + pregunta10 + "', '" + pregunta11 + "', '" + pregunta12 + "', '" + pregunta13 + "', '" + pregunta14 + "', '" + pregunta15 + "', '" + pregunta16 + "', '" + pregunta17 + "'," +
                                                                  " '" + pregunta18 + "', '" + pregunta19 + "', '" + pregunta20 + "' , '" + peso + "' ,'" + pregunta21 + "', '" + pregunta22 + "', '" + pregunta23 + "', '" + pregunta24 + "', '" + pregunta25 + "', '" + pregunta26 + "', '" + pregunta27 + "', '" + pregunta28 + "','" + pregunta29 + "'," +
                                                                  " '" + cigarros + "', '" + cuanto2 + "', '" + bebedor + "', '" + pregunta30 + "', '" + pregunta31 + "', '" + pregunta32 + "', '" + descripción + "');", con.abrir_conexion()).ExecuteReader();

            con.cerrar_Conexion();
            //}
            //catch
            //{

            //}
        }
Пример #4
0
        public Boolean Estausuario(String usuario)
        {
            Boolean         esta     = false;
            MySqlDataReader busqueda = consultar.ejecutar_consulta("call pa_user('" + usuario + "');", con.abrir_conexion()).ExecuteReader();

            while (busqueda.Read())
            {
                esta = true;
            }
            con.cerrar_Conexion();
            return(esta);
        }
Пример #5
0
        public DataTable mostrarCita()
        {
            string           consulta = "select * from tbl_cita ;";
            MySqlCommand     comando  = new MySqlCommand(consulta, con.abrir_conexion());
            MySqlDataAdapter da       = new MySqlDataAdapter(comando);

            using (DataTable dt = new DataTable())
            {
                da.Fill(dt);
                return(dt);
            }
        }
Пример #6
0
        public String[,] Cita()
        {
            String[,] matriz;
            string           consulta = "select * from tbl_cita order by fechaReservaCita, horaCita;";
            MySqlCommand     comando  = new MySqlCommand(consulta, con.abrir_conexion());
            MySqlDataAdapter da       = new MySqlDataAdapter(comando);

            using (DataSet dt = new DataSet())
            {
                da.Fill(dt);
                matriz = new String[dt.Tables[0].Rows.Count, dt.Tables[0].Columns.Count];
                for (int i = 0; i <= dt.Tables[0].Rows.Count - 1; i++)
                {
                    for (int j = 0; j <= dt.Tables[0].Columns.Count - 1; j++)
                    {
                        matriz[i, j] = System.Convert.ToString(dt.Tables[0].Rows[i].ItemArray[j]);
                    }
                }
                con.cerrar_Conexion();
            }
            return(matriz);
        }
Пример #7
0
        //Insertar colores en la BD
        public void agregarOdontograma(String col, String die, String secc, String codE, String fech, String odont)
        {
            string y = "";

            consultar.ejecutar_consulta("INSERT INTO tbl_odontograma (`colorOdontograma`, `dienteOdontograma`, `seccionOdontograma`, `tipoPacienteOdontograma`) VALUES ('" + col + "', '" + die + "', '" + secc + "', '" + odont + "');", con.abrir_conexion()).ExecuteNonQuery();
            MySqlDataReader contador = consultar.ejecutar_consulta("SELECT max(codigoOdontograma) from tbl_odontograma; ", con.abrir_conexion()).ExecuteReader();

            if (contador.Read())
            {
                y = contador.GetString(0);
            }
            consultar.ejecutar_consulta("INSERT INTO tbl_expedienteodontograma (`codigoExpediente`, `codigoOdontograma`, `fechaTratamientoOdontograma`) VALUES ('" + codE + "','" + y + "', '" + fech + "');", con.abrir_conexion()).ExecuteNonQuery();

            con.cerrar_Conexion();
        }
Пример #8
0
        public DataTable VentaPendiente()
        {
            string           consulta = "select tbl_paciente.cedulaPaciente, tbl_paciente.nombre1Paciente, tbl_paciente.nombre2Paciente, tbl_paciente.apellido1Paciente, tbl_paciente.apellido2Paciente from tbl_paciente, tbl_expediente, tbl_expedientetramiento where tbl_paciente.cedulaPaciente = tbl_expediente.cedulaPaciente and tbl_expediente.codigoExpediente = tbl_expedientetramiento.codigoExpediente and tbl_expedientetramiento.EstadoPago = false group by tbl_expedientetramiento.codigoExpediente;";
            MySqlCommand     comando  = new MySqlCommand(consulta, con.abrir_conexion());
            MySqlDataAdapter da       = new MySqlDataAdapter(comando);

            using (DataTable dt = new DataTable())
            {
                da.Fill(dt);
                con.cerrar_Conexion();
                return(dt);
            }
        }