private void SetupPage() { // this is really the Measures tab ToggleVisible(pnlMeasureList); if (ddlMeasureStatus.Items.Count == 0) { ddlMeasureStatus.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("statusCodeDelete", "short")); } if (ddlMeasureCategory.Items.Count < 2) { ddlMeasureCategory.Items.Clear(); ddlMeasureCategory.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("measureCategoryEHS")); ddlMeasureCategory.Items.Insert(0, new ListItem("-all categories-", "")); ddlMeasureCategory.SelectedValue = ""; lnkMeasureNew.Visible = false; } if (ddlMeasureEFMType.Items.Count == 0) { ddlMeasureEFMType.DataSource = EHSModel.SelectEFMTypeList(""); ddlMeasureEFMType.DataValueField = "EFM_TYPE"; ddlMeasureEFMType.DataTextField = "DESCRIPTION"; ddlMeasureEFMType.DataBind(); ddlMeasureEFMType.Items.Insert(0, new ListItem("")); } if (ddlOutputUOM.Items.Count == 0) { string[] uomcats = { "FACT" }; foreach (UOM uom in SessionManager.UOMList.Where(l => uomcats.Contains(l.UOM_CATEGORY)).ToList()) { ddlOutputUOM.Items.Add(new ListItem(uom.UOM_DESC, uom.UOM_ID.ToString())); } ddlOutputUOM.Items.Insert(0, new ListItem("", "")); } measureList = EHSModel.SelectEHSMeasureList(ddlMeasureCategory.SelectedValue, false); BindMeasureList(measureList); }
private void SetupProfilePanel() { if (ddlMetricDisposalCode.Items.Count == 0) { ddlDayDue.Items.AddRange(WebSiteCommon.PopulateDropDownListNums(1, 31)); ddlWarningDays.Items.AddRange(WebSiteCommon.PopulateDropDownListNums(0, 11)); disposalList = EHSModel.SelectDisposalCodeList(true); ddlMetricDisposalCode.DataSource = disposalList; ddlMetricDisposalCode.DataValueField = "UN_CODE"; ddlMetricDisposalCode.DataTextField = "UN_CODE"; ddlMetricDisposalCode.DataBind(); ddlMetricDisposalCode.Items.Insert(0, new ListItem("")); ddlMetricRegStatus.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("regulatoryStatus")); ddlMetricRegStatus.Items.Insert(0, new ListItem("")); ddlMetricResponsible.DataSource = SQMModelMgr.SelectPersonList(SessionManager.ActiveCompany().COMPANY_ID, 0, false); ddlMetricResponsible.DataValueField = "PERSON_ID"; ddlMetricResponsible.DataTextField = "EMAIL"; ddlMetricResponsible.DataBind(); ddlMetricResponsible.Items.Insert(0, new ListItem("")); ddlMetricResponsible.SelectedIndex = 0; ddlMetricCurrency.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("currencyCode", "long")); ddlMetricCurrency.SelectedValue = "EUR"; ddlMetricStatus.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("statusCode")); ddlMetricCategory.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("measureCategoryEHS")); ddlMetricCategory.Items.Insert(0, ""); measureList = EHSModel.SelectEHSMeasureList("", true); foreach (EHS_MEASURE measure in measureList) { ddlMetricID.Items.Add(new ListItem(measure.MEASURE_NAME, WebSiteCommon.PackItemValue(measure.MEASURE_CATEGORY, measure.MEASURE_ID.ToString()))); } ddlMetricID.Items.Insert(0, ""); foreach (UOM uom in SessionManager.UOMList) { if (uom.OWNER_ID.HasValue == false) { ddlMetricUOM.Items.Add(new ListItem(uom.UOM_NAME, WebSiteCommon.PackItemValue(uom.UOM_CATEGORY, uom.UOM_ID.ToString()))); ddlUserUOMConvertTo.Items.Add(new ListItem(uom.UOM_NAME, WebSiteCommon.PackItemValue(uom.UOM_CATEGORY, uom.UOM_ID.ToString()))); } } ListItem separator = new ListItem("---------------------", ""); separator.Attributes.Add("disabled", "true"); ddlMetricUOM.Items.Add(separator); foreach (UOM uom in SessionManager.UOMList) { if ((uom.OWNER_ID.HasValue && uom.OWNER_ID == staticProfile.Plant.PLANT_ID)) { ddlMetricUOM.Items.Add(new ListItem(uom.UOM_NAME, WebSiteCommon.PackItemValue(uom.UOM_CATEGORY, uom.UOM_ID.ToString()))); } } ddlMetricUOM.Items.Insert(0, ""); ddlMetricUOM.SelectedIndex = 0; } UpdateListTitles(); }
private void SetupProfilePanel() { if (ddlMetricDisposalCode.Items.Count == 0) { ddlDayDue.Items.AddRange(WebSiteCommon.PopulateDropDownListNums(1, 31)); ddlWarningDays.Items.AddRange(WebSiteCommon.PopulateDropDownListNums(0, 11)); ddlMetricDisposalCode.DataSource = SessionManager.DisposalCodeList; ddlMetricDisposalCode.DataValueField = "UN_CODE"; ddlMetricDisposalCode.DataTextField = "UN_CODE"; ddlMetricDisposalCode.DataBind(); ddlMetricDisposalCode.Items.Insert(0, new ListItem("")); ddlMetricRegStatus.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("regulatoryStatus")); ddlMetricRegStatus.Items.Insert(0, new ListItem("")); SQMBasePage.FillCurrencyDDL(ddlMetricCurrency, "EUR"); ddlMetricCurrency.Items.Insert(0, ""); ddlMetricCost.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("costType", "long")); ddlMetricCost.Items.Insert(0, ""); if (UserContext.CheckUserPrivilege(SysPriv.config, SysScope.envdata)) { ddlMetricStatus.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("statusCodeDelete")); } else { ddlMetricStatus.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("statusCode")); } ddlMetricCategory.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("measureCategoryEHS", 2, "")); ddlMetricCategory.Items.Insert(0, ""); measureList = EHSModel.SelectEHSMeasureList("", true).OrderBy(l => l.MEASURE_NAME).ToList(); foreach (EHS_MEASURE measure in measureList) { ddlMetricID.Items.Add(new ListItem(measure.MEASURE_NAME.Trim(), WebSiteCommon.PackItemValue(measure.MEASURE_CATEGORY, measure.EFM_TYPE, measure.MEASURE_ID.ToString()))); if (measure.MEASURE_CATEGORY == "FACT") { ListItem item = new ListItem(measure.MEASURE_NAME.Trim(), measure.MEASURE_ID.ToString()); item.Attributes.Add("title", measure.MEASURE_DESC); ddlNormFact.Items.Add(item); } } ddlMetricID.Items.Insert(0, ""); ddlNormFact.Items.Insert(0, ""); if (ddlNormFact.Items.Count == 1) // don't display normalize selects if no factors defined { phNormFact.Visible = false; } foreach (UOM uom in SessionManager.UOMList.Where(l => l.OWNER_ID == null).OrderBy(l => l.UOM_NAME).ToList()) { ddlMetricUOM.Items.Add(new ListItem(uom.UOM_NAME, WebSiteCommon.PackItemValue(uom.UOM_CATEGORY, uom.EFM_TYPE, uom.UOM_ID.ToString()))); } ddlMetricUOM.Items.Insert(0, ""); ddlMetricUOM.SelectedIndex = 0; } divEHSProfile.Visible = true; pnlCopyProfile.Visible = false; UpdateListTitles(); }