Example #1
0
        protected void mfSaveFilter_PreRender(object sender, EventArgs e)
        {
            MetricTrac.Control.OrglocationMultipick orgLocationSelect = ((MetricTrac.Control.OrglocationMultipick)mfSaveFilter.FindControl("orgLocationSelect1"));
            MetricTrac.Control.GCASelect            cASelect          = ((MetricTrac.Control.GCASelect)mfSaveFilter.FindControl("cASelect"));
            MetricTrac.Control.MultiSelectList      multiPI           = ((MetricTrac.Control.MultiSelectList)mfSaveFilter.FindControl("multiPI"));
            MetricTrac.Control.MultiSelectList      multiMetric       = ((MetricTrac.Control.MultiSelectList)mfSaveFilter.FindControl("multiMetric"));
            DropDownList DataCollectorList = ((DropDownList)mfSaveFilter.FindFieldControl("DataCollectorID"));

            if (!IsPostBack)
            {
                List <Bll.DataRule.Entity> dr = Bll.PerformanceIndicator.List().Select(m => new Bll.DataRule.Entity(m.PerformanceIndicatorID, m.Name)).ToList();
                multiPI.LoadEntities(dr, null);

                if (Filter != null)
                {
                    orgLocationSelect.OrgLocationsID = Filter.FilterOrgLocation;
                    cASelect.GCAID                  = Filter.GroupCategoryAspectID;
                    multiPI.SelectedValues          = Filter.FilterPI;
                    DataCollectorList.SelectedValue = Filter.DataCollectorID.ToString();
                }
            }
            List <Bll.DataRule.Entity> Metrics =
                MetricTrac.Bll.Metric.List(orgLocationSelect.OrgLocationsID, cASelect.GCAID, multiPI.SelectedValues, null)
                .Select(m => new Bll.DataRule.Entity(m.MetricID, m.Name))
                .ToList();

            multiMetric.LoadEntities(Metrics, null);
            if (!IsPostBack && Filter != null)
            {
                multiMetric.SelectedValues = Filter.FilterMetric;
            }
        }
Example #2
0
        protected void Page_Prerender(object sender, EventArgs e)
        {
            MetricTrac.Control.OrglocationMultipick multiLocations = (MetricTrac.Control.OrglocationMultipick)mfDataCollector.FindControl("orgLocationSelect");
            MetricTrac.Control.GCASelect            cASelect       = (MetricTrac.Control.GCASelect)mfDataCollector.FindControl("cASelect");
            MetricTrac.Control.MultiSelectList      multiPI        = (MetricTrac.Control.MultiSelectList)mfDataCollector.FindControl("mslPI");
            MetricTrac.Control.MultiSelectList      multiMetric    = (MetricTrac.Control.MultiSelectList)mfDataCollector.FindControl("mslMetric");
            if (!IsPostBack)
            {
                List <Bll.DataRule.Entity> dr = Bll.PerformanceIndicator.List().Select(m => new Bll.DataRule.Entity(m.PerformanceIndicatorID, m.Name)).ToList();
                multiPI.LoadEntities(dr, null);

                // Assign
                multiLocations.OrgLocationsID = RuleOrgLocations;
                multiPI.SelectedValues        = RulePerformanceIndicators;

                if (RuleGroupId != null)
                {
                    if (ddlGroup.Items.FindByValue(RuleGroupId.ToString()) != null)
                    {
                        ddlGroup.SelectedValue = RuleGroupId.ToString();
                    }
                }
                if (RuleUserId != null)
                {
                    if (ddlUser.Items.FindByValue(RuleUserId.ToString()) != null)
                    {
                        ddlUser.SelectedValue = RuleUserId.ToString();
                    }
                }
            }

            List <Bll.DataRule.Entity> Metrics =
                MetricTrac.Bll.Metric.List(multiLocations.OrgLocationsID, cASelect.GCAID, multiPI.SelectedValues, null)
                .Select(m => new Bll.DataRule.Entity(m.MetricID, m.Name))
                .ToList();

            multiMetric.LoadEntities(Metrics, null);
            if (!IsPostBack)
            {
                multiMetric.SelectedValues = RuleMetrics;
            }
        }