private void SetupPage()
        {
            DropDownList ddl;


            if (ddlPlantList.Items.Count == 0)
            {
                List <BusinessLocation> locationList = SQMModelMgr.SelectBusinessLocationList(SessionManager.EffLocation.Company.COMPANY_ID, 0, false);

                SQMBasePage.SetLocationList(ddlPlantList, locationList, SessionManager.UserContext.HRLocation.Plant.PLANT_ID);
                ddlPlantList.Items.Insert(0, new RadComboBoxItem(Resources.LocalizedText.All, ""));

                ddlRoleList.DataSource     = SQMModelMgr.SelectPrivGroupList("", true);
                ddlRoleList.DataTextField  = "DESCRIPTION";
                ddlRoleList.DataValueField = "PRIV_GROUP";
                ddlRoleList.DataBind();
                ddlRoleList.ClearCheckedItems();

                ddl = (DropDownList)hfBase.FindControl("ddlPrefListSize");
                if (ddl != null)
                {
                    ddl.Items.AddRange(WebSiteCommon.PopulateDropDownListNums(1, 50, 10));
                }

                if (ddlJobCode.Items.Count == 0)
                {
                    ddlJobCode.Items.Insert(0, new RadComboBoxItem("", ""));
                    foreach (JOBCODE jc in SQMModelMgr.SelectJobcodeList("", "").OrderBy(j => j.JOB_DESC).ToList())
                    {
                        ddlJobCode.Items.Add(new RadComboBoxItem(SQMModelMgr.FormatJobcode(jc), jc.JOBCODE_CD));
                    }

                    ddlPrivGroup.Items.Insert(0, new RadComboBoxItem("", ""));
                    foreach (PRIVGROUP pg in SQMModelMgr.SelectPrivGroupList("", true).OrderBy(g => g.DESCRIPTION).ToList())
                    {
                        ddlPrivGroup.Items.Add(new RadComboBoxItem(SQMModelMgr.FormatPrivGroup(pg), pg.PRIV_GROUP));
                    }
                }

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

                ddlUserTimezone.DataSource     = SQMSettings.TimeZone;
                ddlUserTimezone.DataTextField  = "long_desc";
                ddlUserTimezone.DataValueField = "code";
                ddlUserTimezone.DataBind();
                ddlUserTimezone.SelectedValue = "035";


                ddlHRLocation.Items.Clear();
                ddlPlantSelect.Items.Clear();
                SQMBasePage.SetLocationList(ddlHRLocation, locationList, 0);
                ddlHRLocation.Items.Insert(0, new RadComboBoxItem("", ""));
                SQMBasePage.SetLocationList(ddlPlantSelect, locationList, 0);
            }
        }
Example #2
0
        private void SetupPage()
        {
            DropDownList ddl;

            ddl = (DropDownList)hfBase.FindControl("ddlPrefListSize");
            if (ddl != null)
            {
                ddl.Items.AddRange(WebSiteCommon.PopulateDropDownListNums(1, 50, 10));
            }
            ddlUserLanguage.DataSource     = SQMModelMgr.SelectLanguageList(entities, false);
            ddlUserLanguage.DataTextField  = "LANGUAGE_NAME";
            ddlUserLanguage.DataValueField = "LANGUAGE_ID";
            ddlUserLanguage.DataBind();
            ddlUserLanguage.SelectedIndex = 0;

            ddlUserTimezone.DataSource     = SQMSettings.TimeZone;
            ddlUserTimezone.DataTextField  = "long_desc";
            ddlUserTimezone.DataValueField = "code";
            ddlUserTimezone.DataBind();
            ddlUserTimezone.SelectedValue = "035";

            List <BusinessLocation> locationList = SQMModelMgr.SelectBusinessLocationList(SessionManager.EffLocation.Company.COMPANY_ID, 0, false);

            ddlHRLocation.Items.Clear();
            ddlPlantSelect.Items.Clear();
            SQMBasePage.SetLocationList(ddlHRLocation, locationList, 0);
            ddlHRLocation.Items.Insert(0, new RadComboBoxItem("", ""));
            SQMBasePage.SetLocationList(ddlPlantSelect, locationList, 0);

            if (ddlCustPlantSelect.Items.Count < 1)
            {
                List <BusinessLocation> customerLocations = SQMModelMgr.SelectBusinessLocationList(0, 0, false, true, true).OrderBy(l => l.Plant.PLANT_NAME).ToList();
                RadComboBoxItem         item = null;
                ddlCustPlantSelect.Items.Insert(0, new RadComboBoxItem("", ""));
                foreach (BusinessLocation cust in customerLocations.GroupBy(l => l.Plant.PLANT_ID).Select(l => l.FirstOrDefault()).ToList())
                {
                    item = new RadComboBoxItem(cust.Plant.PLANT_NAME, cust.Plant.PLANT_ID.ToString());
                    if (cust.Address != null)
                    {
                        item.ToolTip = cust.Address.STREET1 + " " + cust.Address.CITY;
                    }

                    ddlCustPlantSelect.Items.Add(item);
                }
            }
        }
Example #3
0
        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();
        }
