Пример #1
0
        protected void Reload()
        {
            TextGrupo.MaxLength      = 20;
            TextFornecedor.MaxLength = 20;
            TextCNPJ.MaxLength       = 20;
            TextCEP.MaxLength        = 50;
            TextRua.MaxLength        = 100;
            TextRazao.MaxLength      = 100;
            _ler = new LerSelect();
            var Dt = _ler.LerFornecedor();

            if (Dt != null)
            {
                GridFornecedor.DataSource = Dt.ValDataTable;
                GridFornecedor.DataBind();
            }
            _ler = new LerSelect();
            var DtEstado = _ler.LerDropEstado();

            if (DtEstado != null && DropEstado.Text == "")
            {
                DropEstado.DataTextField = "Estados";
                DropEstado.DataSource    = DtEstado.ValDataTable;
                DropEstado.DataBind();
                DropEstado.AppendDataBoundItems = true;
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dt = new Functions().CarregaTabelas("SELECT * FROM Fornecedor");

            GridFornecedor.DataSource = dt;
            GridFornecedor.DataBind();

            DataTable dt1 = new Functions().CarregaTabelas("SELECT * FROM Empresa");

            GridEmpresas.DataSource = dt1;
            GridEmpresas.DataBind();
        }
Пример #3
0
        public void AtualizaFiltro()
        {
            GridFornecedor.AutoGenerateColumns = false;
            GridFornecedor.DataSource          = new SortableBindingList <Domain.Entity.Fornecedor>(_context
                                                                                                    .Fornecedores

                                                                                                    .Where(f => f.EmpresaId == (long)EditEmpresa.SelectedValue)
                                                                                                    .ToList());
            if (GridFornecedor.Rows.Count > 0)
            {
                GridFornecedor.Rows[0].Selected = true;
            }
            LbPesquisa.Text = GridFornecedor.Ordena(1);
        }
Пример #4
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (txtFiltroFornecedor.Text != "")
     {
         DataTable dtatualizado = new Functions().CarregaTabelas("SELECT * FROM FORNECEDOR WHERE " + drpFiltros.SelectedItem.Value + "='" + txtFiltroFornecedor.Text + "'");
         GridFornecedor.DataSource = dtatualizado;
         GridFornecedor.DataBind();
     }
     else
     {
         DataTable dtatualizado = new Functions().CarregaTabelas("SELECT * FROM FORNECEDOR");
         GridFornecedor.DataSource = dtatualizado;
         GridFornecedor.DataBind();
     }
 }
Пример #5
0
 private void EditPesquisa_TextChanged(object sender, EventArgs e)
 {
     GridFornecedor.Pesquisa(EditPesquisa.Text, (CurrencyManager)BindingContext[GridFornecedor.DataSource]);
 }
Пример #6
0
 private void GridFornecedor_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     LbPesquisa.Text = GridFornecedor.Ordena(e.ColumnIndex);
     GridFornecedor.Pesquisa(EditPesquisa.Text, (CurrencyManager)BindingContext[GridFornecedor.DataSource]);
 }
Пример #7
0
 private void Exibir()
 {
     GridFornecedor.DataSource = fornecedorBLL.BuscarTodos();
     GridFornecedor.DataBind();
 }