Пример #1
0
        private void saveStoryFlowToExcelToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (StaticUtil.CurrentFuzzFile == null)
            {
                MessageBox.Show("You must dump data first");
                return;
            }

            Cursor = Cursors.WaitCursor;
            var ds = VSCommon.LoadDumpDataset(TFSRegistry.GetTFSMdbPath());

            var saveFileDialog1 = new SaveFileDialog();

            saveFileDialog1.Filter = "xls files (*.xlsx)|*.xlsx|All files (*.*)|*.*";
            saveFileDialog1.Title  = "To Excel";

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                var fileName = saveFileDialog1.FileName;
                UserStoryCumulativeFlow.BuildStoryFlowDump(ds, fileName);
                Cursor = Cursors.Default;

                Process.Start(fileName);
            }
        }
Пример #2
0
        private bool DumpTFS()
        {
            if (VSCommon.IsFileLocked(TFSRegistry.GetTFSMdbPath()))
            {
                MessageBox.Show("Cannot update data from TFS because the TFS.accdb file is open on your machine.  Please close it, then try again.");
                return(false);
            }

            string path = TFSRegistry.GetTFSMdbPath();

            button1.Enabled = false;
            Cursor          = Cursors.WaitCursor;
            Application.DoEvents();

            var wait = new InfoFrm("Extracting data from TFS, please wait ...", false);

            wait.Show(this);
            Application.DoEvents();

            DumpWorkItemsToDS dump = new DumpWorkItemsToDS(connect, SelectedAreaId, wait, "Marketing Temp", TFSRegistry.LastDayOfWeek, txtIterationPath.Text.Trim(), chkIterationPath_Under.Checked, chkIterationPath_Equals.Checked);

            dump.DumpWorkItems(path);

            wait.Close();

            button1.Enabled = true;
            Cursor          = Cursors.Default;
            Application.DoEvents();

            return(true);
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!FuzzFileValid)
            {
                return;
            }
            if (!initialized)
            {
                init();
                initialized = true;
            }

            TFSRegistry.SetDefaultIterationPath(txtIterationPath.Text.Trim());

            if (chkIterationPath_Under.Checked || chkIterationPath_Equals.Checked)
            {
                if (string.IsNullOrWhiteSpace(txtIterationPath.Text))
                {
                    MessageBox.Show(
                        "You must enter a valid iteration path if either of the Iteration Path checkboxes are checked.");
                    return;
                }
            }

            string message = string.Format("This application will automatically update the 'TFS dump' file if it is more than 4 hours old?{0}{0}Would you like to update the file anyway?", Environment.NewLine);

            if (MessageBox.Show(message, "TFS", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
            {
                if (VSCommon.IsFileLocked(TFSRegistry.GetTFSMdbPath()))
                {
                    MessageBox.Show("Cannot update data from TFS because the TFS.mdb file is open on your machine.  Please close it, then try again.");
                    return;
                }

                string path = TFSRegistry.GetTFSMdbPath();
                Cursor = Cursors.WaitCursor;

                button1.Enabled = false;
                Application.DoEvents();


                var wait = new InfoFrm("Extracting data, please wait ...", false);
                wait.Show(this);
                Application.DoEvents();

                DumpWorkItemsToDS dump = new DumpWorkItemsToDS(connect, SelectedAreaId, wait, SelectedProject.Name, TFSRegistry.LastDayOfWeek, txtIterationPath.Text.Trim(), chkIterationPath_Under.Checked, chkIterationPath_Equals.Checked);
                dump.DumpWorkItems(path);

                wait.Close();

                button1.Enabled = true;
                Cursor          = Cursors.Default;
                Application.DoEvents();
            }
        }
Пример #4
0
        public frmDynamicChart(string mdbFilePath, Connect conn, int areaId, string projectName) : this()
        {
            this.filePath = mdbFilePath;
            this.connect = conn;
            ds = VSCommon.LoadDumpDataset(filePath);

            lastDumpDate = ds.Config.Where(x => x.Key == "DumpDate").First().Val;

            dtStartDt.Value = new DateTime(2017,9,1);

            BuildCheckboxes();

        }
Пример #5
0
        private void dynamicChartToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!FuzzFileValid)
            {
                return;
            }

            if (!initialized)
            {
                init();
                initialized = true;
            }

            //get the last update date from the file
            if (File.Exists(TFSRegistry.GetTFSMdbPath()) && VSCommon.GetDumpFileAreaId(TFSRegistry.GetTFSMdbPath()) == SelectedAreaId)
            {
                DateTime?dumpDate = VSCommon.GetDumpDate(TFSRegistry.GetTFSMdbPath());
                if (DateTime.Now.Subtract(dumpDate.Value).TotalHours >= 4)
                {
                    if (MessageBox.Show("The data used by this application hasn't been updated since " + dumpDate.Value.ToString() + Environment.NewLine + "Would you like to update now?", "Update Ira Dump Data", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        if (DumpTFS() == false)
                        {
                            return;
                        }
                    }
                }
            }
            else
            {
                if (DumpTFS() == false)
                {
                    return;
                }
            }


            if (File.Exists(TFSRegistry.GetTFSMdbPath()))
            {
                if (VSCommon.IsFileLocked(TFSRegistry.GetTFSMdbPath()))
                {
                    MessageBox.Show("Cannot update data from TFS because the TFS.accdb file is open on your machine.  Please close it, then try again.");
                    return;
                }

                var f = new frmDynamicChart(TFSRegistry.GetTFSMdbPath(), connect, SelectedAreaId, cboTeam.Text);
                f.Show();
            }
        }
