protected void DisplayUser()
        {
            PERSON           person = LocalPerson();
            BusinessLocation businessLocation;
            SETTINGS         setsPwdReset = SQMSettings.SelectSettingByCode(entities, "COMPANY", "TASK", "PasswordResetEnable");
            SQM_ACCESS       sysAccess    = SQMModelMgr.LookupCredentials(entities, person.SSO_ID, "", false);

            divPageBody.Visible = true;
            ddlPlantSelect.ClearCheckedItems();

            DisplayErrorMessage(null);

            string addFields = SessionManager.GetUserSetting("COMPANY", "PERSON_ADD_FIELDS") == null ? "" : SessionManager.GetUserSetting("COMPANY", "PERSON_ADD_FIELDS").VALUE;

            if (addFields.Contains("jobcode"))
            {
                trJobCode.Visible = true;
            }
            else
            {
                trJobCode.Visible = false;
            }

            if (addFields.Contains("supv"))
            {
                lblEmpSupv.Visible = tbSupvEmpID.Visible = true;
            }
            else
            {
                lblEmpID.Visible = true;
            }

            if (person == null || string.IsNullOrEmpty(person.STATUS))                 // new user
            {
                winUserEdit.Title        = hfAddUser.Value;
                businessLocation         = new BusinessLocation();
                businessLocation.Company = SessionManager.EffLocation.Company;
                SetStatusList("ddlUserStatus", "A", true);
                tbUserSSOID.Enabled = true;
                tbUserSSOID.Text    = "";
                tbUserSSOID.Focus();
            }
            else
            {
                winUserEdit.Title   = hfUpdateUser.Value;
                tbUserSSOID.Enabled = setsPwdReset != null && setsPwdReset.VALUE.ToUpper() == "Y" ? true : false;
                tbUserFirstName.Focus();

                lblPlantAccess.Text = "";
                if (person.PLANT_ID > 0)
                {
                    ddlHRLocation.SelectedValue = person.PLANT_ID.ToString();
                    if (ddlPlantSelect.Items.FindItemByValue(person.PLANT_ID.ToString()) != null)
                    {
                        ddlPlantSelect.Items.FindItemByValue(person.PLANT_ID.ToString()).Checked = true;
                    }
                }

                if (!string.IsNullOrEmpty(person.NEW_LOCATION_CD))
                {
                    RadComboBoxItem plantItem = null;
                    string[]        locs      = person.NEW_LOCATION_CD.Split(',');
                    foreach (string locid in locs)
                    {
                        if (!string.IsNullOrEmpty(locid))
                        {
                            if ((plantItem = ddlPlantSelect.Items.FindItemByValue(locid)) != null)
                            {
                                ddlPlantSelect.Items.FindItemByValue(locid).Checked = true;
                                if (locs.Length > 2)
                                {
                                    lblPlantAccess.Text += lblPlantAccess.Text.Length == 0 ? plantItem.Text : (", " + plantItem.Text);
                                }
                            }
                        }
                    }
                }
            }

            // AW20131106 - do not want to be able to change a SSO ID once a person has been added
            if (!string.IsNullOrEmpty(person.SSO_ID.Trim()))
            {
                tbUserSSOID.Text = person.SSO_ID;
            }

            tbUserFirstName.Text  = person.FIRST_NAME;
            tbUserLastName.Text   = person.LAST_NAME;
            tbUserMiddleName.Text = !string.IsNullOrEmpty(person.MIDDLE_NAME) ? person.MIDDLE_NAME : "";
            if (ddlJobCode.Items.FindItemByValue(person.JOBCODE_CD) != null)
            {
                ddlJobCode.SelectedValue = person.JOBCODE_CD;
            }
            else
            {
                ddlJobCode.SelectedValue = "";
            }

            if (ddlPrivGroup.Items.FindItemByValue(person.PRIV_GROUP) != null)
            {
                ddlPrivGroup.SelectedValue = person.PRIV_GROUP;
            }
            else
            {
                ddlPrivGroup.SelectedValue = "";
            }

            tbUserPhone.Text = person.PHONE;
            tbUserEmail.Text = person.EMAIL;
            tbEmpID.Text     = person.EMP_ID;
            tbSupvEmpID.Text = person.SUPV_EMP_ID;
            SetStatusList("ddlUserStatus", person.STATUS, true);
            if (sysAccess != null && sysAccess.LAST_LOGON_DT.HasValue)
            {
                lblUserLoginDate_out.Text = SQMBasePage.FormatDate(WebSiteCommon.LocalTime((DateTime)sysAccess.LAST_LOGON_DT, WebSiteCommon.GetXlatValue("timeZone", person.PREFERRED_TIMEZONE)), "g", true);
            }
            else
            {
                lblUserLoginDate_out.Text = "";
            }
            lblUserLastUpdate.Text = person.LAST_UPD_BY + "  " + SQMBasePage.FormatDate(WebSiteCommon.LocalTime((DateTime)person.LAST_UPD_DT, SessionManager.UserContext.TimeZoneID), "g", true);

            if (ddlUserLanguage.Items.FindByValue(person.PREFERRED_LANG_ID.ToString()) != null)
            {
                ddlUserLanguage.SelectedValue = person.PREFERRED_LANG_ID.ToString();
            }
            if (ddlUserTimezone.Items.FindByValue(person.PREFERRED_TIMEZONE) != null)
            {
                ddlUserTimezone.SelectedValue = person.PREFERRED_TIMEZONE;
            }


            List <SysModule> sysmodList = SQMSettings.SystemModuleItems();
            string           prod = "";
            RadComboBoxItem  item = null; RadComboBoxItem itemSep = null;

            lblPrivScope.Text = "";
            if (person.PRIV_GROUP != null)
            {
                foreach (PRIVLIST jp in SQMModelMgr.SelectPrivList(person.PRIV_GROUP).ToList())
                {
                    lblPrivScope.Text += (" " + ((SysPriv)jp.PRIV).ToString() + ": " + jp.SCOPE + ",");
                }
            }
            lblPrivScope.Text = lblPrivScope.Text.TrimEnd(',');

            if (setsPwdReset != null && setsPwdReset.VALUE.ToUpper() == "Y")
            {
                trResetPassword.Visible = true;
            }

            cbUserEmailLock.Checked    = SQMModelMgr.PersonFieldLocked(person, LockField.email);
            cbPrivGroupLock.Checked    = SQMModelMgr.PersonFieldLocked(person, LockField.priv);
            cbHRLocationLock.Checked   = SQMModelMgr.PersonFieldLocked(person, LockField.plant);
            cbUserLanguageLock.Checked = SQMModelMgr.PersonFieldLocked(person, LockField.lang);

            string script = "function f(){OpenUserEditWindow(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";

            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);
        }