コード例 #1
0
        protected void Button3_Click(object sender, EventArgs e)
        {
            CadNoticia objCadNoticia = new CadNoticia();

            objCadNoticia.apagar(txtidNoticia.Text, txtNoticia.Text, txtData.Text, cboTipoNoticia.SelectedValue);
            Response.Redirect(Request.RawUrl);
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CadNoticia oCadNoticia = new CadNoticia();
                lista = oCadNoticia.consultarTodos();

                if (lista != null)
                {
                    gdvCadNoticia.DataSource = lista;
                    gdvCadNoticia.DataMember = "Tabela";
                    gdvCadNoticia.DataBind();
                }
            }
        }
コード例 #3
0
        private void carregarTabelaDataSet()
        {
            CadNoticia objListarTodosFilmes = new CadNoticia();
            DataSet    dtListarTodosFilmes  = objListarTodosFilmes.consultarNoticiasCinema();

            for (int linha = 0; linha <= dtListarTodosFilmes.Tables["Tabela"].Rows.Count - 1; linha++)
            {
                TableRow tRow = new TableRow();
                tabelaNoticiasCinema.Rows.Add(tRow);

                for (int coluna = 0; coluna <= 3; coluna++)
                {
                    TableCell tCell = new TableCell();
                    tCell.Text = Convert.ToString(dtListarTodosFilmes.Tables["Tabela"].Rows[linha][coluna]);
                    tRow.Cells.Add(tCell);
                }
            }
        }