Пример #1
0
        public void gvMeasure_OnRowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
        {
            if ((!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Header.ToString())) & (!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Footer.ToString())))
            {
                try
                {
                    HiddenField  hf  = (HiddenField)e.Row.Cells[0].FindControl("hfMeasureType");
                    DropDownList ddl = (DropDownList)e.Row.Cells[0].FindControl("ddlMeasureType");
                    ddl.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("measureType"));
                    if (!String.IsNullOrEmpty(hf.Value))
                    {
                        ddl.SelectedValue = hf.Value;
                    }

                    hf = (HiddenField)e.Row.Cells[0].FindControl("hfMeasureClass");
                    if (hf.Value == "SPC")
                    {
                        Image img = (Image)e.Row.Cells[0].FindControl("imgMeasureClass");
                        img.ImageUrl = "~/images/class_01.gif";
                        hf           = (HiddenField)e.Row.Cells[0].FindControl("hfMeasureInstructions");
                        img.ToolTip  = hf.Value;
                    }
                }
                catch
                {
                }
            }
        }
 private void SetupPage()
 {
     if (ddlCRType.Items.Count == 0)
     {
         ddlCRType.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("issueResponsible"));
     }
 }
Пример #3
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", "");
        }
        private void SetupPage()
        {
            ddlFormType.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("COAForm", "long"));

            if (coaReport.BusOrg != null)
            {
                SetFindControlValue("lblParentBU_out", hfBase, coaReport.BusOrg.ORG_NAME);
                ddlPlant.DataSource     = coaReport.PlantList;
                ddlPlant.DataTextField  = "PLANT_NAME";
                ddlPlant.DataValueField = "PLANT_ID";
                ddlPlant.DataBind();
                ddlPlant.Items.Insert(0, new ListItem("", "0"));
            }

            if (coaReport.Part == null)
            {
                pnlPartDetail.Visible = pnlPartBOM.Visible = pnlCtlResult.Visible = false;
            }
            else
            {
                tbPartNumber.Text     = coaReport.Part.PART_NUM;
                pnlPartDetail.Visible = pnlPartBOM.Visible = pnlCtlResult.Visible = true;
                SetFindControlValue("lblPartNum_out", hfBase, coaReport.Part.PART_NUM);
                SetFindControlValue("lblPartNumFull_out", hfBase, SQMModelMgr.GetFullPartNumber(coaReport.Part));
                SetFindControlValue("lblPartName_out", hfBase, coaReport.Part.PART_NAME);
                SetFindControlValue("lblPartSerial_out", hfBase, coaReport.Part.SERIAL_NUM);
                SetFindControlValue("lblDrawing_out", hfBase, coaReport.Part.DRAWING_REF);
                SetFindControlValue("lblPartRevisionLevel_out", hfBase, coaReport.Part.REVISION_LEVEL);
                SetFindControlValue("lblPartStatus_out", hfBase, WebSiteCommon.GetStatusString(coaReport.Part.STATUS));

                GridView gv = (GridView)hfBase.FindControl("gvPartAssyList");
                gv.DataSource = coaReport.Part.PART_COMPONENT;
                gv.DataBind();
                gv.Columns[5].Visible = true;
                gv.Columns[4].Visible = false;
                SetGridViewDisplay(gv, (Label)hfBase.FindControl("lblPartAssyListEmpty"), (System.Web.UI.HtmlControls.HtmlGenericControl)hfBase.FindControl("divGVScrollBOM2"), 0);

                GridView gv2 = (GridView)hfBase.FindControl("gvPartProcList");
                gv2.DataSource = coaReport.Part.PART_PROCESS;
                gv2.DataBind();
                gv2.Columns[4].Visible = true;
                SetGridViewDisplay(gv2, (Label)hfBase.FindControl("lblPartProcListEmpty"), (System.Web.UI.HtmlControls.HtmlGenericControl)hfBase.FindControl("divGVScrollBOM1"), 0);

                DoCtlPlanSteps();
            }
        }
        private void SetupPage()
        {
            if (ddlMeasureStatus.Items.Count == 0)
            {
                ddlMeasureStatus.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("statusCode", "short"));
            }

            if (ddlMeasureCategory.Items.Count == 0)
            {
                ddlMeasureCategory.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("measureCategory"));
                ddlMeasureCategory.SelectedIndex = 0;
            }

            if (ddlMeasureSubcategory.Items.Count == 0)
            {
                ddlMeasureSubcategory.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("measureSubCategory"));
                ddlMeasureSubcategory.SelectedIndex = 0;
            }

            if (ddlMeasureCurrency.Items.Count == 0)
            {
                ddlMeasureCurrency.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("currencyCode"));
                ddlMeasureCurrency.SelectedIndex = 0;
            }

            if (ddlMeasureUOM.Items.Count == 0)
            {
                if (ddlUOMCategory.Items.Count == 0)
                {
                    ddlUOMCategory.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("UOMCategory"));
                }
                ddlUOMCategory.SelectedIndex = 0;

                DropDownList ddlRef = (DropDownList)hfBase.FindControl("ddlMeasureUOM_ref");
                ddlRef.Items.Clear();
                ddlRef.Items.Insert(0, new ListItem("--select--"));
                foreach (UOM uom in SessionManager.UOMList)
                {
                    ddlRef.Items.Add(new ListItem(uom.UOM_NAME, (uom.UOM_CATEGORY + "|" + uom.UOM_ID.ToString())));
                }
            }

            measureList = SQMResourcesMgr.SelectEHSMeasureList(ddlMeasureCategory.SelectedValue, false);
            BindMeasureList(measureList);
        }
        private void SetupPage()
        {
            ddlVarChart.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("chartTypeVAR"));
            ddlAttChart.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("chartTypeATT"));

            ddlVarChart.SelectedValue = "XBR";
            ddlAttChart.SelectedValue = "C";

            tbTest01.Text = tbTest11.Text = tbTest21.Text = "1";
            tbTest13.Text = tbTest23.Text = "7";
            tbTest14.Text = tbTest24.Text = "2"; tbTest14P.Text = tbTest24P.Text = "3";
            tbTest15.Text = tbTest25.Text = "4"; tbTest15P.Text = tbTest25P.Text = "5";
            tbTest16.Text = tbTest26.Text = "8"; tbTest16P.Text = tbTest26P.Text = "8";
            tbTest17.Text = tbTest27.Text = "8";
            tbTest18.Text = tbTest28.Text = "14";
            tbTest19.Text = tbTest29.Text = "15";

            cbTest01.Checked = cbTest11.Checked = cbTest13.Checked = cbTest14.Checked = cbTest15.Checked = cbTest16.Checked = true;
            cbTest21.Checked = cbTest23.Checked = cbTest24.Checked = cbTest25.Checked = cbTest26.Checked = true;
        }
        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);
        }
        protected void Page_PreRender(object sender, EventArgs e)
        {
            lbUpload.Attributes.Add("onmouseup", "ShowModalDialog();");
            if (ddlDisplayType.Items.Count == 0)
            {
                ddlDisplayType.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("docDisplayType"));
                foreach (ListItem item in ddlDisplayType.Items)
                {
                    switch (SessionManager.DocumentContext.Scope)
                    {
                    case "USR":
                    case "BLI":
                        if (item.Value != "15")
                        {
                            item.Enabled = false;
                        }
                        break;

                    case "EHS":
                    case "SQM":
                        if (item.Value != "2" && item.Value != "10")
                        {
                            item.Enabled = false;
                        }
                        break;

                    case "SYS":
                        if (item.Value != "10" && item.Value != "31" && item.Value != "32")
                        {
                            item.Enabled = false;
                        }
                        break;

                    default:
                        break;
                    }
                }
            }
        }
        private void SetupPage()
        {
            switch (SessionManager.CurrentSecondaryTab)
            {
            case "lbQSNonConf_tab":
                if (ddlNonconfStatus.Items.Count == 0)
                {
                    ddlNonconfStatus.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("statusCode", "short"));
                }
                if (ddlProblemArea.Items.Count == 0)
                {
                    ddlProblemArea.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("problemArea"));
                    ddlProblemArea.SelectedIndex = 0;
                }
                BindCategoryList();
                nonconfList = SQMResourcesMgr.SelectNonconfList(ddlProblemArea.SelectedValue, false);
                BindNonconfList(nonconfList);
                break;

            default:
                break;
            }
        }
