Ejemplo n.º 1
0
        //PAQUETE DE CITAS
        public List <CitaUser> mostrarCitasAfiliado(int idusuario)
        {
            List <CitaUser> citas = new List <CitaUser>();

            //try
            //{

            oracle.getSetComando             = new OracleCommand("ADM_CITAS.MOSTRAR_CITAS_AFILIADO", oracle.getSetConeccion);
            oracle.getSetComando.CommandType = CommandType.StoredProcedure;
            oracle.getSetComando.Parameters.Add("PIDUSUARIO", OracleDbType.Int32, idusuario, ParameterDirection.Input);
            oracle.getSetComando.Parameters.Add("VARIABLE_CURSOR", OracleDbType.RefCursor, ParameterDirection.Output);
            oracle.getSetLeer = oracle.getSetComando.ExecuteReader();

            while (oracle.getSetLeer.Read())
            {
                int      idcita       = Convert.ToInt32(oracle.getSetLeer.GetValue(0));
                string   tipoatencion = oracle.getSetLeer.GetValue(1).ToString();
                string   fecha        = oracle.getSetLeer.GetValue(2).ToString();
                int      hora         = Convert.ToInt32(oracle.getSetLeer.GetValue(3).ToString());
                CitaUser cita         = new CitaUser(idcita, tipoatencion, null, fecha, hora);
                citas.Add(cita);
            }
            return(citas);

            //}
            //catch
            //{
            //    return citas;
            //}
        }
Ejemplo n.º 2
0
        public List <CitaUser> mostrarCitasMedico()
        {
            List <CitaUser> citas = new List <CitaUser>();

            try
            {
                oracle.getSetComando             = new OracleCommand("ADM_CITAS.MOSTRAR_CITAS_MEDICO", oracle.getSetConeccion);
                oracle.getSetComando.CommandType = CommandType.StoredProcedure;
                oracle.getSetComando.Parameters.Add("PIDMEDICO", OracleDbType.Int32, this.idmedico, ParameterDirection.Input);
                oracle.getSetComando.Parameters.Add("VARIABLE_CURSOR", OracleDbType.RefCursor, ParameterDirection.Output);
                oracle.getSetLeer = oracle.getSetComando.ExecuteReader();

                while (oracle.getSetLeer.Read())
                {
                    int      idcita        = Convert.ToInt32(oracle.getSetLeer.GetValue(0));
                    string   tipoatencion  = oracle.getSetLeer.GetValue(1).ToString();
                    string   nombreusuario = oracle.getSetLeer.GetValue(2).ToString();
                    string   fecha         = oracle.getSetLeer.GetValue(3).ToString();
                    int      hora          = Convert.ToInt32(oracle.getSetLeer.GetValue(4).ToString());
                    CitaUser cita          = new CitaUser(idcita, tipoatencion, nombreusuario, fecha, hora);
                    citas.Add(cita);
                }
                return(citas);
            }
            catch
            {
                return(citas);
            }
        }