protected void SelectActivityType(object sender, EventArgs e) { RadComboBoxItem item = null; switch (ddlIncidentType.SelectedValue) { case "CST": ddlReportedLocation.Items.Clear(); ddlReportedLocation.Items.Add(new RadComboBoxItem(SessionManager.UserContext.HRLocation.Company.COMPANY_NAME + ", " + SessionManager.UserContext.HRLocation.Plant.PLANT_NAME, SessionManager.UserContext.HRLocation.Plant.PLANT_ID.ToString())); List <BusinessLocation> custLocations = SQMModelMgr.UserAccessibleLocations(SessionManager.UserContext.Person, SQMModelMgr.SelectBusinessLocationList(0, 0, false, true, true), false, true, ddlIncidentType.SelectedValue); foreach (BusinessLocation loc in custLocations) { ddlReportedLocation.Items.Add(SQMBasePage.SetLocationItem(loc, true)); } break; case "RCV": ddlReportedLocation.Items.Clear(); List <BusinessLocation> locationList = UserContext.FilterPlantAccessList(SQMModelMgr.SelectBusinessLocationList(SessionManager.PrimaryCompany().COMPANY_ID, 0, true)); SQMBasePage.SetLocationList(ddlReportedLocation, locationList, 0); break; default: ddlReportedLocation.Items.Clear(); ddlReportedLocation.Items.Add(new RadComboBoxItem(SessionManager.UserContext.WorkingLocation.Company.COMPANY_NAME + ", " + SessionManager.UserContext.WorkingLocation.Plant.PLANT_NAME, SessionManager.UserContext.WorkingLocation.Plant.PLANT_ID.ToString())); if (SessionManager.UserContext.WorkingLocation.Plant.PLANT_ID != SessionManager.UserContext.HRLocation.Plant.PLANT_ID) { ddlReportedLocation.Items.Add(new RadComboBoxItem(SessionManager.UserContext.HRLocation.Company.COMPANY_NAME + ", " + SessionManager.UserContext.HRLocation.Plant.PLANT_NAME, SessionManager.UserContext.HRLocation.Plant.PLANT_ID.ToString())); } break; } }
protected void DisplayIssue() { SetupPage(); if (ddlIncidentType.Items.FindItemByValue(IssueCtl().qualityIssue.IssueOccur.QS_ACTIVITY) != null) { SQMBasePage.DisplayControlValue(ddlIncidentType, IssueCtl().qualityIssue.IssueOccur.QS_ACTIVITY, PageUseMode.ViewOnly, ""); SelectActivityType(null, null); trQIActivity.Visible = false; switch (IssueCtl().qualityIssue.IssueOccur.QS_ACTIVITY) { case "CST": trPartType.Visible = true; ph8DRef.Visible = true; // external problem control system reference number trReceipt.Visible = false; break; case "RCV": trPartType.Visible = false; ph8DRef.Visible = false; trReceipt.Visible = true; // reference receipt or po number break; default: trPartType.Visible = false; ph8DRef.Visible = false; trReceipt.Visible = false; break; } } tbTotalEstNCQty.ReadOnly = true; QI_OCCUR_NC sample = IssueCtl().qualityIssue.IssueOccur.QI_OCCUR_ITEM.First().QI_OCCUR_NC.FirstOrDefault(); if (sample != null) { if (IssueCtl().qualityIssue.IssueOccur.QI_OCCUR_ITEM.First().QI_OCCUR_NC.First().NONCONF_ID.HasValue) { uclNC.Initialize(IssueCtl().qualityIssue.IssueOccur.QI_OCCUR_ITEM.First().QI_OCCUR_NC.First().PROBLEM_AREA, (decimal)IssueCtl().qualityIssue.IssueOccur.QI_OCCUR_ITEM.First().QI_OCCUR_NC.First().NONCONF_ID, (int)IssueCtl().qualityIssue.IssueOccur.QI_OCCUR_ITEM.First().QI_OCCUR_NC.First().PROBLEM_COUNT, IssueCtl().PageMode); } else { uclNC.Initialize("", 0, 0, IssueCtl().PageMode); } gvMeasureGrid.DataSource = sample.QI_OCCUR_MEASURE; gvMeasureGrid.DataBind(); } SetB2BLocation(Convert.ToDecimal(IssueCtl().qualityIssue.DetectedLocation.Plant.PLANT_ID.ToString())); if (ddlReportedLocation.Items.FindItemByValue(IssueCtl().qualityIssue.DetectedLocation.Plant.PLANT_ID.ToString()) != null) { SQMBasePage.DisplayControlValue(ddlReportedLocation, IssueCtl().qualityIssue.DetectedLocation.Plant.PLANT_ID.ToString(), IssueCtl().PageMode, "textStd"); } else { // add the reported location in case the viewing user doesn't have it assigned to him BusinessLocation reportLoc = new BusinessLocation().Initialize(IssueCtl().qualityIssue.DetectedLocation.Plant.PLANT_ID); if (reportLoc != null) { ddlReportedLocation.Items.Add(SQMBasePage.SetLocationItem(reportLoc, true)); SQMBasePage.DisplayControlValue(ddlReportedLocation, IssueCtl().qualityIssue.DetectedLocation.Plant.PLANT_ID.ToString(), IssueCtl().PageMode, "textStd"); } } ddlResponsibleLocation.Items.Clear(); if (IssueCtl().qualityIssue.Partdata.B2BList != null) { foreach (BusinessLocation loc in IssueCtl().qualityIssue.Partdata.B2BList) { ddlResponsibleLocation.Items.Add(SQMBasePage.SetLocationItem(loc, true)); } // ddlResponsibleLocation.SelectedValue = qualityIssue.Incident.RESP_PLANT_ID.ToString(); SQMBasePage.DisplayControlValue(ddlResponsibleLocation, IssueCtl().qualityIssue.Incident.RESP_PLANT_ID.ToString(), IssueCtl().PageMode, "textStd"); } if (IssueCtl().qualityIssue.Partdata != null && IssueCtl().qualityIssue.Partdata.Part != null) { SQMBasePage.DisplayControlValue(uclPartSearch1.PartTextBox, IssueCtl().qualityIssue.Partdata.PartDisplayNum(IssueCtl().qualityIssue.IssueOccur.QS_ACTIVITY), IssueCtl().PageMode, "textStd"); lblPartDesc.Text = IssueCtl().qualityIssue.Partdata.Part.PART_NAME; SQMBasePage.DisplayControlValue(tbRelatedParts, IssueCtl().qualityIssue.IssueOccur.RELATED_PARTS, IssueCtl().PageMode, "textStd"); } ddlDisposition.SelectedIndex = ddlStatus.SelectedIndex = 0; if (IssueCtl().qualityIssue.IsNew) { cbNotify.Checked = true; cbNotify.Enabled = false; ddlResponseTime.SelectedIndex = 1; } else { cbNotify.Checked = false; cbNotify.Enabled = true; lblIssueDate_out.Text = SQMBasePage.FormatDate(WebSiteCommon.LocalTime((DateTime)IssueCtl().qualityIssue.Incident.CREATE_DT, SessionManager.UserContext.TimeZoneID), "d", false); SQMBasePage.DisplayControlValue(radIssueDate, IssueCtl().qualityIssue.Incident.INCIDENT_DT.ToShortDateString(), IssueCtl().PageMode, "textStd"); SQMBasePage.DisplayControlValue(tbIssueDesc, IssueCtl().qualityIssue.Incident.DESCRIPTION, IssueCtl().PageMode, "textStd"); lblOriginator_out.Text = IssueCtl().qualityIssue.Incident.CREATE_BY; SQMBasePage.DisplayControlValue(ddlIncidentSeverity2, IssueCtl().qualityIssue.IssueOccur.SEVERITY, IssueCtl().PageMode, "textStd"); SQMBasePage.DisplayControlValue(tbReceipt, IssueCtl().qualityIssue.IssueOccur.QS_ACTIVITY == "RCV" ? IssueCtl().qualityIssue.IssueOccur.REF_OPERATION : "", IssueCtl().PageMode, "textStd"); if (ddlPartType.Items.FindItemByValue(IssueCtl().qualityIssue.IssueOccur.PART_TYPE) != null) { SQMBasePage.DisplayControlValue(ddlPartType, IssueCtl().qualityIssue.IssueOccur.PART_TYPE, IssueCtl().PageMode, "textStd"); } SQMBasePage.DisplayControlValue(tbNCLotNum, IssueCtl().qualityIssue.IssueOccur.QI_OCCUR_ITEM.First().LOT_NUM, IssueCtl().PageMode, "textStd"); try { SQMBasePage.DisplayControlValue(tbNCTotalQty, IssueCtl().qualityIssue.IssueOccur.QI_OCCUR_ITEM.First().TOTAL_QTY.ToString(), IssueCtl().PageMode, "textStd"); SQMBasePage.DisplayControlValue(tbNCSampleQty, IssueCtl().qualityIssue.IssueOccur.QI_OCCUR_ITEM.First().INSPECT_QTY.ToString(), IssueCtl().PageMode, "textStd"); SQMBasePage.DisplayControlValue(tbNCNonConformQty, IssueCtl().qualityIssue.IssueOccur.QI_OCCUR_ITEM.First().INSPECT_NC_QTY.ToString(), IssueCtl().PageMode, "textStd"); SQMBasePage.DisplayControlValue(tbTotalEstNCQty, Math.Round((decimal)IssueCtl().qualityIssue.IssueOccur.QI_OCCUR_ITEM.First().TOTAL_NC_QTY, 1).ToString(), IssueCtl().PageMode, "labelEmphasis"); lnkCalculateNC.Visible = IssueCtl().PageMode == PageUseMode.EditEnabled ? true : false; lblCalculateNC.Visible = IssueCtl().PageMode == PageUseMode.EditEnabled ? false : true; } catch { tbNCTotalQty.Text = tbNCSampleQty.Text = tbNCNonConformQty.Text = tbTotalEstNCQty.Text = ""; } SQMBasePage.DisplayControlValue(tbObservations, IssueCtl().qualityIssue.IssueOccur.QI_OCCUR_ITEM.First().QI_OCCUR_NC.First().SAMPLE_COMMENTS, IssueCtl().PageMode, "textStd"); cb8DRequired.Checked = (bool)(IssueCtl().qualityIssue.IssueOccur.PROBCASE_REQD.HasValue == true ? IssueCtl().qualityIssue.IssueOccur.PROBCASE_REQD : false); if (IssueCtl().PageMode != PageUseMode.EditEnabled) { cb8DRequired.Enabled = phNotify.Visible = false; } SQMBasePage.DisplayControlValue(tb8DRef, IssueCtl().qualityIssue.IssueOccur.QS_ACTIVITY == "CST" && !string.IsNullOrEmpty(IssueCtl().qualityIssue.IssueOccur.REF_OPERATION) ? IssueCtl().qualityIssue.IssueOccur.REF_OPERATION : "", IssueCtl().PageMode, "refText"); SQMBasePage.DisplayControlValue(ddlDisposition, IssueCtl().qualityIssue.IssueOccur.DISPOSITION, IssueCtl().PageMode, "textStd"); if (IssueCtl().PageMode == PageUseMode.Active) { if (ddlStatus.Items.FindItemByValue(IssueCtl().qualityIssue.IssueOccur.STATUS) != null) { ddlStatus.SelectedValue = IssueCtl().qualityIssue.IssueOccur.STATUS; } } else { SQMBasePage.DisplayControlValue(ddlStatus, IssueCtl().qualityIssue.IssueOccur.STATUS, IssueCtl().PageMode, "textStd"); } if (ddlCurrency.Items.FindItemByValue(IssueCtl().qualityIssue.IssueOccur.CURRENCY_CODE) != null) { SQMBasePage.DisplayControlValue(ddlCurrency, IssueCtl().qualityIssue.IssueOccur.CURRENCY_CODE, IssueCtl().PageMode, "textStd"); } SQMBasePage.DisplayControlValue(tbActCost, IssueCtl().qualityIssue.IssueOccur.EST_ACT_COST.HasValue ? SQMBasePage.FormatValue((decimal)IssueCtl().qualityIssue.IssueOccur.EST_ACT_COST, 2) : "", IssueCtl().PageMode, "textStd"); SQMBasePage.DisplayControlValue(tbActCostNote, IssueCtl().qualityIssue.IssueOccur.ACT_COST_COMMENT, IssueCtl().PageMode, "textStd"); SQMBasePage.DisplayControlValue(tbPotCost, IssueCtl().qualityIssue.IssueOccur.EST_POT_COST.HasValue ? SQMBasePage.FormatValue((decimal)IssueCtl().qualityIssue.IssueOccur.EST_POT_COST, 2) : "", IssueCtl().PageMode, "textStd"); SQMBasePage.DisplayControlValue(tbPotCostNote, IssueCtl().qualityIssue.IssueOccur.POT_COST_COMMENT, IssueCtl().PageMode, "textStd"); if (IssueCtl().PageMode == PageUseMode.EditEnabled) { uclRadAttach.SetReportOption(false); uclRadAttach.GetUploadedFiles(20, IssueCtl().qualityIssue.Incident.INCIDENT_ID, "1"); } else { Ucl_Attach attch = (Ucl_Attach)Page.LoadControl("/Include/Ucl_Attach.ascx"); uclRadAttach.Parent.Controls.AddAt(uclRadAttach.Parent.Controls.IndexOf(uclRadAttach), attch); attch.BindDisplayAttachments(20, IssueCtl().qualityIssue.Incident.INCIDENT_ID, "1", 0); uclRadAttach.Visible = false; } btnDupIncident.Visible = IssueCtl().PageMode == PageUseMode.EditEnabled ? true : false; //uclQISearch1.Load(false); if (!string.IsNullOrEmpty(IssueCtl().qualityIssue.IssueOccur.RELATED_INCIDENTS)) { QualityIssue refIssue = new QualityIssue().Load(Convert.ToDecimal(IssueCtl().qualityIssue.IssueOccur.RELATED_INCIDENTS)); if (refIssue != null) { tbDupIssue.Text = IssueCtl().qualityIssue.IssueOccur.RELATED_INCIDENTS + " - " + refIssue.Incident.DESCRIPTION; } } else { tbDupIssue.Text = ""; } // determine selectable list of responsible persons based on the trading partner locations GetResponsibleList(); if (ddlResponseTime.Items.FindItemByValue(IssueCtl().qualityIssue.IssueOccur.INIT_ACTION) != null) { SQMBasePage.DisplayControlValue(ddlResponseTime, IssueCtl().qualityIssue.IssueOccur.INIT_ACTION, IssueCtl().PageMode, "textStd"); } // update the ddl based per selected persons in the task list foreach (TASK_STATUS task in IssueCtl().qualityIssue.TeamTask.TaskList) { RadComboBoxItem resp = null; if ((resp = ddlResponsible.FindItemByValue(task.RESPONSIBLE_ID.ToString())) != null) { resp.Checked = true; } } if (IssueCtl().PageMode != PageUseMode.EditEnabled) { SQMBasePage.DisplayControlValue(ddlResponsible, "", IssueCtl().PageMode, "textSTd"); } // btnPrintLabel.OnClientClick = "Popup('../Quality/QualityIssue_Label.aspx?issue=" + qualityIssue.IssueOccur.INCIDENT_ID.ToString() + "', 'newPage', 600, 450); return false;"; } uclResponse.BindResponseList(IssueCtl().qualityIssue.TeamResponse.ResponseList, IssueCtl().PageMode == PageUseMode.EditEnabled || IssueCtl().PageMode == PageUseMode.EditPartial ? true : false, true); lblIssueResponseCount.Text = IssueCtl().qualityIssue.TeamResponse.ResponseList.Count.ToString(); phResponseAlert.Visible = IssueCtl().PageMode == PageUseMode.EditEnabled ? true : false; }