private void Pesquisar() { CFOPVO identCFOP = new CFOPVO(); if (!string.IsNullOrEmpty(hdfCodCFOP.Value) || !string.IsNullOrEmpty(txtDescPesq .Text)|| !string.IsNullOrEmpty(txtCodigoPesq.Text)) { if (!string.IsNullOrEmpty(hdfCodCFOP.Value)) identCFOP.CodCFOP = Convert.ToInt32(hdfCodCFOP.Value); if (!string.IsNullOrEmpty(txtDescPesq.Text)) identCFOP.NaturezaOperacao = txtDescPesq.Text; if (!string.IsNullOrEmpty(txtCodigoPesq.Text)) identCFOP.CFOP = txtCodigoPesq.Text; } else MensagemCliente("Favor informar pelo um filtro para pesquisa"); List<CFOPVO> lCFOP = new CFOP().Listar(identCFOP); if (lCFOP.Count > 0) { grdListaResultado.DataSource = lCFOP; grdListaResultado.DataBind(); } else { MensagemCliente("Não Existem CFOPs Cadastradas"); } }
protected void btnCarregarValoresCFOP_Click(object sender, EventArgs e) { CFOPVO identCFOP = new CFOPVO(); identCFOP.CFOP = txtCFOP.Text; List<CFOPVO> lstCFOP = new CFOP().Listar(identCFOP); if(lstCFOP.Count > 0) DadosCFOP = lstCFOP[0]; }