Пример #1
0
        private void predecessorItem_Click(object sender, EventArgs e)
        {
            if (_selectedTask == null)
            {
                return;
            }
            ToolStripMenuItem item = sender as ToolStripMenuItem;

            if (item == null)
            {
                return;
            }

            item.Checked = !item.Checked;   // toggle

            Story story;

            if (!_data.Stories.TryGetValue(_selectedTask.ID, out story))
            {
                return;
            }
            SagaFeature saga;

            if (!_data.Sagas.TryGetValue(story.SagaFeatureUUID, out saga))
            {
                return;
            }

            List <string> list = new List <string>();

            foreach (ToolStripMenuItem entry in setPredecessorToolStripMenuItem.DropDownItems)
            {
                if (entry.Checked)
                {
                    list.Add(entry.Text);
                }
            }

            try
            {
                Cursor.Current = Cursors.WaitCursor;
                Story updated = Rally.UpdateStoryPredecessors(_selectedTask.ID, list);
                if (updated != null)
                {
                    story.SetObject(updated.Object);
                    Rally.QueryPredecessors(story);
                    _graph.SetPredecessors(saga);
                }
                else
                {
                    MessageBox.Show("Failed to update Rally");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Пример #2
0
        private void PlotProject()
        {
            string projectOID;

            if (!_projectOIDs.TryGetValue(comboBoxProject.Text, out projectOID))
            {
                return;
            }
            string projectName = Rally.QueryProjectName(projectOID);

            if (string.IsNullOrEmpty(projectName))
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;

            _data             = new RallyData();
            _data.ProjectName = projectName;
            List <Story>  orphans;
            List <string> sfUUIDs = Rally.QuerySagaFeatureUUIDsFromStories(projectOID, textBoxRelease.Text, out orphans);

            progressBar.Value = 20;
            _data.Sagas       = Rally.QuerySagaFeatures(Rally.GenerateQuery(sfUUIDs, "ObjectUUID"), string.Empty);
            progressBar.Value = 40;
            _data.Stories     = Rally.QueryStories(sfUUIDs, Query.Operator.Equals, "SagaFeature.ObjectUUID", string.Empty);
            Rally.QueryPredecessors(_data.Stories.Values);
            progressBar.Value = 80;

            _data.Iterations = Rally.QueryIterations(_data.Stories.Values);

            // this will populate tasks
            List <string> storyIDs = Story.GetObjectIDs(Story.GetLeafs(_data.Stories.Values, projectName));

            _data.Tasks = Rally.QueryTasks(storyIDs, Query.Operator.Equals, "WorkProduct.ObjectUUID", string.Empty);

            progressBar.Value = 90;

            _data.ReleaseDate = Rally.QueryReleaseDate(projectOID, textBoxRelease.Text);

            if (orphans.Count > 0)
            {
                SagaFeature sf = new SagaFeature {
                    ObjectUUID = "0", FormattedID = "0", Name = "Orphaned Stories"
                };
                sf.Stories.AddRange(orphans);
                _data.Sagas.Add("0", sf);
            }

            _data.Initialize(dateTimePicker1.Value);

            Form1 form = new Form1();

            form.Text = comboBoxProject.Text;
            form.Initialize(_data, dateTimePicker1.Value);
            form.Draw(new Filter());
            form.Show();

            progressBar.Value = 0;
            Cursor.Current    = Cursors.Default;
        }