Example #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();
        }
        protected void tab_Click(string tabID, string cmdArg)
        {
            if (tabID != null)
            {
                // setup for ps_admin.js to toggle the tab active/inactive display
                SetActiveTab(SessionManager.CurrentSecondaryTab = hfActiveTab.Value = tabID);

                pnlDetails.Visible = uclDocMgr.DocMgrPnl.Visible = pnlTargetList.Visible = pnlUomStd.Visible = pnlEscalation.Visible = pnlPrivGroups.Visible = false;
                COMPANY company = SQMModelMgr.LookupCompany(entities, SessionManager.EffLocation.Company.COMPANY_ID, "", false);

                switch (tabID)
                {
                case "lbCompanyDetail_tab":
                    pnlDetails.Visible = true;
                    if (ddlStatus.Items.FindByValue(company.STATUS) != null)
                    {
                        ddlStatus.SelectedValue = company.STATUS;
                    }
                    if (SessionManager.IsEffLocationPrimary() == true)
                    {
                        phUpdateCompany.Visible = false;
                        ddlStatus.Enabled       = false;
                    }
                    break;

                case "lbCompanyNotify_tab":
                    pnlEscalation.Visible = true;
                    UpdateNotifyActionList("");
                    break;

                case "lbUomStds_tab":
                    pnlUomStd.Visible = true;
                    BindStdUnits(SessionManager.EffLocation.Company);
                    break;

                case "lbCompanyTargets_tab":
                    pnlTargetList.Visible = true;
                    targetList            = ViewModel.SelectTargets(entities, company.COMPANY_ID, 0);
                    BindTargetList(targetList);
                    if (ddlEffYear.Items.Count == 0)
                    {
                        ddlEffYear.Items.AddRange(WebSiteCommon.PopulateDropDownListNums(2005, 15));
                        ddlTargetStatus.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("statusCodeDelete", "short"));
                        string[] targs = { "statScopeE", "statScopeHS", "statScopeQS" };
                        foreach (string scopelist in targs)
                        {
                            foreach (WebSiteCommon.SelectItem si in WebSiteCommon.PopulateListItems(scopelist))
                            {
                                if (string.IsNullOrEmpty(si.Value))
                                {
                                    RadComboBoxItem li = new RadComboBoxItem(si.Text, si.Text);
                                    li.IsSeparator = true;
                                    ddlTarget.Items.Add(li);
                                }
                                else
                                {
                                    ddlTarget.Items.Add(new RadComboBoxItem(si.Text, (si.Value + "|" + scopelist.Substring(9))));
                                }
                            }
                        }
                    }

                    break;

                case "lbPrivilegeGroups_tab":
                    pnlPrivGroups.Visible = true;
                    UpdatePrivGroupList("");
                    break;

                default:
                    if (SessionManager.IsEffLocationPrimary())
                    {
                        uclDocMgr.BindDocMgr("SYS", 0, 0);
                    }
                    break;
                }
            }
        }
Example #6
0
        private void SetupPage()
        {
            DropDownList ddl;

            ddl = (DropDownList)hfBase.FindControl("ddlPrefListSize");
            if (ddl != null)
            {
                ddl.Items.AddRange(WebSiteCommon.PopulateDropDownListNums(1, 50, 10));
            }

            if (ddlJobCode.Items.Count == 0)
            {
                ddlJobCode.Items.Insert(0, new RadComboBoxItem("", ""));
                foreach (JOBCODE jc in SQMModelMgr.SelectJobcodeList("", "").OrderBy(j => j.JOB_DESC).ToList())
                {
                    ddlJobCode.Items.Add(new RadComboBoxItem(SQMModelMgr.FormatJobcode(jc), jc.JOBCODE_CD));
                }

                ddlPrivGroup.Items.Insert(0, new RadComboBoxItem("", ""));
                foreach (PRIVGROUP pg in SQMModelMgr.SelectPrivGroupList("", true).OrderBy(g => g.DESCRIPTION).ToList())
                {
                    ddlPrivGroup.Items.Add(new RadComboBoxItem(SQMModelMgr.FormatPrivGroup(pg), pg.PRIV_GROUP));
                }
            }

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

            ddlUserTimezone.DataSource     = SQMSettings.TimeZone;
            ddlUserTimezone.DataTextField  = "long_desc";
            ddlUserTimezone.DataValueField = "code";
            ddlUserTimezone.DataBind();
            ddlUserTimezone.SelectedValue = "035";

            List <BusinessLocation> locationList = SQMModelMgr.SelectBusinessLocationList(SessionManager.EffLocation.Company.COMPANY_ID, 0, false);

            ddlHRLocation.Items.Clear();
            ddlPlantSelect.Items.Clear();
            SQMBasePage.SetLocationList(ddlHRLocation, locationList, 0);
            ddlHRLocation.Items.Insert(0, new RadComboBoxItem("", ""));
            SQMBasePage.SetLocationList(ddlPlantSelect, locationList, 0);

            /* quality module reference
             * if (ddlCustPlantSelect.Items.Count < 1)
             * {
             *      List<BusinessLocation> customerLocations = SQMModelMgr.SelectBusinessLocationList(0, 0, false, true, true).OrderBy(l => l.Plant.PLANT_NAME).ToList();
             *      RadComboBoxItem item = null;
             *      ddlCustPlantSelect.Items.Insert(0, new RadComboBoxItem("", ""));
             *      foreach (BusinessLocation cust in customerLocations.GroupBy(l => l.Plant.PLANT_ID).Select(l => l.FirstOrDefault()).ToList())
             *      {
             *              item = new RadComboBoxItem(cust.Plant.PLANT_NAME, cust.Plant.PLANT_ID.ToString());
             *              if (cust.Address != null)
             *                      item.ToolTip = cust.Address.STREET1 + " " + cust.Address.CITY;
             *
             *              ddlCustPlantSelect.Items.Add(item);
             *      }
             * }
             */
        }