Пример #6
0
        public frmDevMetrics(string mdbFilePath, Connect conn, int areaId, string projectName) : this()
        {
            this.ProjectName = projectName;
            this.AreaID      = areaId;
            this.filePath    = mdbFilePath;
            this.connect     = conn;
            ds = VSCommon.LoadDumpDataset(filePath);

            lastDumpDate = ds.Config.Where(x => x.Key == "DumpDate").First().Val;

            chartDevelopment.Titles.Add(string.Format("{0} Stories (as of {1})", ProjectName, lastDumpDate));

            lstBoxCompletedWorkTFSStateList.DataSource = StaticUtil.CurrentFuzzFile.States.Select(x => x.Category).Distinct().ToList();

            GetFeatureOptions();

            RenderBugs();

            Render();

            SetStoryCumulativeFlowDefaultColors();
        }
Пример #7
0
        private void Render()
        {
            try
            {
                bool excludeCurrentWeek = chkExcludeCurrentWeek.Checked;



                chartDevelopment.ChartAreas[0].BackColor = Color.LightGray;

                string date       = DateTime.Today.AddMonths(-Convert.ToInt32(lastXMonths.Value)).ToShortDateString();
                string dateEnding = VSCommon.GetLastDayOfWeek(DateTime.Today, VSCommon.LastDayOfWeek).ToShortDateString();
                if (excludeCurrentWeek)
                {
                    dateEnding = VSCommon.GetLastDayOfWeek(DateTime.Today, VSCommon.LastDayOfWeek).AddDays(-7).ToShortDateString();
                }



                while (true)
                {
                    chartDevelopment.Series.Remove(chartDevelopment.Series.FirstOrDefault());
                    if (chartDevelopment.Series.Count == 0)
                    {
                        break;
                    }
                }

                string s = "";
                s = "WeekEnding>='" + date + "' AND WeekEnding<='" + dateEnding + "'";

                if (chkDevComplete.Checked)
                {
                    Series series = CreateSeries("count", SeriesChartType.Line, 2, Color.Blue, ChartDashStyle.Solid,
                                                 ChartValueType.DateTime, "Dev Complete");
                    chartDevelopment.Series.Add(series);
                    DataView devview = null;
                    if (!chkDevMetrics_IncludeBugs.Checked)
                    {
                        devview = new DataView(ds.VW_VELOCITY, s, "WeekEnding", DataViewRowState.CurrentRows);
                    }
                    else
                    {
                        devview = new DataView(ds.VW_VELOCITY_ALL, s, "WeekEnding", DataViewRowState.CurrentRows);
                    }
                    chartDevelopment.Series["count"].Points.DataBind(devview, "WeekEnding", "DevDone", "Tooltip=WeekEnding");

                    if (chkShowTrends.Checked)
                    {
                        Series trendline = new Series("CountTrendline");
                        trendline.ChartType       = SeriesChartType.Line;
                        trendline.BorderWidth     = 1;
                        trendline.BorderDashStyle = ChartDashStyle.Dash;
                        trendline.Color           = Color.Blue;
                        chartDevelopment.Series.Add(trendline);
                        string forecast = string.Format("Linear,{0},false,false", Convert.ToInt32(forecastWeeks.Value));
                        chartDevelopment.DataManipulator.FinancialFormula(FinancialFormula.Forecasting, forecast, chartDevelopment.Series["count"], chartDevelopment.Series["CountTrendline"]);
                        chartDevelopment.Series["CountTrendline"].LegendText = "Dev Complete Trend";
                    }
                }
                if (chkQAComplete.Checked)
                {
                    Series series = CreateSeries("qacount", SeriesChartType.Line, 2, Color.Red, ChartDashStyle.Solid,
                                                 ChartValueType.DateTime, "QA Complete");

                    chartDevelopment.Series.Add(series);
                    DataView qaview = null;
                    if (!chkDevMetrics_IncludeBugs.Checked)
                    {
                        qaview = new DataView(ds.VW_VELOCITY, s, "WeekEnding", DataViewRowState.CurrentRows);
                    }
                    else
                    {
                        qaview = new DataView(ds.VW_VELOCITY_ALL, s, "WeekEnding", DataViewRowState.CurrentRows);
                    }
                    chartDevelopment.Series["qacount"].Points.DataBind(qaview, "WeekEnding", "QADone", "Tooltip=WeekEnding");

                    if (chkShowTrends.Checked)
                    {
                        Series trendline = new Series("QACountTrendline");
                        trendline.ChartType       = SeriesChartType.Line;
                        trendline.BorderWidth     = 1;
                        trendline.BorderDashStyle = ChartDashStyle.Dash;
                        trendline.Color           = Color.Red;
                        chartDevelopment.Series.Add(trendline);
                        string forecast = string.Format("Linear,{0},false,false", Convert.ToInt32(forecastWeeks.Value));
                        chartDevelopment.DataManipulator.FinancialFormula(FinancialFormula.Forecasting, forecast, chartDevelopment.Series["qacount"], chartDevelopment.Series["QACountTrendline"]);
                        chartDevelopment.Series["QACountTrendline"].LegendText = "QA Complete Trend";
                    }
                }
//                if (chkUatComplete.Checked)
//                {
//                    string s = "";
//                    s = "(((WeekEnding)>='" + date + "') AND ((WeekEnding)<='" + dateEnding + "') AND ((WorkItemType)<>'Bug') AND ((State)='UAT'))";
//
//                    Series series = CreateSeries("uatcount", SeriesChartType.Line, 2, Color.Green, ChartDashStyle.Solid,
//                        ChartValueType.DateTime, "UAT Complete");
//
//                    chartDevelopment.Series.Add(series);
//                    DataView uatview = new DataView(ds.WorkItemMetrics, s, "WeekEnding", DataViewRowState.CurrentRows);
//                    chartDevelopment.Series["uatcount"].Points.DataBind(uatview, "WeekEnding", "StoryCount", "Tooltip=WeekEnding");
//
//
//                    if (chkShowTrends.Checked)
//                    {
//                        Series trendline = new Series("UATCountTrendline");
//                        trendline.ChartType = SeriesChartType.Line;
//                        trendline.BorderWidth = 1;
//                        trendline.BorderDashStyle = ChartDashStyle.Dash;
//                        trendline.Color = Color.Green;
//                        chartDevelopment.Series.Add(trendline);
//                        string forecast = string.Format("Linear,{0},false,false", Convert.ToInt32(forecastWeeks.Value));
//                        chartDevelopment.DataManipulator.FinancialFormula(FinancialFormula.Forecasting, forecast, chartDevelopment.Series["uatcount"], chartDevelopment.Series["UATCountTrendline"]);
//                        chartDevelopment.Series["UATCountTrendline"].LegendText = "UAT Complete Trend";
//
//                    }
//
//                }

                chartDevelopment.Update();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }