Пример #1
0
        private void Dash_Prj_Item_Gist(BarChart barChart, string sItem)
        {
            prop_col["Dashboard_GraphView"] = sItem;

            //gist.Width		= 250;
            //gist.Height		= 60;
            barChart.Sort = false;
            barChart.BorderWidth = 0;

            DataTable dt = new DataTable();

            switch (sItem)
            {
                case "Dash_Prj_Stat":
                    dt = Project.GetProjectStatisticByStatusDataTable();
                    break;
                case "Dash_Prj_Prior":
                    dt = Project.GetProjectStatisticByPriorityDataTable();
                    break;
                case "Dash_Prj_Typ":
                    dt = Project.GetProjectStatisticByTypeDataTable();
                    break;
                case "Dash_Prj_Man":
                    dt = Project.GetProjectStatisticByManagerDataTable();
                    break;
                case "Dash_Prj_GenCat":
                    dt = Project.GetProjectStatisticByGeneralCategoryDataTable();
                    break;
                case "Dash_Prj_PrjCat":
                    dt = Project.GetProjectStatisticByProjectCategoryDataTable();
                    break;
                case "Dash_Prj_PrjGrp":
                    dt = Project.GetProjectStatisticByProjectGroupDataTable();
                    break;
                case "Dash_Prj_Phas":
                    dt = Project.GetProjectStatisticByPhaseDataTable();
                    break;
                case "Dash_Prj_Clnt":
                    dt = Project.GetProjectStatisticByClientDataTable();
                    break;
            }

            string[] titles = new string[dt.Rows.Count];
            double[] values = new double[dt.Rows.Count];
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                titles[i] = dt.Rows[i]["ItemName"].ToString();
                values[i] = Convert.ToDouble(dt.Rows[i]["Count"]);
            }

            barChart.CollectDataPoints(titles, values);
        }
Пример #2
0
        private void Dash_Iss_Item_Gist(BarChart barChart, string sItem)
        {
            prop_col["Dashboard_GraphView"] = sItem;

            LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.Incidents.Resources.strIncidents", typeof(ChartImage).Assembly);

            barChart.Sort = false;
            barChart.BorderWidth = 0;

            DataTable dt = new DataTable();
            bool _IsPrj = false;
            switch (sItem)
            {
                case "Dash_Iss_Stat":
                    dt = Incident.GetListIncidentStatisticByStatusDataTable();
                    DataRow[] _dr = dt.Select("ItemId=" + ((int)ObjectStates.ReOpen).ToString());
                    if (_dr.Length > 0)
                    {
                        int iCount = (int)_dr[0]["Count"];
                        dt.Rows.Remove(_dr[0]);
                        _dr = dt.Select("ItemId=" + ((int)ObjectStates.Active).ToString());
                        if (_dr.Length > 0)
                        {
                            _dr[0]["Count"] = (int)_dr[0]["Count"] + iCount;
                        }
                    }
                    break;
                case "Dash_Iss_Prior":
                    dt = Incident.GetListIncidentStatisticByPriorityDataTable();
                    break;
                case "Dash_Iss_Typ":
                    dt = Incident.GetListIncidentStatisticByTypeDataTable();
                    break;
                case "Dash_Iss_Prj":
                    dt = Incident.GetListIncidentStatisticByProjectDataTable();
                    _IsPrj = true;
                    break;
                case "Dash_Iss_Man": //IssueBox
                    dt = Incident.GetListIncidentStatisticByIncidentBoxDataTable();
                    break;
                case "Dash_Iss_Sev":
                    dt = Incident.GetListIncidentStatisticBySeverityDataTable();
                    break;
                case "Dash_Iss_GenCat":
                    dt = Incident.GetListIncidentStatisticByGeneralCategoryDataTable();
                    break;
                case "Dash_Iss_IssCat":
                    dt = Incident.GetListIncidentStatisticByIncidentCategoryDataTable();
                    break;
            }

            string[] titles = new string[dt.Rows.Count];
            double[] values = new double[dt.Rows.Count];
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (_IsPrj && dt.Rows[i]["ItemName"] == DBNull.Value)
                    titles[i] = LocRM.GetString("tNoProject");
                else
                    titles[i] = dt.Rows[i]["ItemName"].ToString();
                values[i] = Convert.ToDouble(dt.Rows[i]["Count"]);
            }

            barChart.CollectDataPoints(titles, values);
        }
