private void radioButton2_CheckedChanged(object sender, EventArgs e) { TaskManagementRepository repositorio = new TaskManagementRepository(); var listaTarefasEmExecucacao = repositorio.ObterTarefas(true); this.dataGridView1.DataSource = listaTarefasEmExecucacao.Select(c => new { c.Id, c.CodigoJira, c.StartTime, c.EndTime }).ToList(); }
private void button3_Click(object sender, EventArgs e) { int id = (int)this.comboBox1.SelectedValue; if (id > 0) { TaskManagementRepository repositorio = new TaskManagementRepository(); IssueExecution tarefaEmAndamento = repositorio.ObterTarefaEmAndamento(id); if (tarefaEmAndamento != null) { MessageBox.Show("Esta tarefa já está em andamento"); return; } repositorio.IniciarAtendimentoTarefa(id); var listaTarefasEmExecucacao = repositorio.ObterTarefas(true); this.dataGridView1.DataSource = listaTarefasEmExecucacao.Select(c => new { c.Id, c.CodigoJira, c.StartTime, c.EndTime }).ToList(); } }
private void button2_Click(object sender, EventArgs e) { if (this.dataGridView1.SelectedRows.Count == 0) { MessageBox.Show("Selecione uma ou mais linhas para encerrar o atendimento."); return; } TaskManagementRepository repositorio = new TaskManagementRepository(); foreach (DataGridViewRow row in this.dataGridView1.SelectedRows) { int idTarefa = Convert.ToInt32(row.Cells[0].Value.ToString()); repositorio.EncerrarAtendimentoTarefa(idTarefa); } var listaTarefasEmExecucacao = repositorio.ObterTarefas(true); this.dataGridView1.DataSource = listaTarefasEmExecucacao; }