Пример #1
0
        private void btnAdicionar_Click(object sender, EventArgs e)
        {
            frmIncluirAlterarTarefa form = new frmIncluirAlterarTarefa();

            form.ShowDialog();
            CarregarGrid();
        }
Пример #2
0
        private void btnAlterar_Click(object sender, EventArgs e)
        {
            bool statusB = true;

            if (dgvAgenda.CurrentRow.Cells[4].Value.Equals("Pendente"))
            {
                statusB = false;
            }

            Tarefa tarefa = new Tarefa
            {
                id        = (int)dgvAgenda.CurrentRow.Cells[0].Value,
                titulo    = dgvAgenda.CurrentRow.Cells[1].Value.ToString(),
                descricao = dgvAgenda.CurrentRow.Cells[2].Value.ToString(),
                tempo     = (int)dgvAgenda.CurrentRow.Cells[3].Value,
                status    = statusB
            };

            frmIncluirAlterarTarefa form = new frmIncluirAlterarTarefa(tarefa);

            form.ShowDialog();
            CarregarGrid();
        }