コード例 #1
0
        private void LlenarListaAutores()
        {
            Autor_Logica autor_Logica = new Autor_Logica();

            if (!autor_Logica.ComprobarConexion())
            {
                textBlock_mensaje.Text = String.Empty;
                var bold = new Bold(new Run("Se ha perdido conexión con la base de datos")
                {
                    Foreground = Brushes.Red
                });
                textBlock_mensaje.Inlines.Add(bold);
            }
            else
            {
                listaAutor =
                    autor_Logica.RecuperarAutor();
                listaRbAutor = new List <RadioButton>();

                foreach (List <string> autor in listaAutor)
                {
                    InsertarAutor(autor[0] + " " + autor[1] + " " + autor[2]);
                }
            }
        }
コード例 #2
0
        private void LlenarComboBox()
        {
            Autor_Logica autor_Logica = new Autor_Logica();

            if (!autor_Logica.ComprobarConexion())
            {
                textBlock_mensaje.Text = String.Empty;
                var bold = new Bold(
                    new Run("Se ha perdido conexión con la base de datos")
                {
                    Foreground = Brushes.Red
                });
                textBlock_mensaje.Inlines.Add(bold);
            }
            else
            {
                this.listaAutor = autor_Logica.RecuperarAutor();
                foreach (var autor in listaAutor)
                {
                    string nombreCompleto = autor[0] + " " + autor[1] + " " + autor[2];
                    comboBox_autor.Items.Add(new CheckBox()
                    {
                        Content = nombreCompleto
                    });
                }
            }
        }