コード例 #1
0
        private int DisplayResults(string cmdID)
        {
            int          status    = 0;
            SQMMetricMgr metricMgr = null;

            try
            {
                if (!string.IsNullOrEmpty(cmdID))
                {
                    EHS_PROFILE_MEASURE metric      = EHSModel.LookupEHSProfileMeasure(new PSsqmEntities(), Convert.ToDecimal(cmdID));
                    decimal             calcScopeID = EHSModel.ConvertPRODMeasure(metric.EHS_MEASURE, metric.PRMR_ID);
                    decimal             plantID     = Convert.ToDecimal(hfInputsListPlantID.Value);
                    DateTime            periodDate  = Convert.ToDateTime(hfInputsListPeriodDate.Value);

                    divInputsListReviewArea.Visible       = true;
                    divInputsListReviewArea.ViewStateMode = System.Web.UI.ViewStateMode.Disabled;
                    if (metricMgr == null)
                    {
                        metricMgr = new SQMMetricMgr().CreateNew(SessionManager.PrimaryCompany(), "I", periodDate.AddMonths(-12), periodDate, new decimal[1] {
                            plantID
                        });
                        metricMgr.Load(DateIntervalType.month, DateSpanOption.SelectRange);
                    }

                    GaugeDefinition ggCfg = new GaugeDefinition().Initialize();
                    ggCfg.Title         = metric.EHS_MEASURE.MEASURE_NAME.Trim() + " - Input History";
                    ggCfg.Height        = 250; ggCfg.Width = 650;
                    ggCfg.NewRow        = true;
                    ggCfg.DisplayLabel  = true;
                    ggCfg.DisplayLegend = false;

                    ggCfg.LabelV = "Quantity";
                    status       = uclGauge.CreateControl(SQMChartType.MultiLine, ggCfg, metricMgr.CalcsMethods(new decimal[1] {
                        plantID
                    }, "I", calcScopeID.ToString(), "sum", 32, (int)EHSCalcsCtl.SeriesOrder.PeriodMeasure), divInputsListReviewArea);

                    if (string.IsNullOrEmpty(metric.EHS_MEASURE.PLANT_ACCT_FIELD) && metric.EHS_MEASURE.MEASURE_CATEGORY != "FACT")
                    {
                        ggCfg.Height       = 165; ggCfg.Width = 650;
                        ggCfg.Title        = "";
                        ggCfg.DisplayLabel = false;
                        ggCfg.LabelV       = "Cost";
                        status             = uclGauge.CreateControl(SQMChartType.MultiLine, ggCfg, metricMgr.CalcsMethods(new decimal[1] {
                            plantID
                        }, "I", calcScopeID.ToString(), "cost", 32, (int)EHSCalcsCtl.SeriesOrder.PeriodMeasure), divInputsListReviewArea);
                    }
                }
            }
            catch
            {
                ;
            }

            return(status);
        }
コード例 #2
0
        private int DisplayResults(string cmdID)
        {
            int          status    = 0;
            SQMMetricMgr metricMgr = null;

            foreach (RepeaterItem item in rptProfilePeriod.Items)
            {
                try
                {
                    LinkButton lnk = (LinkButton)item.FindControl("lnkMetricCD");
                    CheckBox   cb  = (CheckBox)item.FindControl("cbMetricSelect");
                    if (cb.Checked) //  ||  cmdID == "0")
                    {
                        EHS_PROFILE_MEASURE metric      = LocalProfile().GetMeasure(Convert.ToDecimal(lnk.CommandArgument));
                        decimal             calcScopeID = EHSModel.ConvertPRODMeasure(metric.EHS_MEASURE, metric.PRMR_ID);
                        System.Web.UI.HtmlControls.HtmlGenericControl reviewArea = (System.Web.UI.HtmlControls.HtmlGenericControl)item.FindControl("divReviewArea");
                        LinkButton lnkClose = (LinkButton)item.FindControl("lnkReviewAreaClose");
                        lnkClose.Visible         = reviewArea.Visible = true;
                        lnk.Visible              = false;
                        reviewArea.ViewStateMode = System.Web.UI.ViewStateMode.Disabled;
                        if (metricMgr == null)
                        {
                            metricMgr = new SQMMetricMgr().CreateNew(SessionManager.PrimaryCompany(), "I", LocalProfile().InputPeriod.PeriodDate.AddMonths(-12), LocalProfile().InputPeriod.PeriodDate, new decimal[1] {
                                LocalProfile().Profile.PLANT_ID
                            });
                            metricMgr.Load(DateIntervalType.month, DateSpanOption.SelectRange);
                        }

                        GaugeDefinition ggCfg = new GaugeDefinition().Initialize();
                        ggCfg.Title         = metric.EHS_MEASURE.MEASURE_NAME.Trim() + " - Input History";
                        ggCfg.Height        = 250; ggCfg.Width = 700;
                        ggCfg.NewRow        = true;
                        ggCfg.DisplayLabel  = true;
                        ggCfg.DisplayLegend = false;

                        ggCfg.LabelV = "Quantity";
                        status       = uclGauge.CreateControl(SQMChartType.MultiLine, ggCfg, metricMgr.CalcsMethods(new decimal[1] {
                            LocalProfile().Profile.PLANT_ID
                        }, "I", calcScopeID.ToString(), "sum", 32, (int)EHSCalcsCtl.SeriesOrder.PeriodMeasure), reviewArea);

                        if (string.IsNullOrEmpty(metric.EHS_MEASURE.PLANT_ACCT_FIELD) && metric.EHS_MEASURE.MEASURE_CATEGORY != "FACT")
                        {
                            ggCfg.Height       = 180; ggCfg.Width = 700;
                            ggCfg.Title        = "";
                            ggCfg.DisplayLabel = false;
                            ggCfg.LabelV       = "Cost";
                            status             = uclGauge.CreateControl(SQMChartType.MultiLine, ggCfg, metricMgr.CalcsMethods(new decimal[1] {
                                LocalProfile().Profile.PLANT_ID
                            }, "I", calcScopeID.ToString(), "cost", 32, (int)EHSCalcsCtl.SeriesOrder.PeriodMeasure), reviewArea);
                        }
                    }
                }
                catch
                {
                    ;
                }
            }

            BindSharedCalendars();

            return(status);
        }