Ejemplo n.º 1
0
        private void CadastroClubesForm_Load(object sender, EventArgs e)
        {
            using (var bo = new FormacaoTaticaBO())
            {
                cbxFormacoes.DataSource = bo.List();
                var formacao = bo.List();

                if (_clube != null)
                {
                    txtId.Text    = _clube.Id.ToString();
                    txtNome.Text  = _clube.Nome;
                    txtSigla.Text = _clube.Sigla;
                    cbxFormacoes.SelectedIndex = formacao.IndexOf(formacao.FirstOrDefault(x => x.Id == _clube.FormacaoTatica_Id));
                    txtImagemId.Text           = _clube.Escudo_Id.ToString();

                    pcbEscudo.Image = ImagemBO.ByteToImage(_clube.Escudo?.bytes);

                    menuRemover.Visible = true;

                    AtualizarGrid();
                }
                else
                {
                    menuRemover.Visible = false;
                }
            }
        }
Ejemplo n.º 2
0
        public void AtualizarGrid()
        {
            using (var bo = new FormacaoTaticaBO())
            {
                dgvFomacoes.AutoGenerateColumns = false;

                bsFormacoes.DataSource = bo.List();
            }
        }
Ejemplo n.º 3
0
 public SelectList PreencherFormacoesTaticas()
 {
     using (var bo = new FormacaoTaticaBO())
     {
         var formacoes = bo.List();
         return(formacoes.Select(x => new SelectListItem {
             Text = x.Descricao, Value = x.Id.ToString()
         }).ToSelectList());
     }
 }