Exemplo n.º 1
0
        public ActionResult GetGraph3(int ProjectId)
        {
            //{"name":"John"}
            GraphData3 graphData3 = new GraphData3();

            Project prj = db.Projects.Find(ProjectId);

            int maxy = 0;
            int miny = 0;
            //int maxx = prj.UserStories.Select(s => s.Id).Count();
            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[] usrids = prj.UserStories.Where(u => u.CompletedDate != null).Select(u => u.Id).ToArray();
            //int[] usr = prj.UserStories.Select(us => us.Effort).ToArray();
            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 + 1] = new int[2] {
                    i, usru[i] - usr[i]
                };

                if (miny > (usru[i] - usr[i]))
                {
                    miny = (usru[i] - usr[i]);
                }
                if (maxy < (usru[i] - usr[i]))
                {
                    maxy = (usru[i] - usr[i]);
                }
            }


            graphData3.maxx = maxx;
            graphData3.maxy = maxy;
            graphData3.miny = miny;
            graphData3.p2   = tmpp2;
            graphData3.ids  = usrids;
            return(Json(graphData3, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        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();
            }
        }