private void OnPartSelect(string partID) { PART part = SQMModelMgr.LookupPart(new PSsqmEntities(), Convert.ToDecimal(partID), "", SessionManager.PrimaryCompany().COMPANY_ID, false); if (part != null) { IssueCtl().qualityIssue.IssueOccur.PART_ID = part.PART_ID; PartData partData = SQMModelMgr.LookupPartData(new PSsqmEntities(), SessionManager.PrimaryCompany().COMPANY_ID, part.PART_ID); partData.Locations(); IssueCtl().qualityIssue.AddPartInfo(partData); lblPartDesc.Text = part.PART_NAME; ddlResponsibleLocation.Items.Clear(); ddlResponsibleLocation.Items.Add(new RadComboBoxItem(IssueCtl().qualityIssue.DetectedLocation.Company.COMPANY_NAME + ", " + IssueCtl().qualityIssue.DetectedLocation.Plant.PLANT_NAME, IssueCtl().qualityIssue.DetectedLocation.Plant.PLANT_ID.ToString())); if (IssueCtl().qualityIssue.Partdata.B2BList != null) { foreach (BusinessLocation location in IssueCtl().qualityIssue.Partdata.B2BList) { if (ddlResponsibleLocation.Items.FindItemByValue(location.Plant.PLANT_ID.ToString()) == null) { ddlResponsibleLocation.Items.Add(new RadComboBoxItem(location.Company.COMPANY_NAME + ", " + location.Plant.PLANT_NAME, location.Plant.PLANT_ID.ToString())); } } if (IssueCtl().qualityIssue.Incident.RESP_PLANT_ID.HasValue) { ddlResponsibleLocation.SelectedValue = IssueCtl().qualityIssue.Incident.RESP_PLANT_ID.ToString(); } else if (ddlResponsibleLocation.Items.Count > 0) { ddlResponsibleLocation.SelectedIndex = 0; } GetResponsibleList(); } updResponsible.Update(); } }