Ejemplo n.º 1
0
 public PartidoCompletoCO(EquipoVO equipoLocal, EquipoVO equipoVisitante,
                          PartidoVO partido, List <PartidoJugadoBasicoCO> jugadoresTitularesLocal,
                          List <PartidoJugadoBasicoCO> jugadoresTitularesVisitante, List <PartidoJugadoBasicoCO> jugadoresNoTitularesLocal,
                          List <PartidoJugadoBasicoCO> jugadoresNoTitularesVisitante, List <GolCO> golesLocal,
                          List <GolCO> golesVisitante, List <TarjetaCO> tarjetasLocal, List <TarjetaCO> tarjetasVisitante,
                          EstadioVO estadio, ArbitroVO arbitro, String cronica, List <CambioCO> cambiosLocal,
                          List <CambioCO> cambiosVisitante)
 {
     this.EquipoLocal                   = equipoLocal;
     this.EquipoVisitante               = equipoVisitante;
     this.Partido                       = partido;
     this.JugadoresTitularesLocal       = jugadoresTitularesLocal;
     this.JugadoresTitularesVisitante   = jugadoresTitularesVisitante;
     this.JugadoresNoTitularesLocal     = jugadoresNoTitularesLocal;
     this.JugadoresNoTitularesVisitante = jugadoresNoTitularesVisitante;
     this.GolesLocal                    = golesLocal;
     this.GolesVisitante                = golesVisitante;
     this.TarjetasLocal                 = tarjetasLocal;
     this.TarjetasVisitante             = tarjetasVisitante;
     this.Arbitro                       = arbitro;
     this.Estadio                       = estadio;
     this.Cronica                       = cronica;
     this.CambiosLocal                  = cambiosLocal;
     this.CambiosVisitante              = cambiosVisitante;
 }
Ejemplo n.º 2
0
        public object execute(DbConnection connection)
        {
            ArbitroDAO arbitroDAO      = new ArbitroDAO();
            ArbitroVO  arbitroVOcreado = arbitroDAO.create(connection, null, arbitroVO);

            return(arbitroVOcreado);
        }
Ejemplo n.º 3
0
        public ArbitroVO crearArbitro(ArbitroVO arbitroVO)
        {
            try
            {
                CrearArbitroAction action = new CrearArbitroAction(arbitroVO);

                return((ArbitroVO)PlainActionProcessor.process(dbFactory, action));
            }
            catch (InternalErrorException e) { throw e; }
            catch (Exception e) { throw new InternalErrorException(e); }
        }
Ejemplo n.º 4
0
        public ArbitroVO create(DbConnection connection, DbTransaction transaction,
                                ArbitroVO arbitroVO)
        {
            try
            {
                DbCommand command = connection.CreateCommand();

                if (transaction != null)
                {
                    command.Transaction = transaction;
                }

                command.CommandText = "INSERT INTO Arbitro (nombre,apellidos,anos_activo,colegio,foto)" +
                                      "values (@nombre,@apellidos,@anos_activo,@colegio,@foto)";

                DbParameter nombreParam = command.CreateParameter();
                nombreParam.ParameterName = "@nombre";
                nombreParam.DbType        = DbType.String;
                nombreParam.Value         = arbitroVO.Nombre;
                nombreParam.Size          = 20;
                command.Parameters.Add(nombreParam);


                DbParameter apellidosParam = command.CreateParameter();
                apellidosParam.ParameterName = "@apellidos";
                apellidosParam.DbType        = DbType.String;
                apellidosParam.Value         = arbitroVO.Apellidos;
                apellidosParam.Size          = 30;
                command.Parameters.Add(apellidosParam);

                DbParameter anos_activoParam = command.CreateParameter();
                anos_activoParam.ParameterName = "@anos_activo";
                anos_activoParam.DbType        = DbType.Int32;
                anos_activoParam.Value         = arbitroVO.Anos_Activo;
                anos_activoParam.Size          = 100;
                command.Parameters.Add(anos_activoParam);


                DbParameter colegioParam = command.CreateParameter();
                colegioParam.ParameterName = "@colegio";
                colegioParam.DbType        = DbType.String;
                colegioParam.Value         = arbitroVO.Colegio;
                colegioParam.Size          = 30;
                command.Parameters.Add(colegioParam);


                DbParameter fotoParam = command.CreateParameter();
                fotoParam.ParameterName = "@foto";
                fotoParam.DbType        = DbType.String;
                fotoParam.Size          = 50;
                if (arbitroVO.Foto == null)
                {
                    fotoParam.Value = DBNull.Value;
                }
                else
                {
                    fotoParam.Value = arbitroVO.Foto;
                }

                command.Parameters.Add(fotoParam);

                command.Prepare();

                int insertedRows = command.ExecuteNonQuery();

                if (insertedRows == 0)
                {
                    throw new SQLException("errorrrrrrr");
                }

                IArbitroIdentifierRetriever arbitroIdentifierRetriever = ArbitroIdentifierRetrieverFactory.GetRetriever();

                Int64 arbitroIdentifier = arbitroIdentifierRetriever.GetGeneratedIdentifier(connection);

                return(new ArbitroVO((int)arbitroIdentifier, arbitroVO.Nombre, arbitroVO.Apellidos,
                                     arbitroVO.Colegio, arbitroVO.Anos_Activo, arbitroVO.Foto));
            }
            catch (DbException e)
            {
                throw new InternalErrorException(e);
            }
        }
Ejemplo n.º 5
0
 public CrearArbitroAction(ArbitroVO arbitroVO)
 {
     this.arbitroVO = arbitroVO;
 }
Ejemplo n.º 6
0
 public ArbitroCO(ArbitroVO arbitroVO, List <PartidoCompeticionJornadaCO> listaPartidos)
 {
     this.arbitroVO     = arbitroVO;
     this.listaPartidos = listaPartidos;
 }