Пример #10
0
 public void gvMethod_OnRowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
 {
     if ((!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Header.ToString())) & (!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Footer.ToString())))
     {
         try
         {
             HiddenField  hf  = (HiddenField)e.Row.Cells[0].FindControl("hfSpecType");
             DropDownList ddl = (DropDownList)e.Row.Cells[0].FindControl("ddlSpecType");
             ddl.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("specType"));
             if (!String.IsNullOrEmpty(hf.Value))
             {
                 ddl.SelectedValue = hf.Value;
             }
             TextBox tb = (TextBox)e.Row.Cells[0].FindControl("tbSpecValues");
             hf       = (HiddenField)e.Row.Cells[0].FindControl("hfSpecLSL");
             tb.Text  = hf.Value;
             hf       = (HiddenField)e.Row.Cells[0].FindControl("hfSpecUSL");
             tb.Text += (" / " + hf.Value);
         }
         catch
         {
         }
     }
 }
Пример #11
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();
        }
Пример #12
0
        public void gvCtlPlan_OnRowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
        {
            if ((!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Header.ToString())) & (!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Footer.ToString())))
            {
                try
                {
                    HiddenField  hf  = (HiddenField)e.Row.Cells[0].FindControl("hfSampleRate");
                    DropDownList ddl = (DropDownList)e.Row.Cells[0].FindControl("ddlSampleRate");
                    ddl.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("sampleRate"));
                    if (!String.IsNullOrEmpty(hf.Value))
                    {
                        ddl.SelectedValue = hf.Value;
                    }

                    hf  = (HiddenField)e.Row.Cells[0].FindControl("hfSampleUnit");
                    ddl = (DropDownList)e.Row.Cells[0].FindControl("ddlSampleUnit");
                    ddl.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("sampleUnit"));
                    if (!String.IsNullOrEmpty(hf.Value))
                    {
                        ddl.SelectedValue = hf.Value;
                    }

                    Label lbl;
                    hf = (HiddenField)e.Row.Cells[0].FindControl("hfStepInstructions");
                    Image img = (Image)e.Row.Cells[0].FindControl("imgStepType");
                    img.ToolTip = hf.Value;

                    hf = (HiddenField)e.Row.Cells[0].FindControl("hfPlanStepLocation");
                    if (!string.IsNullOrEmpty(hf.Value))
                    {
                        decimal plantID = Convert.ToDecimal(hf.Value);
                        PLANT   plant   = SQMModelMgr.LookupPlant(entities, plantID, "");
                        if (plant != null)
                        {
                            img = (Image)e.Row.Cells[0].FindControl("imgPlanStepLocation");
                            if (plant.COMPANY_ID == SessionManager.SessionContext.ActiveCompany().COMPANY_ID)
                            {
                                img.ImageUrl = "~/images/icon_customer2.gif";
                                img.ToolTip  = "";   // mt - todo: remove constant
                            }
                            else
                            {
                                img.ImageUrl = "~/images/icon_supplier2.gif";
                                img.ToolTip  = "Supplier";   // mt - todo: remove constant
                            }
                        }
                    }

                    lbl      = (Label)e.Row.Cells[0].FindControl("lblSampleUnit_out");
                    lbl.Text = WebSiteCommon.GetXlatValueLong("sampleUnit", lbl.Text);
                    lbl      = (Label)e.Row.Cells[0].FindControl("lblSampleRate_out");
                    lbl.Text = WebSiteCommon.GetXlatValueLong("sampleRate", lbl.Text);

                    lbl = (Label)e.Row.Cells[0].FindControl("lblPlanStepID");
                    GridView      gv   = (GridView)e.Row.Cells[0].FindControl("gvMeasureGrid");
                    CTL_PLAN_STEP step = ctlPlanMgr.CtlPlan.CTL_PLAN_STEP.First(s => s.CTLPLANSTEP_ID == Convert.ToInt32(lbl.Text));
                    gv.DataSource = step.CTL_PLAN_MEASURE;
                    gv.DataBind();
                    gv            = (GridView)e.Row.Cells[0].FindControl("gvMethodGrid");
                    gv.DataSource = step.CTL_PLAN_MEASURE;
                    gv.DataBind();
                }
                catch
                {
                }
            }
        }
