Controller.Repositorio.ClienteRepositorio.ListarParaVender C# (CSharp) Method

ListarParaVender() public method

public ListarParaVender ( System.Windows.Forms.DataGridView dgv ) : void
dgv System.Windows.Forms.DataGridView
return void
        public void ListarParaVender(DataGridView dgv)
        {
            try
            {
                dgv.DataSource = (from cli in _banco.Cliente select new { ID = cli.ID, Nome = cli.Nome, CPF = cli.CPF, Celular = cli.Celular }).ToList();
                dgv.AjustartamanhoDoDataGridView(new List<TamanhoGrid>()
                {
                   
                     new TamanhoGrid(){ ColunaNome = "Nome", Tamanho = 228},
                     new TamanhoGrid(){ ColunaNome = "CPF", Tamanho = 150},
                     new TamanhoGrid(){ ColunaNome = "Celular", Tamanho = 150}
                });
                dgv.EsconderColuna("ID");
            }
            catch (CustomException erro)
            {
                throw new CustomException(erro.Message);
            }
            catch (Exception erro)
            {
                throw new Exception(erro.Message);
            }

        }