private void SetupPage()
        {
            if (ddlIncidentSeverity2.Items.Count == 0)
            {
                ddlIncidentSeverity2.Items.AddRange(WebSiteCommon.PopulateRadListItems("incidentSeverity"));
                ddlIncidentSeverity2.Items.Insert(0, new RadComboBoxItem("", ""));
                ddlIncidentSeverity2.SelectedIndex = 0;

                ddlDisposition.Items.AddRange(WebSiteCommon.PopulateRadListItems("NCDisposition"));
                ddlDisposition.Items.Insert(0, new RadComboBoxItem("", ""));
                ddlDisposition.SelectedIndex = 0;

                ddlStatus.Items.AddRange(WebSiteCommon.PopulateRadListItems("recordStatus"));

                SQMBasePage.FillCurrencyDDL(ddlCurrency, "EUR", false);
                ddlCurrency.Items.Insert(0, new RadComboBoxItem("", ""));

                List <PART_ATTRIBUTE> attributeList = SQMModelMgr.SelectPartAttributeList("TYPE", "", false);
                ddlPartType.Items.Add(new RadComboBoxItem("", ""));
                foreach (PART_ATTRIBUTE pat in attributeList)
                {
                    ddlPartType.Items.Add(new RadComboBoxItem(pat.ATTRIBUTE_VALUE, pat.ATTRIBUTE_CD));
                }
            }

            radIssueDate.Culture          = System.Threading.Thread.CurrentThread.CurrentUICulture;
            radIssueDate.MinDate          = new DateTime(2001, 1, 1);
            radIssueDate.MaxDate          = DateTime.UtcNow.AddDays(7);
            radIssueDate.SelectedDate     = WebSiteCommon.LocalTime(DateTime.UtcNow, SessionManager.UserContext.TimeZoneID);
            radIssueDate.ShowPopupOnFocus = true;

            uclPartSearch1.Initialize("", false, false, false, IssueCtl().qualityIssue.IssueOccur.QS_ACTIVITY);
        }
Exemple #2
0
        private void SetupPage()
        {
            PLANT        plant  = (PLANT)SessionManager.EffLocation.Plant;
            BUSINESS_ORG busOrg = (BUSINESS_ORG)SessionManager.EffLocation.BusinessOrg;

            isEditMode            = false;
            LocalOrg().EditObject = null;
            DropDownList ddl;

            HiddenField hdCurrentActiveTab = (HiddenField)this.Form.Parent.FindControl("form1").FindControl("ContentPlaceHolder1").FindControl("hdCurrentActiveSecondaryTab");

            uclItemHdr.DisplayPlant(busOrg, plant);

            List <BUSINESS_ORG> parent_orgs = SQMModelMgr.SelectBusOrgList(entities, SessionManager.EffLocation.Company.COMPANY_ID, 0, true);

            ddl                = (DropDownList)hfBase.FindControl("ddlParentBusOrg");
            ddl.DataSource     = parent_orgs;
            ddl.DataTextField  = "ORG_NAME";
            ddl.DataValueField = "BUS_ORG_ID";
            ddl.DataBind();
            ddl.SelectedIndex = 0;

            if (SessionManager.EffLocation != null && SessionManager.EffLocation.BusinessOrg != null && ddl.Items.FindByValue(SessionManager.EffLocation.BusinessOrg.BUS_ORG_ID.ToString()) != null)
            {
                ddl.SelectedValue = SessionManager.EffLocation.BusinessOrg.BUS_ORG_ID.ToString();
            }

            ddlLocationType.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("locationType"));

            ddlCountryCode.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("countryCode"));
            ddlCountryCode.Items.Insert(0, new ListItem("", ""));

            ddlPowerSourcedRegion.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("powerSourcedRegion"));
            ddlPowerSourcedRegion.Items.Insert(0, new ListItem("", ""));

            ddl = (DropDownList)hfBase.FindControl("ddlPlantCurrencyCodes");
            SQMBasePage.FillCurrencyDDL(ddl, "USD");

            ddl = (DropDownList)hfBase.FindControl("ddlPlantTimezone");
            List <Settings> time_zones = SQMSettings.TimeZone;

            ddl.DataSource     = time_zones;
            ddl.DataTextField  = "long_desc";
            ddl.DataValueField = "code";
            ddl.DataBind();
            ddl.SelectedValue = "035";

            ddlLocalLanguage.DataSource     = SQMModelMgr.SelectLanguageList(entities, true);
            ddlLocalLanguage.DataTextField  = "LANGUAGE_NAME";
            ddlLocalLanguage.DataValueField = "LANGUAGE_ID";
            ddlLocalLanguage.DataBind();
            ddlLocalLanguage.SelectedIndex = 0;

            SetStatusList("ddlPlantStatus", "A");

            tab_Click("lbPLantDetail_tab", "");
        }