Пример #13
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;
                }
            }
        }
Пример #15
0
        private void SetupPage()
        {
            COMPANY company = SQMModelMgr.LookupCompany(entities, SessionManager.SessionContext.ActiveCompany().COMPANY_ID, "", false);

            divPageBody.Visible = true;

            if (NCList == null || NCList.Count == 0)
            {
                NCList    = SQMModelMgr.SelectCompanyNCList(company.COMPANY_ID, SessionManager.UserContext.BusinessOrg.BUS_ORG_ID, true);
                plantList = SQMModelMgr.SelectPlantList(entities, company.COMPANY_ID, SessionManager.UserContext.BusinessOrg.BUS_ORG_ID);
                lineList  = new List <PLANT_LINE>();
                foreach (PLANT plant in plantList)
                {
                    plant.PLANT_LINE.Load();
                    foreach (PLANT_LINE line in plant.PLANT_LINE)
                    {
                        lineList.Add(line);
                    }
                }
                custList = SQMModelMgr.SelectCustomerPlantPartList(entities, SessionManager.SessionContext.ActiveCompany().COMPANY_ID, 0, 0);
            }

            if (ddlQualityIssueType.Items.Count == 0)
            {
                ddlDisposition.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("NCDisposition"));

                ddlQualityIssueType.DataSource     = NCList.GroupBy(l => l.ProblemTypeID).Select(l => l.First());
                ddlQualityIssueType.DataTextField  = "ProblemType";
                ddlQualityIssueType.DataValueField = "ProblemTypeID";
                ddlQualityIssueType.DataBind();
            }

            ddlPlant.DataSource     = plantList;
            ddlPlant.DataTextField  = "PLANT_NAME";
            ddlPlant.DataValueField = "PLANT_ID";
            ddlPlant.DataBind();
            ddlPlant.Items.Insert(0, new ListItem("", "0"));

            ddlPlantLine.DataSource     = lineList;
            ddlPlantLine.DataTextField  = "PLANT_LINE_NAME";
            ddlPlantLine.DataValueField = "PLANT_LINE_ID";
            ddlPlantLine.DataBind();
            ddlPlantLine.Items.Insert(0, new ListItem("", "0"));

            ddlCustomer.DataSource     = custList.GroupBy(l => l.CUST_COMPANY_ID).Select(l => l.First());
            ddlCustomer.DataTextField  = "CUST_COMPANY_NAME";
            ddlCustomer.DataValueField = "CUST_COMPANY_ID";
            ddlCustomer.DataBind();
            ddlCustomer.Items.Insert(0, new ListItem("", "0"));

            ddlCustomerPlant.DataSource     = custList.GroupBy(l => l.CUST_COMPANY_ID).Select(l => l.First());
            ddlCustomerPlant.DataTextField  = "CUST_PLANT_NAME";
            ddlCustomerPlant.DataValueField = "CUSTOMER_PLANT_ID";
            ddlCustomerPlant.DataBind();
            ddlCustomerPlant.Items.Insert(0, new ListItem("", "0"));

            if (qualityIssue.IsNew)
            {
                uclSearchBar.TitleItem.Visible = false;
                lblIssueDate_out.Text          = WebSiteCommon.LocalTime(DateTime.Now, SessionManager.UserContext.TimeZoneID).ToString();
                lblOriginator_out.Text         = (SessionManager.UserContext.UserName() + "  (" + SessionManager.UserContext.BusinessOrg.ORG_NAME + ")");
            }

            //if (qualityIssue.Part != null && qualityIssue.Part.PART_ID > 0)
            // uclSearchBar.SetButtonsEnabled(true, true, true, false, false, false);

            DisplayIssue();

            isEditMode = true;
        }