private void GetResponsibleList()
 {
     ddlResponseTime.Items.AddRange(WebSiteCommon.PopulateComboBoxListNums(1, 14, ddlResponseTime.EmptyMessage));
     if (!string.IsNullOrEmpty(ddlResponsibleLocation.SelectedValue))
     {
         IssueCtl().qualityIssue.SetResponsibleLocation(Convert.ToDecimal(ddlResponsibleLocation.SelectedValue));
         List <BusinessLocation> locationList = new List <BusinessLocation>();
         // locationList.Add(qualityIssue.DetectedLocation);
         locationList.Add(IssueCtl().qualityIssue.ResponsibleLocation);
         // td: fetch the supplier persons responsible
         List <PERSON> respList = SQMModelMgr.SelectPlantPersonList(locationList, IssueCtl().qualityIssue.IssueOccur.QS_ACTIVITY == "RCV" ? "211" : "212", AccessMode.Partner);
         SQMBasePage.SetPersonList(ddlResponsible, respList, "", 20);
         updResponsible.Update();
     }
 }
Example #2
0
        public void gvNotifyList_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())))
            {
                RadComboBox rdl1, rdl2;

                System.Web.UI.WebControls.HiddenField hfField = new HiddenField();
                try
                {
                    HiddenField hf  = (HiddenField)e.Row.Cells[0].FindControl("hfScope");
                    Label       lbl = (Label)e.Row.Cells[0].FindControl("lblScope");
                    lbl.Text = WebSiteCommon.GetXlatValue("taskRecordType", hf.Value);
                    lbl      = (Label)e.Row.Cells[0].FindControl("lblScopeDesc");
                    lbl.Text = WebSiteCommon.GetXlatValueLong("taskRecordType", hf.Value);

                    TaskRecordType scope = (TaskRecordType)Enum.Parse(typeof(TaskRecordType), hf.Value, true);

                    if (scope == TaskRecordType.InternalQualityIncident ||
                        scope == TaskRecordType.CustomerQualityIncident ||
                        scope == TaskRecordType.SupplierQualityIncident ||
                        scope == TaskRecordType.HealthSafetyIncident ||
                        scope == TaskRecordType.PreventativeAction)
                    {
                        rdl1 = (RadComboBox)e.Row.Cells[0].FindControl("ddlNotify1");
                        hf   = (HiddenField)e.Row.Cells[0].FindControl("hfNotify1");
                        if (scope == TaskRecordType.HealthSafetyIncident || scope == TaskRecordType.PreventativeAction)
                        {
                            SQMBasePage.SetPersonList(rdl1, SQMModelMgr.FilterPersonListByAppContext(staticPersonList, "EHS"), "", 20);
                        }
                        else
                        {
                            SQMBasePage.SetPersonList(rdl1, SQMModelMgr.FilterPersonListByAppContext(staticPersonList, "SQM"), "", 20);
                        }

                        SQMBasePage.DisplayControlValue(rdl1, hf.Value, PageUseMode.EditEnabled, "");
                        rdl1.Visible = true;

                        rdl2 = (RadComboBox)e.Row.Cells[0].FindControl("ddlNotify2");
                        hf   = (HiddenField)e.Row.Cells[0].FindControl("hfNotify2");
                        if (scope == TaskRecordType.HealthSafetyIncident || scope == TaskRecordType.PreventativeAction)
                        {
                            SQMBasePage.SetPersonList(rdl2, SQMModelMgr.FilterPersonListByAppContext(staticPersonList, "EHS"), "", 20);
                        }
                        else
                        {
                            SQMBasePage.SetPersonList(rdl2, SQMModelMgr.FilterPersonListByAppContext(staticPersonList, "SQM"), "", 20);
                        }
                        SQMBasePage.DisplayControlValue(rdl2, hf.Value, PageUseMode.EditEnabled, "");
                        rdl2.Visible = true;
                    }

                    if (scope == TaskRecordType.ProfileInput ||
                        scope == TaskRecordType.ProfileInputApproval ||
                        scope == TaskRecordType.HealthSafetyIncident ||
                        scope == TaskRecordType.PreventativeAction ||
                        scope == TaskRecordType.ProblemCase)
                    {
                        SETTINGS sets = SQMSettings.GetSetting("COMPANY", "ESCALATEANYUSER");

                        rdl1 = (RadComboBox)e.Row.Cells[0].FindControl("ddlEscalate1");
                        hf   = (HiddenField)e.Row.Cells[0].FindControl("hfEscalate1");
                        SQMBasePage.SetPersonList(rdl1, staticPersonList.Where(l => l.RCV_ESCALATION == true || (sets != null && sets.VALUE.ToUpper() == "Y")).ToList(), "", 20);
                        SQMBasePage.DisplayControlValue(rdl1, hf.Value, PageUseMode.EditEnabled, "");
                        rdl1.Visible = true;

                        rdl2 = (RadComboBox)e.Row.Cells[0].FindControl("ddlEscalate2");
                        hf   = (HiddenField)e.Row.Cells[0].FindControl("hfEscalate2");
                        SQMBasePage.SetPersonList(rdl2, staticPersonList.Where(l => l.RCV_ESCALATION == true || (sets != null && sets.VALUE.ToUpper() == "Y")).ToList(), "", 20);
                        SQMBasePage.DisplayControlValue(rdl2, hf.Value, PageUseMode.EditEnabled, "");
                        rdl2.Visible = true;

                        rdl1 = (RadComboBox)e.Row.Cells[0].FindControl("ddlEscalateDays1");
                        hf   = (HiddenField)e.Row.Cells[0].FindControl("hfEscalateDays1");
                        rdl1.Items.Add(new RadComboBoxItem("", ""));
                        rdl1.Items.AddRange(WebSiteCommon.PopulateComboBoxListNums(1, 14, rdl1.EmptyMessage));
                        SQMBasePage.DisplayControlValue(rdl1, hf.Value, PageUseMode.EditEnabled, "");
                        rdl1.Visible = true;

                        rdl2 = (RadComboBox)e.Row.Cells[0].FindControl("ddlEscalateDays2");
                        hf   = (HiddenField)e.Row.Cells[0].FindControl("hfEscalateDays2");
                        rdl2.Items.Add(new RadComboBoxItem("", ""));
                        rdl2.Items.AddRange(WebSiteCommon.PopulateComboBoxListNums(1, 14, rdl2.EmptyMessage));
                        SQMBasePage.DisplayControlValue(rdl2, hf.Value, PageUseMode.EditEnabled, "");
                        rdl2.Visible = true;
                    }
                }
                catch
                {
                }
            }
        }