protected void CarregaNoticia(int id_Noticia) { Noticia noticia = new Noticia(); noticia = NoticiaOad.Get_Noticia(id_Noticia); lblManchete.Text = noticia.Ds_Manchete; lblChamada.Text = noticia.Ds_Chamada; lblconteudo.Text = noticia.Ds_Conteudo; }
protected void RetornaDadosNoticia(int id_noticia) { Noticia noticia = new Noticia(); noticia = NoticiaOad.Get_Noticia(id_noticia); txtnm_Manchete.Text = noticia.Ds_Manchete; txtnm_Chamada.Text = noticia.Ds_Chamada; Editor1.Content = noticia.Ds_Conteudo; }
protected void btnSalvar_Click(object sender, EventArgs e) { Noticia noticia = new Noticia(); noticia.Ds_Manchete = txtnm_Manchete.Text; noticia.Ds_Chamada = txtnm_Chamada.Text; noticia.Ds_Conteudo = Editor1.Content; noticia.Dt_Criacao = DateTime.Now; NoticiaOad.OperacaoNoticia(noticia, "I"); Response.Redirect("~/Administrador/ListarNoticias.aspx"); }
protected void Page_Load(object sender, EventArgs e) { int id_Noticia = Convert.ToInt16(Request["cod"]); Modelo.Noticia noticia = new Modelo.Noticia(); noticia = NoticiaOad.Get_Noticia(id_Noticia); lblManchete.Text = noticia.Ds_Manchete; lblData.Text = noticia.Dt_Criacao.ToString("dd/MM/yyyy"); lblConteudo.Text = noticia.Ds_Conteudo; }
protected void btnExcluir_Click(object sender, EventArgs e) { int id_noticia = Convert.ToInt16(Request["Noticia"]); Noticia noticia = new Noticia(); noticia = NoticiaOad.Get_Noticia(id_noticia); NoticiaOad.OperacaoNoticia(noticia, "E"); btnCancelar.Visible = false; btnExcluir.Visible = false; lblConfirmacao.Visible = false; lblSucesso.Visible = true; btnVoltar.Visible = true; }
protected void listaNoticia() { List <Noticia> list = new List <Noticia>(); list = NoticiaOad.GetAll_Noticias(); if (list.Count == 0) { lblMensagem.Visible = true; } else { lblMensagem.Visible = false; gvwDados.DataSource = list; gvwDados.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { List <Modelo.Noticia> list = new List <Modelo.Noticia>(); list = NoticiaOad.GetAll_Noticias(); if (list.Count == 0) { lblMensagem.Visible = true; } else { lblMensagem.Visible = false; gvwNoticias.DataSource = list; gvwNoticias.DataBind(); } }
protected void gvwDados_PageIndexChanging(object sender, GridViewPageEventArgs e) { gvwDados.PageIndex = e.NewPageIndex; gvwDados.DataSource = NoticiaOad.GetAll_Noticias(); gvwDados.DataBind(); }