コード例 #1
0
ファイル: frmMain.cs プロジェクト: ezequielsd/RegistroTarefas
        /// <summary>
        /// Evento click celular do datagrid tarefas concluidas
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dataGridViewConcluidos_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            //limpa campos
            txtEdicaoLink.Clear();

            int id = Convert.ToInt32(dataGridViewConcluidos.Rows[dataGridViewConcluidos.CurrentRow.Index].Cells[0].Value);

            tarefa = tarefaBLL.BuscarTarefa(id);

            txtTitulotarefa.Text            = tarefa.Titulo;
            link.Text                       = tarefa.Link;
            lblLista.Text                   = tarefa.TipoTarefa;
            tabSplitterContainer1.Collapsed = false;

            //Busca e monta as notas da tarefa
            List <NotaTarefa> notas = notaTarefaBLL.ListaNotasTarefa(tarefa.Id);

            if (flowLayoutPanel1.Controls.Count > 0)
            {
                foreach (Control item in flowLayoutPanel1.Controls)
                {
                    flowLayoutPanel1.Controls.Remove(item);
                }
            }

            flowLayoutPanel1.Refresh();

            foreach (NotaTarefa notaItem in notas)
            {
                ucNotaTarefa nota = new ucNotaTarefa(notaItem);
                flowLayoutPanel1.Controls.Add(nota);
            }
        }
コード例 #2
0
ファイル: frmMain.cs プロジェクト: ezequielsd/RegistroTarefas
        private void AdicionaNotaTarefa(NotaTarefa pNota)
        {
            ucNotaTarefa nota = new ucNotaTarefa(pNota);

            flowLayoutPanel1.Controls.Add(nota);

            flowLayoutPanel1.Refresh();
        }