コード例 #1
0
        public bool Delete()
        {
            try
            {
                VideoJuegos.DALC.juego juegoEliminado = CommonBC.BroGames.juego.First
                                                        (
                    game => game.idJuego == this.idJuego
                                                        );

                CommonBC.BroGames.juego.Remove(juegoEliminado);

                CommonBC.BroGames.SaveChanges();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
コード例 #2
0
        public bool Read()
        {
            try
            {
                VideoJuegos.DALC.juego juego = CommonBC.BroGames.juego.First
                                               (
                    game => game.idJuego == this.idJuego
                                               );

                this.NombreJuego     = juego.nombreJuego;
                this.TipoJuego       = juego.tipoJuego;
                this.FechaJuego      = juego.fechaPublicacion;
                this.PlataformaJuego = juego.plataforma;
                this.PrecioJuego     = juego.precio;

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
コード例 #3
0
        public bool Update()
        {
            try
            {
                VideoJuegos.DALC.juego juegoActualizado = CommonBC.BroGames.juego.First
                                                          (
                    game => game.idJuego == this.idJuego
                                                          );

                juegoActualizado.nombreJuego      = this.NombreJuego;
                juegoActualizado.tipoJuego        = this.TipoJuego;
                juegoActualizado.fechaPublicacion = this.FechaJuego;
                juegoActualizado.plataforma       = this.PlataformaJuego;
                juegoActualizado.precio           = this.PrecioJuego;

                CommonBC.BroGames.SaveChanges();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }