示例#1
0
        public void EliminarActor()
        {
            FabricaEntidades fabrica = new FabricaEntidades();
            Entidad          entidad = fabrica.ObtenerActor();

            entidad.Id = 6;
            FabricaDAOSqlServer fabricaDAO = new FabricaDAOSqlServer();

            Datos.IntefazDAO.Modulo6.IDaoActor daoActor = fabricaDAO.ObtenerDAOActor();
            Assert.IsTrue(daoActor.EliminarActor(entidad.Id));
        }
示例#2
0
        public void ConsultarActoresPorCasosDeUso()
        {
            FabricaEntidades fabrica = new FabricaEntidades();
            Entidad          entidad = fabrica.ObtenerCasoDeUso();
            CasoDeUso        Cuso    = entidad as CasoDeUso;

            Cuso.Id = 6;
            FabricaDAOSqlServer fabricaDAO = new FabricaDAOSqlServer();

            Datos.IntefazDAO.Modulo6.IDaoActor daoActor = fabricaDAO.ObtenerDAOActor();
            Assert.IsNotNull(daoActor.ConsultarActoresXCasoDeUso(Cuso.Id));
        }
示例#3
0
        public void VerificarLaExistenciaDelActor()
        {
            FabricaEntidades fabrica = new FabricaEntidades();
            Entidad          entidad = fabrica.ObtenerActor();
            Actor            actor   = entidad as Actor;

            actor.NombreActor = "Usuario";
            FabricaDAOSqlServer fabricaDAO = new FabricaDAOSqlServer();

            Datos.IntefazDAO.Modulo6.IDaoActor daoActor = fabricaDAO.ObtenerDAOActor();
            Assert.IsTrue(daoActor.VerificarExistenciaActor(actor.NombreActor));
        }
示例#4
0
        public void ConsultarActorPorId()
        {
            FabricaEntidades fabrica = new FabricaEntidades();
            Entidad          entidad = fabrica.ObtenerActor();
            Actor            actor   = entidad as Actor;

            actor.Id = 2;
            FabricaDAOSqlServer fabricaDAO = new FabricaDAOSqlServer();

            Datos.IntefazDAO.Modulo6.IDaoActor daoActor = fabricaDAO.ObtenerDAOActor();
            Assert.IsNotNull(daoActor.ConsultarXId(actor));
        }
示例#5
0
        public void ConsultaActoresParaCombo()
        {
            FabricaEntidades fabrica     = new FabricaEntidades();
            Entidad          entidad     = fabrica.ObtenerActor();
            Entidad          entidadProy = FabricaEntidades.ObtenerProyecto();
            Proyecto         proyecto    = entidadProy as Proyecto;

            proyecto.Codigo = "TOT";

            FabricaDAOSqlServer fabricaDAO = new FabricaDAOSqlServer();

            Datos.IntefazDAO.Modulo6.IDaoActor daoActor = fabricaDAO.ObtenerDAOActor();
            Assert.IsNotNull(daoActor.ConsultarActoresCombo(proyecto.Codigo));
        }
        public override List <Entidad> Ejecutar(string parametro)
        {
            try
            {
                FabricaDAOSqlServer laFabrica = new FabricaDAOSqlServer();
                IDaoActor           daoActor  = laFabrica.ObtenerDAOActor();

                return(daoActor.ConsultarListarActores(parametro));
            }
            catch (BDDAOException ex)
            {
                ComandoBDException exComandoAgregarActor = new ComandoBDException(
                    RecursosComandosModulo6.CodigoExcepcionComandoBD,
                    RecursosComandosModulo6.MensajeExcepcionComandoBD,
                    ex);

                Logger.EscribirError(RecursosComandosModulo6.ClaseComandoAgregarActor,
                                     exComandoAgregarActor);

                throw exComandoAgregarActor;
            }


            catch (ObjetoNuloDAOException ex)
            {
                ComandoNullException exComandoAgregarActor = new ComandoNullException(
                    RecursosComandosModulo6.CodigoExcepcionComandoObjetoNulo,
                    RecursosComandosModulo6.MensajeExcepcionComandoObjetoNulo,
                    ex);

                Logger.EscribirError(RecursosComandosModulo6.ClaseComandoAgregarActor,
                                     exComandoAgregarActor);

                throw exComandoAgregarActor;
            }

            catch (ErrorDesconocidoDAOException ex)
            {
                ComandoException exComandoAgregarActor = new ComandoException(
                    RecursosComandosModulo6.CodigoExcepcionComandoError,
                    RecursosComandosModulo6.MensajeExcepcionComandoError,
                    ex);

                Logger.EscribirError(RecursosComandosModulo6.ClaseComandoAgregarActor,
                                     exComandoAgregarActor);

                throw exComandoAgregarActor;
            }
        }
示例#7
0
        public void ModificarActor()
        {
            FabricaEntidades fabrica     = new FabricaEntidades();
            Entidad          entidad     = fabrica.ObtenerActor();
            Entidad          entidadProy = FabricaEntidades.ObtenerProyecto();

            entidad.Id = 6;
            Actor actor = entidad as Actor;

            actor.NombreActor      = "Estudiante";
            actor.DescripcionActor = "Presentar";
            FabricaDAOSqlServer fabricaDAO = new FabricaDAOSqlServer();

            Datos.IntefazDAO.Modulo6.IDaoActor daoActor = fabricaDAO.ObtenerDAOActor();
            Assert.IsTrue(daoActor.Modificar(actor));
        }
示例#8
0
        public void AgregarActor()
        {
            FabricaEntidades fabrica     = new FabricaEntidades();
            Entidad          entidad     = fabrica.ObtenerActor();
            Entidad          entidadProy = FabricaEntidades.ObtenerProyecto();

            entidad.Id = 6;
            Actor actor = entidad as Actor;

            actor.NombreActor      = "Estudiante";
            actor.DescripcionActor = "Presentar parciales";
            Proyecto proyecto = entidadProy as Proyecto;

            proyecto.Codigo        = "TOT";
            actor.ProyectoAsociado = proyecto;
            FabricaDAOSqlServer fabricaDAO = new FabricaDAOSqlServer();

            Datos.IntefazDAO.Modulo6.IDaoActor daoActor = fabricaDAO.ObtenerDAOActor();
            Assert.IsTrue(daoActor.Agregar(actor));
        }