private void AllPrjRep_PrjCat(PieChart pc) { DataTable dt = Project.GetProjectStatisticByProjectCategoryDataTable(); pc.Width = 250; pc.Radius = 140; pc.BorderWidth = 0; 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"]); } pc.CollectDataPoints(titles, values); }
private void IncStat_IncCat(PieChart pc) { LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.Reports.Resources.strIncidentStatistics", typeof(ChartImage).Assembly); int ProjId = int.Parse(Request["ProjectId"].ToString()); int ManId = int.Parse(Request["ManagerId"].ToString()); DataTable dt = Incident.GetListIncidentStatisticByIncidentCategoryDataTable(ProjId, ManId); pc.Title = LocRM.GetString("IncByIncCat"); pc.Width = 250; pc.Radius = 140; 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"]); } pc.CollectDataPoints(titles, values); }
private void IncClosed_Type(PieChart pc) { LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.Reports.Resources.strIncidentStatistics", typeof(ChartImage).Assembly); DataTable dt = Incident.GetListIncidentStatisticByTypeDataTable(); pc.Title = LocRM.GetString("IncByType"); pc.Width = 160; pc.Radius = 110; 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"]); } pc.CollectDataPoints(titles, values); }
private void IncClosed_Status(PieChart pc) { LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.Reports.Resources.strIncidentStatistics", typeof(ChartImage).Assembly); using (IDataReader rdr = Incident.GetIncidentStatistic(0, 0)) { /// IncidentCount, Pop3IncidentCount, NewIncidentCount, ActiveIncidentCount, /// ClosedIncidentCount, AvgTimeInNewState, AvgTimeInActiveState, /// AvgTimeForResolveClosed, AvgTimeForResolveAll rdr.Read(); pc.Title = LocRM.GetString("IncDistribution"); pc.Width = 160; pc.Radius = 110; if (Convert.ToDouble(rdr["NewIncidentCount"]) != 0 || Convert.ToDouble(rdr["ActiveIncidentCount"]) != 0 || Convert.ToDouble(rdr["ClosedIncidentCount"]) != 0) { string[] titles = new string[] { LocRM.GetString("New"), LocRM.GetString("Active"), LocRM.GetString("Closed") }; double[] values = new double[] { Convert.ToDouble(rdr["NewIncidentCount"]), Convert.ToDouble(rdr["ActiveIncidentCount"]), Convert.ToDouble(rdr["ClosedIncidentCount"]) }; pc.CollectDataPoints(titles, values); } else pc.CollectDataPoints(new string[0], new double[0]); } }
private void Dash_Iss_Item_Pie(PieChart pc, string sItem) { prop_col["Dashboard_GraphView"] = sItem; LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.Incidents.Resources.strIncidents", typeof(ChartImage).Assembly); pc.BorderWidth = 0; pc.DrawPercents = true; pc.MinPercentToDraw = 5; 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": //Issue Box 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") + " (" + dt.Rows[i]["Count"].ToString() + ")"; else titles[i] = dt.Rows[i]["ItemName"].ToString() + " (" + dt.Rows[i]["Count"].ToString() + ")"; values[i] = Convert.ToDouble(dt.Rows[i]["Count"]); } pc.CollectDataPoints(titles, values); }
private void Dash_Prj_Item_Pie(PieChart pc, string sItem) { prop_col["Dashboard_GraphView"] = sItem; pc.BorderWidth = 0; pc.DrawPercents = true; pc.MinPercentToDraw = 5; 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() + " (" + dt.Rows[i]["Count"].ToString() + ")"; values[i] = Convert.ToDouble(dt.Rows[i]["Count"]); } pc.CollectDataPoints(titles, values); }
private void BindIncRep_Type(PieChart pc) { pc.BorderWidth = 0; pc.Radius = 110; DataTable dt = Incident.GetListIncidentStatisticByTypeDataTable(); 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"]); } pc.CollectDataPoints(titles, values); }
private void BindPieChart() { PieChart pc = new PieChart(); if (Request["IncRep_Status"] != null) BindIncRep_Status(pc); else if (Request["IncRep_Type"] != null) BindIncRep_Type(pc); else if (Request["AllPrjRep_Status"] != null) AllPrjRep_Status(pc); else if (Request["AllPrjRep_PrjCat"] != null) AllPrjRep_PrjCat(pc); else if (Request["PrjRep_TaskToDo"] != null) PrjRep_TaskToDo(pc); else if (Request["IncStat_IncStatus"] != null) IncStat_IncStatus(pc); else if (Request["IncStat_IncType"] != null) IncStat_IncType(pc); else if (Request["IncStat_GenCat"] != null) IncStat_GenCat(pc); else if (Request["IncStat_IncCat"] != null) IncStat_IncCat(pc); else if (Request["IncStat_Man"] != null) IncStat_Man(pc); else if (Request["IncStat_Prj"] != null) IncStat_Prj(pc); else if (Request["IncAnalys_Status"] != null) IncAnalys_Status(pc); else if (Request["IncAnalys_Type"] != null) IncAnalys_Type(pc); else if (Request["IncAnalys_GenCat"] != null) IncAnalys_GenCat(pc); else if (Request["IncAnalysCat_Status"] != null) IncAnalysCat_Status(pc); else if (Request["IncAnalysCat_Type"] != null) IncAnalysCat_Type(pc); else if (Request["IncAnalysCat_GenCat"] != null) IncAnalysCat_GenCat(pc); else if (Request["IncAnalysMan_Status"] != null) IncAnalysMan_Status(pc); else if (Request["IncAnalysMan_Type"] != null) IncAnalysMan_Type(pc); else if (Request["IncAnalysMan_GenCat"] != null) IncAnalysMan_GenCat(pc); else if (Request["IncAnalysType_Status"] != null) IncAnalysType_Status(pc); else if (Request["IncAnalysType_Type"] != null) IncAnalysType_Type(pc); else if (Request["IncAnalysType_GenCat"] != null) IncAnalysType_GenCat(pc); else if (Request["IncClosed_Status"] != null) IncClosed_Status(pc); else if (Request["IncClosed_Type"] != null) IncClosed_Type(pc); else if (Request["IncClosed_GenCat"] != null) IncClosed_GenCat(pc); else if (Request["IncAnalysPrj_Status"] != null) IncAnalysPrj_Status(pc); else if (Request["IncAnalysPrj_Type"] != null) IncAnalysPrj_Type(pc); else if (Request["IncAnalysPrj_GenCat"] != null) IncAnalysPrj_GenCat(pc); else if (Request["OverHDIss_Status"] != null) OverHDIss_Status(pc); else if (Request["OverHDIss_Type"] != null) OverHDIss_Type(pc); else if (Request["OverHDIss_GenCat"] != null) OverHDIss_GenCat(pc); else if (Request["PrjStat_Status"] != null) PrjStat_Status(pc); else if (Request["PrjStat_Type"] != null) PrjStat_Type(pc); else if (Request["PrjStat_GenCat"] != null) PrjStat_GenCat(pc); else if (Request["PrjStat_PrjCat"] != null) PrjStat_PrjCat(pc); else if (Request["PrjStat_Man"] != null) PrjStat_Man(pc); //////////////////Dashboard - Projects//////////////////////////////////////////////////////// else if (Request["Dash_Prj_Stat"] != null) Dash_Prj_Item_Pie(pc, "Dash_Prj_Stat"); else if (Request["Dash_Prj_Prior"] != null) Dash_Prj_Item_Pie(pc, "Dash_Prj_Prior"); else if (Request["Dash_Prj_Typ"] != null) Dash_Prj_Item_Pie(pc, "Dash_Prj_Typ"); else if (Request["Dash_Prj_Man"] != null) Dash_Prj_Item_Pie(pc, "Dash_Prj_Man"); else if (Request["Dash_Prj_GenCat"] != null) Dash_Prj_Item_Pie(pc, "Dash_Prj_GenCat"); else if (Request["Dash_Prj_PrjCat"] != null) Dash_Prj_Item_Pie(pc, "Dash_Prj_PrjCat"); else if (Request["Dash_Prj_PrjGrp"] != null) Dash_Prj_Item_Pie(pc, "Dash_Prj_PrjGrp"); else if (Request["Dash_Prj_Phas"] != null) Dash_Prj_Item_Pie(pc, "Dash_Prj_Phas"); else if (Request["Dash_Prj_Clnt"] != null) Dash_Prj_Item_Pie(pc, "Dash_Prj_Clnt"); //////////////////Dashboard - Issues//////////////////////////////////////////////////////// else if (Request["Dash_Iss_Stat"] != null) Dash_Iss_Item_Pie(pc, "Dash_Iss_Stat"); else if (Request["Dash_Iss_Prior"] != null) Dash_Iss_Item_Pie(pc, "Dash_Iss_Prior"); else if (Request["Dash_Iss_Typ"] != null) Dash_Iss_Item_Pie(pc, "Dash_Iss_Typ"); else if (Request["Dash_Iss_Prj"] != null) Dash_Iss_Item_Pie(pc, "Dash_Iss_Prj"); else if (Request["Dash_Iss_Man"] != null) Dash_Iss_Item_Pie(pc, "Dash_Iss_Man"); else if (Request["Dash_Iss_Sev"] != null) Dash_Iss_Item_Pie(pc, "Dash_Iss_Sev"); else if (Request["Dash_Iss_GenCat"] != null) Dash_Iss_Item_Pie(pc, "Dash_Iss_GenCat"); else if (Request["Dash_Iss_IssCat"] != null) Dash_Iss_Item_Pie(pc, "Dash_Iss_IssCat"); System.IO.MemoryStream tmpStream = new System.IO.MemoryStream(); pc.Draw(tmpStream, System.Drawing.Imaging.ImageFormat.Png); byte[] tmpBuffer = tmpStream.GetBuffer(); this.Response.OutputStream.Write(tmpBuffer, 0, tmpBuffer.Length); }
private void BindIncRep_Status(PieChart pc) { LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.Incidents.Resources.strIncidents", typeof(ChartImage).Assembly); pc.BorderWidth = 0; pc.Radius = 110; int iTotal = 0; int iNew = 0; int iActive = 0; int iClosed = 0; using (IDataReader reader = Incident.GetIncidentStatistic(0)) { if (reader.Read()) { iTotal = (int)reader["IncidentCount"]; iNew = (int)reader["NewIncidentCount"]; iActive = (int)reader["ActiveIncidentCount"]; iClosed = (int)reader["ClosedIncidentCount"]; } } if (iTotal > 0) { string[] titles = new string[] { LocRM.GetString("oClosed"), LocRM.GetString("oNew"), LocRM.GetString("oActive") }; double[] values = new double[] { Convert.ToDouble(iClosed), Convert.ToDouble(iNew), Convert.ToDouble(iActive) }; pc.CollectDataPoints(titles, values); } else pc.CollectDataPoints(new string[0], new double[0]); }
private void PrjStat_Type(PieChart pc) { LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.Reports.Resources.strProjectStatistics", typeof(ChartImage).Assembly); ArrayList alPrjsID = new ArrayList(); string sID = prop_col["ProjectStatistics_PrjId"].ToString(); while (sID.Length > 0) { alPrjsID.Add(int.Parse(sID.Substring(0, sID.IndexOf(",")))); sID = sID.Remove(0, sID.IndexOf(",") + 1); } ArrayList alPrjs = Project.GetListProjectsByListId(alPrjsID); DataTable dt = Project.GetProjectStatisticByTypeDataTable(alPrjs); pc.Title = LocRM.GetString("ProjByType"); pc.Width = 200; pc.Radius = 140; 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]["TypeName"].ToString(); values[i] = Convert.ToDouble(dt.Rows[i]["Count"]); } pc.CollectDataPoints(titles, values); }
private void PrjRep_TaskToDo(PieChart pc) { LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.Projects.Resources.strProjectReports", typeof(ChartImage).Assembly); pc.Title = LocRM.GetString("oTaksToDosGraphTitle"); pc.Width = 300; pc.Radius = 110; pc.BorderWidth = 0; int itotal = 0; int icompleted = 0; int iactive = 0; int iupcoming = 0; int ipastdue = 0; int ProjId = int.Parse(Request["ProjectId"].ToString()); using (IDataReader rdr = Report.GetToDoAndTaskTrackingReport(ProjId)) { /// Total, Completed, PastDue, Active, Upcoming if (rdr.Read()) { itotal = (int)rdr["Total"]; icompleted = (int)rdr["Completed"]; iactive = (int)rdr["Active"]; iupcoming = (int)rdr["Upcoming"]; ipastdue = (int)rdr["PastDue"]; } } if (itotal > 0) { string[] titles = new string[] { LocRM.GetString("oUpcoming"), LocRM.GetString("oActiveTasks"), LocRM.GetString("oCompleted"), LocRM.GetString("oPastDue") }; double[] values = new double[] { Convert.ToDouble(iupcoming), Convert.ToDouble(iactive - ipastdue), Convert.ToDouble(icompleted), Convert.ToDouble(ipastdue) }; pc.CollectDataPoints(titles, values); } else pc.CollectDataPoints(new string[0], new double[0]); }
private void IncStat_Prj(PieChart pc) { LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.Reports.Resources.strIncidentStatistics", typeof(ChartImage).Assembly); int ManId = int.Parse(Request["ManagerId"].ToString()); DataTable dt = Incident.GetListIncidentStatisticByProjectDataTable(ManId); pc.Title = LocRM.GetString("IncByProj"); pc.Width = 250; pc.Radius = 140; string[] titles = new string[dt.Rows.Count]; double[] values = new double[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["ItemName"] == DBNull.Value) dt.Rows[i]["ItemName"] = LocRM.GetString("WithoutProject"); string sName = dt.Rows[i]["ItemName"].ToString(); if (sName.Length < 33) titles[i] = sName; else titles[i] = sName.Substring(0, 30) + "..."; values[i] = Convert.ToDouble(dt.Rows[i]["Count"]); } pc.CollectDataPoints(titles, values); }
private void IncStat_IncStatus(PieChart pc) { LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.Reports.Resources.strIncidentStatistics", typeof(ChartImage).Assembly); int inew = 0; int iactive = 0; int iclosed = 0; int ProjId = int.Parse(Request["ProjectId"].ToString()); int ManId = int.Parse(Request["ManagerId"].ToString()); using (IDataReader rdr = Incident.GetIncidentStatistic(ProjId, ManId)) { /// IncidentCount, Pop3IncidentCount, NewIncidentCount, ActiveIncidentCount, /// ClosedIncidentCount, AvgTimeInNewState, AvgTimeInActiveState, /// AvgTimeForResolveClosed, AvgTimeForResolveAll if (rdr.Read()) { inew = (int)rdr["NewIncidentCount"]; iactive = (int)rdr["ActiveIncidentCount"]; iclosed = (int)rdr["ClosedIncidentCount"]; } } pc.Title = LocRM.GetString("IncDistribution"); pc.Width = 200; pc.Radius = 140; if (Convert.ToDouble(inew) != 0 || Convert.ToDouble(iactive) != 0 || Convert.ToDouble(iclosed) != 0) { string[] titles = new string[] { LocRM.GetString("New"), LocRM.GetString("Active"), LocRM.GetString("Closed") }; double[] values = new double[] { Convert.ToDouble(inew), Convert.ToDouble(iactive), Convert.ToDouble(iclosed) }; pc.CollectDataPoints(titles, values); } else pc.CollectDataPoints(new string[0], new double[0]); }