Exemplo n.º 1
0
        public void ModificarMagistralTest()
        {
            Magistral_Logica magistral_Logica = new Magistral_Logica();
            bool             recibido         = magistral_Logica.ModificarMagistral(new Magistral()
            {
                nombre          = "Herendira",
                apellidoPaterno = "Joaquines",
                apellidoMaterno = "Gutierrez"
            });

            Assert.AreEqual(recibido, true);
        }
Exemplo n.º 2
0
        public void RecuperarMagistralEventoTest()
        {
            Magistral_Logica      magistral_Logica = new Magistral_Logica();
            List <List <string> > listaRecibida    = magistral_Logica.RecuperarMagistralEvento(1);
            List <List <string> > listaEsperada    = new List <List <string> >();

            listaEsperada.Add(new List <string>(new string[]
            {
                "Herendira Joaquines Gutierrez", /*nombre completo*/
                "02/02/2020"                     /*fecha MM/dd/yyyy*/
            }));

            listaRecibida.Should().BeEquivalentTo(listaEsperada);
        }
Exemplo n.º 3
0
        public void RecuperarMagistralTest()
        {
            Magistral_Logica magistral_Logica = new Magistral_Logica();
            List <Magistral> listaRecibida    = magistral_Logica.RecuperarMagistral();
            List <Magistral> listaEsperada    = new List <Magistral>();

            listaEsperada.Add(new Magistral()
            {
                Id              = 2,
                nombre          = "Herendira",
                apellidoPaterno = "Joaquines",
                apellidoMaterno = "Gutierrez",
                AdscripcionId   = 1
            });

            listaRecibida.Should().BeEquivalentTo(listaEsperada);
        }
        private bool ModificarEvento()
        {
            Magistral_Logica magistral_Logica = new Magistral_Logica();

            if (textBlock_mensaje.Text.Equals("sin conexion") ||
                !magistral_Logica.ComprobarConexion())
            {
                textBlock_mensaje.Text       = String.Empty;
                textBlock_mensaje.Text       = "Se ha perdido conexión con la base de datos";
                textBlock_mensaje.Foreground = Brushes.Red;
                textBlock_mensaje.FontWeight = FontWeights.Bold;
                return(true);
            }

            Magistral magistralActualizado = new Magistral()
            {
                Id              = magistralModificar.Id,
                nombre          = textbox_nombre.Text,
                apellidoMaterno = textbox_apellidoM.Text,
                apellidoPaterno = textbox_apellidoP.Text
            };

            return(magistral_Logica.ModificarMagistral(magistralActualizado));
        }
        private void LlenarComboBox()
        {
            Magistral_Logica magistral_Logica = new Magistral_Logica();

            if (!magistral_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.listaMagistral = magistral_Logica.RecuperarMagistral();
                foreach (Magistral magistral in listaMagistral)
                {
                    comboBox_magistral.Items.Add(magistral.nombre + " " +
                                                 magistral.apellidoPaterno + " " + magistral.apellidoMaterno);
                }
            }
        }
        private void llenarComboBox()
        {
            Evento_Logica evento_Logica = new Evento_Logica();

            if (!evento_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);
                button_cancelar.Content     = "Regresar";
                button_descargar.Visibility = Visibility.Hidden;
            }
            else
            {
                this.eventosUsuario =
                    evento_Logica.RecuperarEventos(this.miembroComite.ComiteId).First <Modelo.Evento>();
                MiembroComite_Logica miembroComite_Logica = new MiembroComite_Logica();
                Asistente_Logica     asistente_Logica     = new Asistente_Logica();
                Participante_Logica  participante_Logica  = new Participante_Logica();
                Magistral_Logica     magistral_Logica     = new Magistral_Logica();
                Autor_Logica         autor_Logica         = new Autor_Logica();

                this.listaMiembroC =
                    miembroComite_Logica.RecuperarMiembroComitePorEvento(eventosUsuario.Id);
                this.listaAsistente =
                    asistente_Logica.RecuperarAsistenteEvento(eventosUsuario.Id);
                this.listaParticipante =
                    participante_Logica.RecuperarParticipanteEvento(eventosUsuario.Id);
                this.listaMagistral =
                    magistral_Logica.RecuperarMagistralEvento(eventosUsuario.Id);
                this.listaAutor =
                    autor_Logica.RecuperarAutorEvento(eventosUsuario.Id);

                foreach (Modelo.MiembroComite miembro in listaMiembroC)
                {
                    string nombreCompleto = miembro.nombre + " " + miembro.apellidoPaterno +
                                            " " + miembro.apellidoMaterno;
                    comboBox_miembroComite.Items.Add(new CheckBox()
                    {
                        Content = nombreCompleto
                    });
                }
                foreach (string asistenteNombre in listaAsistente)
                {
                    comboBox_asistente.Items.Add(new CheckBox()
                    {
                        Content = asistenteNombre
                    });
                }
                foreach (List <string> participante in listaParticipante)
                {
                    comboBox_participante.Items.Add(new CheckBox()
                    {
                        Content = participante[0]
                    });
                }
                foreach (List <string> magistral in listaMagistral)
                {
                    comboBox_magistral.Items.Add(new CheckBox()
                    {
                        Content = magistral[0]
                    });
                }
                foreach (List <string> autor in listaAutor)
                {
                    comboBox_autor.Items.Add(new CheckBox()
                    {
                        Content = autor[0]
                    });
                }
            }
        }