Ejemplo n.º 1
0
        private void ListUsers()
        {
            SetLocalPerson(null);
            isNew = false;
            decimal plantID = 0;

            List <PERSON> personList;

            if (Request.QueryString["loc"] != null)
            {
                string loc = Request.QueryString["loc"].ToString().ToLower();
                if (!string.IsNullOrEmpty(loc))
                {
                    decimal.TryParse(loc, out plantID);
                }
            }

            if (ddlListStatus.SelectedValue == "A")
            {
                personList = SQMModelMgr.SearchPersonList(entities, SessionManager.EffLocation.Company.COMPANY_ID, "", true).Where(l => l.STATUS == "A").ToList();
            }
            else if (ddlListStatus.SelectedValue == "I")
            {
                personList = SQMModelMgr.SearchPersonList(entities, SessionManager.EffLocation.Company.COMPANY_ID, "", false).Where(l => l.STATUS == "I").ToList();
            }
            else if (ddlListStatus.SelectedValue == "150")
            {
                personList = SQMModelMgr.SelectPrivGroupPersonList(SysPriv.admin, SysScope.busloc, 0);
            }
            else if (ddlListStatus.SelectedValue == "100")
            {
                personList = SQMModelMgr.SelectPrivGroupPersonList(SysPriv.admin, SysScope.system, 0);
            }
            else
            {
                personList = SQMModelMgr.SearchPersonList(entities, SessionManager.EffLocation.Company.COMPANY_ID, "", false);
            }

            if (personList.Count > 0)
            {
                if (plantID > 0)
                {
                    personList = personList.Where(l => l.PLANT_ID == plantID).ToList();
                }
                //personList = personList.Where(l => (plantID == 0  ||  l.PLANT_ID == plantID) &&  SQMModelMgr.SearchUserList(new string[2] {"A","P"}).Select(u => u.SSO_ID).ToList().Contains(l.SSO_ID)).ToList();
            }

            uclUserList.BindUserList(personList.Where(l => l.ROLE > 1).OrderBy(l => l.LAST_NAME).ToList(), SessionManager.EffLocation.Company.COMPANY_ID);
            lblUserCount_out.Text = personList.Count.ToString();
        }
Ejemplo n.º 2
0
        private void DoUserSearch()
        {
            bool activeOnly = false;

            if (args.Length > 1 && args[1] == "A")
            {
                activeOnly = true;
            }

            userList = SQMModelMgr.SearchPersonList(entities, SessionManager.SessionContext.ActiveCompany().COMPANY_ID, args[0], activeOnly);
            GridView gv = (GridView)hfBase.FindControl("gvUserList");

            gv.DataSource = userList;
            gv.DataBind();
            SetGridViewDisplay(gv, (Label)hfBase.FindControl("lblUserListEmpty"), (System.Web.UI.HtmlControls.HtmlGenericControl)hfBase.FindControl("divGVScroll"), 0);
        }
Ejemplo n.º 3
0
        private void ListUsers()
        {
            SetLocalPerson(null);
            isNew = false;
            List <PERSON> userList;

            if (ddlListStatus.SelectedValue == "A")
            {
                userList = SQMModelMgr.SearchPersonList(entities, SessionManager.EffLocation.Company.COMPANY_ID, "", true);
            }
            else if (ddlListStatus.SelectedValue == "I")
            {
                userList = SQMModelMgr.SearchPersonList(entities, SessionManager.EffLocation.Company.COMPANY_ID, "", false).Where(l => l.STATUS == "I").ToList();
            }
            else if (ddlListStatus.SelectedValue == "PA")
            {
                userList = SQMModelMgr.SearchPersonList(entities, SessionManager.EffLocation.Company.COMPANY_ID, "", false).Where(l => l.ROLE == 150).ToList();
            }
            else if (ddlListStatus.SelectedValue == "CA")
            {
                userList = SQMModelMgr.SearchPersonList(entities, SessionManager.EffLocation.Company.COMPANY_ID, "", false).Where(l => l.ROLE <= 100).ToList();
            }
            else
            {
                userList = SQMModelMgr.SearchPersonList(entities, SessionManager.EffLocation.Company.COMPANY_ID, "", false);
            }

            string selectedModule = ddlListModule.SelectedValue;

            if (selectedModule == "EHS" || selectedModule == "SQM")
            {
                for (int n = userList.Count - 1; n >= 0; n--)
                {
                    PERSON person = userList[n];
                    if (SQMModelMgr.CheckProductModuleAccess(person, selectedModule) == false)
                    {
                        userList.Remove(person);
                    }
                }
            }

            uclUserList.BindUserList(userList.Where(l => l.ROLE > 1).OrderBy(l => l.LAST_NAME).ToList(), SessionManager.EffLocation.Company.COMPANY_ID);
            lblUserCount_out.Text = userList.Count.ToString();
        }
        private void ListUsers()
        {
            SetLocalPerson(null);
            isNew = false;
            decimal plantID = 0;

            List <PERSON> personList;

            if (Request.QueryString["loc"] != null)
            {
                string loc = Request.QueryString["loc"].ToString().ToLower();
                if (!string.IsNullOrEmpty(loc))
                {
                    decimal.TryParse(loc, out plantID);
                    if (plantID > 0)
                    {
                        ddlPlantList.SelectedValue = plantID.ToString();
                    }
                }
            }
            else if (!string.IsNullOrEmpty(ddlPlantList.SelectedValue))
            {
                decimal.TryParse(ddlPlantList.SelectedValue, out plantID);
            }

            if (ddlListStatus.SelectedValue == "A")
            {
                personList = SQMModelMgr.SearchPersonList(entities, SessionManager.EffLocation.Company.COMPANY_ID, "", true).Where(l => l.STATUS == "A").ToList();
            }
            else if (ddlListStatus.SelectedValue == "I")
            {
                personList = SQMModelMgr.SearchPersonList(entities, SessionManager.EffLocation.Company.COMPANY_ID, "", false).Where(l => l.STATUS == "I").ToList();
            }
            else
            {
                personList = SQMModelMgr.SearchPersonList(entities, SessionManager.EffLocation.Company.COMPANY_ID, "", false);
            }

            List <string> roleSelects = ddlRoleList.CheckedItems.Select(c => c.Value).ToList();

            if (roleSelects.Count > 0)
            {
                personList = personList.Where(p => roleSelects.Contains(p.PRIV_GROUP)).ToList();
            }

            if (!string.IsNullOrEmpty(tbFilterName.Text.Trim()))
            {
                personList = personList.Where(l => tbFilterName.Text.Trim().ToUpper().Contains(l.LAST_NAME.ToUpper()) || tbFilterName.Text.Trim().ToUpper().Contains(l.FIRST_NAME.ToUpper())).ToList();
            }

            if (personList.Count > 0)
            {
                if (plantID > 0)
                {
                    personList = personList.Where(l => l.PLANT_ID == plantID).ToList();
                }
                //personList = personList.Where(l => (plantID == 0  ||  l.PLANT_ID == plantID) &&  SQMModelMgr.SearchUserList(new string[2] {"A","P"}).Select(u => u.SSO_ID).ToList().Contains(l.SSO_ID)).ToList();
            }

            uclUserList.BindUserList(personList.Where(l => l.ROLE > 1).OrderBy(l => l.LAST_NAME).ToList(), SessionManager.EffLocation.Company.COMPANY_ID);
            lblUserCount_out.Text = personList.Count.ToString();
        }