Exemple #1
0
        public MenuInicial()
        {
            InitializeComponent();

            List <ContingenciaInstrucional> CIs = ContingenciaInstrucionalService.GetAll();
            List <ContingenciaColateral>    CCs = ContingenciaColateralService.GetAll();
            List <Sessao> sessoes = SessaoService.GetAll();

            comboBoxSexo.Items.AddRange(ESexo.Values());
            comboBoxEscolaridade.Items.AddRange(EEscolaridade.Values());
            comboBoxCI.Items.AddRange(CIs.Cast <object>().ToArray());
            comboBoxCI.DisplayMember = "Nome";
            comboBoxCC.Items.AddRange(CCs.Cast <object>().ToArray());
            comboBoxCC.DisplayMember = "Nome";

            listViewCI.Items.AddRange(CIs.Select(it => {
                var item = new ListViewItem(it.Nome);
                item.SubItems.Add(it.Id.ToString());
                return(item);
            }).Cast <ListViewItem>().ToArray());

            listViewCC.Items.AddRange(CCs.Select(it => {
                var item = new ListViewItem(it.Nome);
                item.SubItems.Add(it.Id.ToString());
                return(item);
            }).Cast <ListViewItem>().ToArray());

            listViewSessoes.Items.AddRange(sessoes.Select(it => {
                var item = new ListViewItem(it.Nome);
                item.SubItems.Add(it.Id.ToString());
                return(item);
            }).Cast <ListViewItem>().ToArray());

            ViewUtils.CorrigeEscalaTodosOsFilhos(this);
            ViewUtils.CorrigeTamanhoPosicao(this);

            Image pactolo = new Bitmap(Properties.Resources.Pactolo);

            picturePactolo.Image = ImageUtils.Resize(pactolo, picturePactolo.Width, picturePactolo.Height);
        }