Exemple #3
0
        private void DisplayBusOrg()
        {
            BUSINESS_ORG busOrg = (BUSINESS_ORG)SessionManager.EffLocation.BusinessOrg;

            DropDownList ddl = (DropDownList)hfBase.FindControl("ddlCurrencyCodes");

            if (ddl.Items.Count == 0)
            {
                SQMBasePage.FillCurrencyDDL(ddl, "USD");

                List <BUSINESS_ORG> parent_orgs = SQMModelMgr.SelectBusOrgList(entities, SessionManager.EffLocation.Company.COMPANY_ID, 0, true);
                ddl                = (DropDownList)hfBase.FindControl("ddlParentBusOrg");
                ddl.DataSource     = parent_orgs;
                ddl.DataTextField  = "ORG_NAME";
                ddl.DataValueField = "BUS_ORG_ID";
                ddl.DataBind();

                List <Settings> status_codes = SQMSettings.Status;
                ddl                = (DropDownList)hfBase.FindControl("ddlStatus");
                ddl.DataSource     = status_codes;
                ddl.DataTextField  = "short_desc";
                ddl.DataValueField = "code";
                ddl.DataBind();
            }

            if (busOrg != null)
            {
                if (busOrg.PARENT_BUS_ORG_ID == busOrg.BUS_ORG_ID || busOrg.PARENT_BUS_ORG_ID < 1)
                {
                    SetFindControlValue("lblParentBU_out", hfBase, "Top Level");
                }
                else
                {
                    if (SessionManager.ParentBusinessOrg == null)
                    {
                        SessionManager.ParentBusinessOrg = SQMModelMgr.LookupParentBusOrg(entities, busOrg);
                    }
                    BUSINESS_ORG parentOrg = (BUSINESS_ORG)SessionManager.ParentBusinessOrg;
                    SetFindControlValue("lblParentBU_out", hfBase, parentOrg.ORG_NAME);
                }

                // editable fields
                SetFindControlValue("tbOrgname", hfBase, busOrg.ORG_NAME);
                SetFindControlValue("tbOrgLocCode", hfBase, busOrg.DUNS_CODE);
                SetFindControlValue("ddlCurrencyCodes", hfBase, busOrg.PREFERRED_CURRENCY_CODE);
                SetFindControlValue("ddlStatus", hfBase, busOrg.STATUS);
                if (busOrg.PARENT_BUS_ORG_ID > 0)
                {
                    SetFindControlValue("ddlParentBusOrg", hfBase, busOrg.PARENT_BUS_ORG_ID.ToString());
                }
                SetFindControlValue("lblLastUpdate_out", hfBase, busOrg.LAST_UPD_BY);
                lblLastUpdateDate_out.Text = SQMBasePage.FormatDate(WebSiteCommon.LocalTime((DateTime)busOrg.LAST_UPD_DT, SessionManager.UserContext.TimeZoneID), "d", false);
            }
        }
Exemple #4
0
        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();
        }