public void AdicionarVideo(String id) { LimparCamposVideo(); GaleriaSelecionado = new GaleriaBO().SelectById(id.ToInt32()); this.AcaoTelaVideo = Common.AcaoTela.Inclusao; winVideo.Title = "Cadastrando Video"; CarregarGalerias(GaleriaSelecionado); cboGaleria.SetValue(GaleriaSelecionado.Id); winVideo.Show(); }
private void VisualizarVideos(object sender, DirectEventArgs e) { GaleriaSelecionada = new GaleriaBO().SelectById(e.ExtraParams["id"].ToInt32()); FotoSelecionada = null; strVideos.DataSource = GaleriaSelecionada.Videos.Where(x => x.Removido == false).ToList(); strVideos.DataBind(); if (GaleriaSelecionada.Videos.Count > 0) { dtVideos.SelectedRows.Add(new SelectedRow(0)); dtVideos.UpdateSelection(); VideoSelecionado = GaleriaSelecionada.Videos[0]; LoadComentarios(); if (VideoSelecionado.Extensao.ToUpper() == ".SWF") pnlVideoFlash.Html = String.Format("<object width=\"100%\" height=\"100%\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\"><param name=\"SRC\" value=\"GaleriaVideos/{0}\"><embed src=\"GaleriaVideos/{0}\" width=\"100%\" height=\"100%\"></embed></object>", VideoSelecionado.Id.ToString() + VideoSelecionado.Extensao); else if (VideoSelecionado.Extensao.ToUpper() == ".WMV") pnlVideoFlash.Html = String.Format("<object width=\"100%\" height=\"100%\" type=\"video/x-ms-asf\" url=\"GaleriaVideos/{0}\" data=\"GaleriaVideos/{0}\" classid=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\"><param name=\"url\" value=\"GaleriaVideos/{0}\"><param name=\"filename\" value=\"GaleriaVideos/{0}\"><param name=\"autostart\" value=\"1\"><param name=\"uiMode\" value=\"full\" /><param name=\"autosize\" value=\"1\"><param name=\"playcount\" value=\"1\"><embed type=\"application/x-mplayer2\" src=\"GaleriaVideos/{0}\" width=\"100%\" height=\"100%\" autostart=\"true\" showcontrols=\"true\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\"></embed></object>", VideoSelecionado.Id.ToString() + VideoSelecionado.Extensao); else pnlVideoFlash.Html = String.Format("<video width=\"100%\" height=\"100%\" controls=\"controls\"> <source src=\"GaleriaVideos/{0}\" type=\"video/{1}\" autoplay=\"autoplay\"/></video>", VideoSelecionado.Id.ToString() + VideoSelecionado.Extensao, VideoSelecionado.Extensao.Replace(".", String.Empty)); pnlVideoFlash.Hidden = false; grdComentariosVideos.Hidden = false; } else { pnlVideoFlash.Hidden = true; grdComentariosVideos.Hidden = true; } winVideos.Show((Control)sender); }
private void VisualizarFotos(object sender, DirectEventArgs e) { GaleriaSelecionada = new GaleriaBO().SelectById(e.ExtraParams["id"].ToInt32()); VideoSelecionado = null; strFotos.DataSource = GaleriaSelecionada.Fotos.Where(x => x.Removido == false).ToList(); strFotos.DataBind(); winFotos.Show((Control)sender); if (GaleriaSelecionada.Fotos.Count > 0) { dtImagens.SelectedRows.Add(new SelectedRow(0)); dtImagens.UpdateSelection(); dtImagens_SelectionChange(dtImagens, null); } else { pnlFotos.Hidden = true; grdComentariosFotos.Hidden = true; } }
public void RemoverGaleria(String id) { try { GaleriaVO galeria = new GaleriaBO().SelectById(id.ToInt32()); new GaleriaBO(galeria).DeleteUpdate(); LoadPagina(); } catch (Exception ex) { base.MostrarMensagem("Erro", "Erro ao tentar remover galeria.", ""); } }
private void PreencherCampos(String id) { GaleriaSelecionado = new GaleriaBO().SelectById(id.ToInt32()); txtNome.Text = GaleriaSelecionado.Nome; txtDescricao.Text = GaleriaSelecionado.Descricao; }