コード例 #1
0
        public ActionResult FotosVideos(Partida partida)
        {
            //Trannsformo o objeto de partida em foto para salvar no banco de dados.
            FotosVideos fotosVideos = new FotosVideos();

            fotosVideos.IdCampeonato = partida.IdCampeonato;
            fotosVideos.IdPartida    = partida.Id.ToString();
            fotosVideos.Rodada       = partida.Rodada;
            fotosVideos.Caminho      = partida.EscudoPequenoMandante;
            fotosVideos.Video        = partida.GolMandante;
            fotosVideos.Descricao    = partida.NomeCampeonato;
            if (partida.IdTimeMandante != null)
            {
                fotosVideos.IdTime = partida.IdTimeMandante;
            }
            else
            {
                fotosVideos.IdTime = partida.IdTimeVisitante;
            }

            if (appFotoVideo.Inserir(fotosVideos))
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                return(RedirectToAction("FotosVideos", new RouteValueDictionary(
                                            new { controller = "Partida", action = "FotosVideos", id = partida.Id })));
            }
        }
コード例 #2
0
        public Boolean Inserir(FotosVideos fotosVideos)
        {
            FotoVideoRepositorioADO fotoVideoADO = new FotoVideoRepositorioADO();

            return(fotoVideoADO.Inserir(fotosVideos));
        }
コード例 #3
0
 public ActionResult Cadastrar(FotosVideos fotos)
 {
     return(View());
 }