Exemplo n.º 1
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            FrmCadatroTarefas frm = new FrmCadatroTarefas();

            if (grid.CurrentRow.Cells[0].Value != null)
            {
                if (grid.SelectedRows.ToString() != "")
                {
                    foreach (Tarefa t in listaTarefas)
                    {
                        if (t.id.ToString() == grid.CurrentRow.Cells[0].Value.ToString())
                        {
                            frm.edita(t.id, t.descricao, t.titulo);
                            frm.ShowDialog();
                            break;
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Selecione um registro!");
                }
            }
            else
            {
                MessageBox.Show("Selecione um registro!");
            }

            atualizaGrid();
        }
Exemplo n.º 2
0
        private void btnCadastrar_Click(object sender, EventArgs e)
        {
            FrmCadatroTarefas t = new FrmCadatroTarefas();

            t.ShowDialog();
            atualizaGrid();
        }