Пример #3
0
        private void OverPrjSnap_TaskToDo(BarChart barChart)
        {
            LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.Reports.Resources.strProjectSnapshot", typeof(ChartImage).Assembly);

            barChart.Title = LocRM.GetString("oTaskGraphTitle");
            barChart.Width = 320;
            barChart.Height = 100;
            barChart.Sort = false;

            int itotal = 0;
            int icompleted = 0;
            int iactive = 0;
            int ipastdue = 0;

            int ProjId = int.Parse(Request["ProjectId"].ToString());
            using (IDataReader rdr = Report.GetToDoAndTaskTrackingReport(ProjId))
            {
                if (rdr.Read())
                {
                    itotal = (int)rdr["Total"];
                    icompleted = (int)rdr["Completed"];
                    iactive = (int)rdr["Active"];
                    ipastdue = (int)rdr["PastDue"];
                }
            }

            if (itotal > 0)
            {
                string[] titles = new string[] { LocRM.GetString("oTotal"), LocRM.GetString("oCompleted"), LocRM.GetString("oActive"), LocRM.GetString("oPastDue") };
                double[] values = new double[] { Convert.ToDouble(itotal), Convert.ToDouble(icompleted), Convert.ToDouble(iactive), Convert.ToDouble(ipastdue) };
                barChart.CollectDataPoints(titles, values);
            }
            else
                barChart.CollectDataPoints(new string[0], new double[0]);
        }
Пример #4
0
        private void PrjRep_Issues(BarChart barChart)
        {
            LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.Projects.Resources.strProjectReports", typeof(ChartImage).Assembly);

            barChart.Title = LocRM.GetString("oIssuesGraphTitle");
            barChart.Width = 250;
            barChart.Height = 60;
            barChart.Sort = false;
            barChart.BorderWidth = 0;

            int inew = 0;
            int iactive = 0;
            int isuspended = 0;
            int iclosed = 0;
            int ioncheck = 0;
            int itotal = 0;

            int ProjId = int.Parse(Request["ProjectId"].ToString());
            using (IDataReader rdr = Incident.GetIncidentStatistic(ProjId))
            {
                ///  IncidentCount, Pop3IncidentCount, NewIncidentCount, ActiveIncidentCount,
                ///  ClosedIncidentCount, AvgTimeInNewState, AvgTimeInActiveState,
                ///  AvgTimeForResolveClosed, AvgTimeForResolveAll,
                ///  OnCheckIncidentCount, ReOpenIncidentCount, SuspendedIncidentCount

                if (rdr.Read())
                {
                    inew = (int)rdr["NewIncidentCount"];
                    iactive = (int)rdr["ActiveIncidentCount"] + (int)rdr["ReOpenIncidentCount"];
                    isuspended = (int)rdr["SuspendedIncidentCount"];
                    iclosed = (int)rdr["ClosedIncidentCount"];
                    ioncheck = (int)rdr["OnCheckIncidentCount"];
                    itotal = inew + iactive + isuspended + iclosed + ioncheck;
                }
            }

            if (itotal > 0)
            {
                string[] titles = new string[] { LocRM.GetString("oNew"), LocRM.GetString("oOpen"), LocRM.GetString("oSuspended"), LocRM.GetString("oClosed"), LocRM.GetString("oOnCheck") };
                double[] values = new double[] { Convert.ToDouble(inew), Convert.ToDouble(iactive), Convert.ToDouble(isuspended), Convert.ToDouble(iclosed), Convert.ToDouble(ioncheck) };
                barChart.CollectDataPoints(titles, values);
            }
            else
                barChart.CollectDataPoints(new string[0], new double[0]);
        }
Пример #5
0
        private void OverPrjSnap_Issues(BarChart barChart)
        {
            LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.Reports.Resources.strProjectSnapshot", typeof(ChartImage).Assembly);

            barChart.Title = LocRM.GetString("oIssuesGraphTitle");
            barChart.Width = 320;
            barChart.Height = 100;
            barChart.Sort = false;

            int inew = 0;
            int itotal = 0;
            int iactive = 0;
            int iopen = 0;
            int ietc = 0;

            int ProjId = int.Parse(Request["ProjectId"].ToString());
            using (IDataReader rdr = Incident.GetIncidentStatistic(ProjId))
            {
                if (rdr.Read())
                {
                    inew = (int)rdr["NewIncidentCount"];
                    iactive = (int)rdr["ActiveIncidentCount"];
                    itotal = (int)rdr["IncidentCount"];
                    iopen = inew + iactive;
                    ietc = itotal - iopen;
                }
            }

            if (itotal > 0)
            {
                string[] titles = new string[] { LocRM.GetString("oNew"), LocRM.GetString("oOpen"), LocRM.GetString("oActive"), LocRM.GetString("oEtc") };
                double[] values = new double[] { Convert.ToDouble(inew), Convert.ToDouble(iopen), Convert.ToDouble(iactive), Convert.ToDouble(ietc) };
                barChart.CollectDataPoints(titles, values);
            }
            else
                barChart.CollectDataPoints(new string[0], new double[0]);
        }