private void LsbSprints_SelectedIndexChanged(object sender, EventArgs e) { selectedSprint = sprintsSmList.Find(sprint => sprint.Range.Name == lsbSprints.SelectedItem.ToString()); txbAcceptedPointsTeam1.Text = selectedSprint.AcceptedPointsTeam1.ToString(); txbAcceptedPointsTeam2.Text = selectedSprint.AcceptedPointsTeam2.ToString(); txbTeamSize1.Text = selectedSprint.DevTeamSize1.ToString(); txbTeamSize2.Text = selectedSprint.DevTeamSize2.ToString(); txbObs.Text = selectedSprint.Obs; }
private void BtnAddSprint_Click(object sender, EventArgs e) { try { IntervaloDTO range = new IntervaloDTO { Name = cbbSprintRanges.SelectedItem.ToString(), IniDate = dtpIniDate.Value, EndDate = dtpEndDate.Value }; switch (fluxo) { case UtilDTO.NAVIGATION.DEVOPS: SprintDevOpsDTO newSprint = new SprintDevOpsDTO() { Range = range, ImagePath = sprintImagePath }; //Remove e adiciona para caso ele esteja atualizando os dados sprintsDevOpsList.Remove(sprintsDevOpsList.Find(s => s.Range.Name == newSprint.Range.Name)); sprintsDevOpsList.Add(newSprint); sprintsDevOpsList.Sort((x, y) => x.Range.Name.CompareTo(y.Range.Name)); break; case UtilDTO.NAVIGATION.VARIOS_RELATORIOS: SprintDevDTO newDevSprint = new SprintDevDTO() { Range = range, ImagePath = sprintImagePath }; //Remove e adiciona para caso ele esteja atualizando os dados sprintsDevList.Remove(sprintsDevList.Find(s => s.Range.Name == newDevSprint.Range.Name)); sprintsDevList.Add(newDevSprint); sprintsDevList.Sort((x, y) => x.Range.Name.CompareTo(y.Range.Name)); SprintSmDTO newSmSprint = new SprintSmDTO() { Range = range, ImagePath = sprintImagePath }; //Remove e adiciona para caso ele esteja atualizando os dados sprintsSmList.Remove(sprintsSmList.Find(s => s.Range.Name == newSmSprint.Range.Name)); sprintsSmList.Add(newSmSprint); sprintsSmList.Sort((x, y) => x.Range.Name.CompareTo(y.Range.Name)); break; case UtilDTO.NAVIGATION.DEV: SprintDevDTO newAdaptaionSprint = new SprintDevDTO() { Range = range, ImagePath = sprintImagePath }; //Remove e adiciona para caso ele esteja atualizando os dados sprintsDevList.Remove(sprintsDevList.Find(s => s.Range.Name == newAdaptaionSprint.Range.Name)); sprintsDevList.Add(newAdaptaionSprint); sprintsDevList.Sort((x, y) => x.Range.Name.CompareTo(y.Range.Name)); break; case UtilDTO.NAVIGATION.SM: SprintSmDTO newSmSprintToAdd = new SprintSmDTO() { Range = range, ImagePath = sprintImagePath }; //Remove e adiciona para caso ele esteja atualizando os dados sprintsSmList.Remove(sprintsSmList.Find(s => s.Range.Name == newSmSprintToAdd.Range.Name)); sprintsSmList.Add(newSmSprintToAdd); sprintsSmList.Sort((x, y) => x.Range.Name.CompareTo(y.Range.Name)); break; default: throw new NotImplementedException(); } pbxSprintImage.Image = null; //atualizar a lista de sprints lsbSprints.Items.Remove(range.Name); lsbSprints.Items.Add(range.Name); sprintImagePath = null; btnNextForm.Enabled = true; if (cbbSprintRanges.SelectedIndex < cbbSprintRanges.Items.Count - 1) { cbbSprintRanges.SelectedIndex += 1; } ShowLog("Sprint adicionada com sucesso."); } catch (Exception ex) { txbResult.Text = $"Erro. {ex.Message}"; } }