public ActionResult GetGraph2(int ProjectId) { //{"name":"John"} GraphData2 graphData2 = new GraphData2(); Project prj = db.Projects.Find(ProjectId); int maxy = 11; int maxx = prj.UserStories.Where(u => u.CompletedDate != null).Select(s => s.Id).Count(); //int[] usr = prj.UserStories.Select(u => u.Effort).ToArray(); int[] usr = prj.UserStories.Where(u => u.CompletedDate != null).Select(u => u.Effort).ToArray(); int[][] tmpu2 = new int[maxx + 1][]; for (int i = 0; i < maxx; i++) { tmpu2[i] = new int[2] { i, usr[i] }; } int[] usru = prj.UserStories.Where(u => u.CompletedDate != null).Select(usu => usu.User_Effort).ToArray(); int[][] tmpp2 = new int[maxx + 1][]; for (int i = 0; i < maxx; i++) { tmpp2[i] = new int[2] { i, usru[i] }; } graphData2.maxx = maxx; graphData2.maxy = maxy; graphData2.u2 = tmpu2; graphData2.p2 = tmpp2; return(Json(graphData2, JsonRequestBehavior.AllowGet)); }
public void AddGraph2(GraphData2 graph) { ctx.Graphs2.Add(graph); ctx.SaveChanges(); }
public void AddGraph2(GraphData2 graph) { InitNonExistingRepo(); repo.AddGraph2(graph); }
private void RefreshGraph() { try { if (GraphType.ToValueAsString().Trim() == "") { ShowInformationMessage(PDMsg.NotEmpty("Graph Type")); return; } if (StartDate.ToValueAsString().Trim() == "") { ShowInformationMessage(PDMsg.NotEmpty("Start Date")); return; } if (EndDate.ToValueAsString().Trim() == "") { ShowInformationMessage(PDMsg.NotEmpty("End Date")); return; } if (StartDate > EndDate) { ShowInformationMessage("Start Date is Greater than End Date,Please Check it.!"); return; } if (GraphData != null) { GraphData.Clear(); } if (GraphData1 != null) { GraphData1.Clear(); NotifyPropertyChanged("GraphData1"); } if (GraphData2 != null) { GraphData2.Clear(); NotifyPropertyChanged("GraphData2"); } if (GraphData3 != null) { GraphData3.Clear(); NotifyPropertyChanged("GraphData3"); } if (GraphType == "FRC") { GraphData = _mopGraphBll.FeasibilityReportCount(Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy")); GraphTitle = "Feasibility Reports Completed"; YAxisTitle = "No. of Costsheets Completed"; XAxisTitle = "Months"; SingleLegend = Visibility.Visible; DoubleLegend = Visibility.Collapsed; TripleLegend = Visibility.Collapsed; } else if (GraphType == "DPA") { GraphData = _mopGraphBll.DevelopmentPlanAdherence(Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy")); GraphTitle = "Documents Completed"; YAxisTitle = "No. of Documents Released"; XAxisTitle = "Months"; SingleLegend = Visibility.Visible; DoubleLegend = Visibility.Collapsed; TripleLegend = Visibility.Collapsed; } else if (GraphType == "LTA") { GraphData = _mopGraphBll.LeadTimeAdherence(Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy"), "0"); GraphData1 = _mopGraphBll.LeadTimeAdherence(Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy"), "1"); GraphTitle = "Design Lead Time"; YAxisTitle = "Lead Time"; XAxisTitle = "Month"; SingleLegend = Visibility.Collapsed; DoubleLegend = Visibility.Visible; TripleLegend = Visibility.Collapsed; } else if (GraphType == "DE") { GraphData = _mopGraphBll.DesignEffectiveness(Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy")); GraphTitle = "Feasibility Reports Completed"; YAxisTitle = "No. of Costsheets Completed"; XAxisTitle = "Month"; SingleLegend = Visibility.Visible; DoubleLegend = Visibility.Collapsed; TripleLegend = Visibility.Collapsed; } else if (GraphType == "CTS") { GraphData = _mopGraphBll.ConformanceToSpecification(Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy")); GraphTitle = "Feasibility Reports Completed"; YAxisTitle = "No. of Costsheets Completed"; XAxisTitle = "Month"; SingleLegend = Visibility.Visible; DoubleLegend = Visibility.Collapsed; TripleLegend = Visibility.Collapsed; } else if (GraphType == "CE") { GraphData = _mopGraphBll.CostEffectiveness(Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy")); GraphTitle = "Feasibility Reports Completed"; YAxisTitle = "No. of Costsheets Completed"; XAxisTitle = "Month"; SingleLegend = Visibility.Visible; DoubleLegend = Visibility.Collapsed; TripleLegend = Visibility.Collapsed; } else if (GraphType == "RAC") { GraphData = _mopGraphBll.RequestVsAgreedAndCompleted(Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy")); GraphTitle = "Feasibility Reports Completed"; YAxisTitle = "No. of Costsheets Completed"; XAxisTitle = "Month"; SingleLegend = Visibility.Visible; DoubleLegend = Visibility.Collapsed; TripleLegend = Visibility.Collapsed; } else if (GraphType == "PGCDR") { GraphData = _mopGraphBll.PGCForDocumentReleased(Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy"), "1"); GraphData1 = _mopGraphBll.PGCForDocumentReleased(Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy"), "2"); GraphData2 = _mopGraphBll.PGCForDocumentReleased(Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy"), "3"); GraphData3 = _mopGraphBll.PGCForDocumentReleased(Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy"), "TOTAL"); GraphTitle = "Product Group Category For Document Released"; XAxisTitle = "Month"; YAxisTitle = "Number of Products"; LegendTitle = "PG 1"; LegendTitle1 = "PG 2"; LegendTitle2 = "PG 3"; LegendTitle3 = "Total"; SingleLegend = Visibility.Collapsed; DoubleLegend = Visibility.Collapsed; TripleLegend = Visibility.Visible; } else if (GraphType == "PGCSSP") { GraphData = _mopGraphBll.PGCForSampleSubmittedProducts(Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy"), "1"); GraphData1 = _mopGraphBll.PGCForSampleSubmittedProducts(Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy"), "2"); GraphData2 = _mopGraphBll.PGCForSampleSubmittedProducts(Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy"), "3"); GraphData3 = _mopGraphBll.PGCForSampleSubmittedProducts(Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy"), Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy"), "TOTAL"); GraphTitle = "Product Group Category For Sample Submitted Products"; XAxisTitle = "Month"; LegendTitle = "PG 1"; LegendTitle1 = "PG 2"; LegendTitle2 = "PG 3"; LegendTitle3 = "Total"; SingleLegend = Visibility.Collapsed; DoubleLegend = Visibility.Collapsed; TripleLegend = Visibility.Visible; } } catch (Exception ex) { throw ex.LogException(); } }