protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CadEstado oCadEstado = new CadEstado();
                lista = oCadEstado.consultarTodos();

                cboEstado.DataTextField  = "sigla";
                cboEstado.DataValueField = "id";
                cboEstado.DataSource     = lista;
                cboEstado.DataMember     = "Tabela";
                cboEstado.DataBind();
                cboEstado.Items.Insert(0, "Selecione");
                cboEstado.SelectedIndex = 0;

                CadCidade oCadCidade = new CadCidade();
                lista = oCadCidade.consultarTodos();

                if (lista != null)
                {
                    gdvCadCidade.DataSource = lista;
                    gdvCadCidade.DataMember = "Tabela";
                    gdvCadCidade.DataBind();
                }
            }
        }
示例#2
0
        protected void btnApagar_Click(object sender, EventArgs e)
        {
            CadEstado objCadEstado = new CadEstado();

            objCadEstado.apagar(txtidCadEstado.Text, txtEstado.Text, txtSigla.Text);
            Response.Redirect(Request.RawUrl);
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CadEstado oCadEstado = new CadEstado();
                lista = oCadEstado.consultarTodos();

                if (lista != null)
                {
                    gdvCadEstado.DataSource = lista;
                    gdvCadEstado.DataMember = "Tabela";
                    gdvCadEstado.DataBind();
                }
            }
        }
示例#4
0
        private void carregarTabelaDataSet()
        {
            CadEstado objListarTodosEstados = new CadEstado();
            DataSet   dtListarTodosFilmes   = objListarTodosEstados.consultarTodos();

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

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