示例#1
0
        /***************************************/

        public void llamarServidor()
        {
            while (true)
            {
                int idSocio = Convert.ToInt32(cls_generales.Servidor());
                cls_lockers.m_idSocio = idSocio;
                string respuesta = cls_lockers.buscar_lockers_ocupados();
                if(respuesta.Equals("1"))
                {
                    sonido.Stream = Properties.Resources._02_01_04;
                    sonido.Play();
                }


                cls_socios.m_IdSocio = idSocio ;
                DataTable dt = cls_socios.DatosSocio();
                foreach (DataRow filas in dt.Rows)
                {
                   // MessageBox.Show(filas["Nombre"].ToString());

                    //txtNombre.Text = "hola";
                    //txtFechaVencimiento.Text = filas["Vencimiento"].ToString().Substring(0, 10);
                    byte[] imageBuffer = (byte[])filas["Foto"];
                    // Se crea un MemoryStream a partir de ese buffer
                    MemoryStream ms = new MemoryStream(imageBuffer);
                    // Se utiliza el MemoryStream para extraer la imagen
                    ptbImagenSocio.Image = Image.FromStream(ms);
                    
                }


            }
        }
示例#2
0
        /***************************************/

        public void llamarServidor()
        {
            while (true)
            {
                int idSocio = Convert.ToInt32(cls_generales.Servidor());
                cls_lockers.m_idSocio = idSocio;
                string respuesta = cls_lockers.buscar_lockers_ocupados();
                //if(respuesta.Equals("1"))
                //{
                //    //sonido.Stream = Properties.Resources._02_01_04;
                //    //sonido.Play();
                //}


                cls_socios.m_IdSocio = idSocio;
                DataTable dt = cls_socios.DatosSocio();
                Invoke(new MethodInvoker(delegate
                {
                    dataGridView1.DataSource = dt;
                    dataGridView1.Columns.RemoveAt(2);
                    foreach (DataRow filas in dt.Rows)
                    {
                        // MessageBox.Show(filas["Nombre"].ToString());

                        //txtNombre.Text = "hola";


                        txtNombre.Text = filas["Nombre"].ToString();
                        /// txtFechaVencimiento.Text = filas["Vencimiento"].ToString().Substring(0, 10);
                        //  Ejemplo: Mostrar datos de los eventos
                        // enviados por el Thread en una ListBox



                        //txtFechaVencimiento.BeginInvoke(new myDelegate(myMethod), new Object[] { 1, "This is the string" });

                        byte[] imageBuffer = (byte[])filas["Foto"];
                        // Se crea un MemoryStream a partir de ese buffer
                        MemoryStream ms = new MemoryStream(imageBuffer);
                        // Se utiliza el MemoryStream para extraer la imagen
                        ptbImagenSocio.Image = Image.FromStream(ms);
                    }
                }));
            }
        }