Ejemplo n.º 1
0
        public JArray GetSearchUsr(string searchStr, UsrSearchBy usrSearchBy, bool isExactSrch = false, ImDbType imDbType = ImDbType.Active)
        {
            var result = AuditManager.Rep.WsUsrMgmt.SearchUsr(searchStr, usrSearchBy, isExactSrch, imDbType);

            if (result == null)
                return null;

            var retModel = JArray.FromObject(result);

            return retModel;
        }
Ejemplo n.º 2
0
        public JArray GetSearchUsr(string searchStr, UsrSearchBy usrSearchBy, bool isExactSrch = false, ImDbType imDbType = ImDbType.Active)
        {
            var result = AuditManager.Rep.WsUsrMgmt.SearchUsr(searchStr, usrSearchBy, isExactSrch, imDbType);

            if (result == null)
            {
                return(null);
            }

            var retModel = JArray.FromObject(result);

            return(retModel);
        }
Ejemplo n.º 3
0
        public static List <WsUser> SearchUsr(string searchStr, UsrSearchBy usrSearchBy, bool isExactSrch = false, ImDbType imDbType = ImDbType.Active)
        {
            //--V469-583-S
            //IManDatabase imDb = ImSession.GetInstance.GetDb(imDbType);
            IManDatabase imDb = IManageSession.Db(imDbType);
            //--V469-583-E

            IManUsers imUsrs            = null;
            bool      srchIncludeDomain = false;

            List <WsUser> wsUsrs = new List <WsUser>();

            if (usrSearchBy == UsrSearchBy.Name)
            {
                //if (isExactSrch)
                //{
                //    imUsrs = imDb.SearchUsers(searchStr, imSearchAttributeType.imSearchExactMatch, true);
                //}
                //else
                //{
                //    imUsrs = imDb.SearchUsers(searchStr, imSearchAttributeType.imSearchFullName, true);
                //}

                imUsrs = imDb.SearchUsers(searchStr, imSearchAttributeType.imSearchFullName, true);
            }
            else if (usrSearchBy == UsrSearchBy.Email)
            {
                var spEmail = searchStr.Split('@');
                if (spEmail.Length == 1)
                {
                    //searchStr = email;
                }
                else if (spEmail.Length == 2)
                {
                    if (string.IsNullOrWhiteSpace(spEmail[1]) ||
                        spEmail[1].StartsWith("kpmg", StringComparison.OrdinalIgnoreCase) ||
                        spEmail[1].StartsWith("kpmg.com", StringComparison.OrdinalIgnoreCase))
                    {
                        srchIncludeDomain = true;
                        searchStr         = spEmail[0];
                    }
                    else
                    {
                        //searchStr = email;
                    }
                }
                else
                {
                    //searchStr = email;
                }

                //if (isExactSrch)
                //{
                //    imUsrs = imDb.SearchUsers(searchStr, imSearchAttributeType.imSearchExactMatch, true);
                //}
                //else
                //{
                //    imUsrs = imDb.SearchUsers(searchStr, imSearchAttributeType.imSearchID, true);
                //}

                imUsrs = imDb.SearchUsers(searchStr, imSearchAttributeType.imSearchID, true);
            }

            if (imUsrs != null)
            {
                if (usrSearchBy == UsrSearchBy.Name)
                {
                    if (isExactSrch)
                    {
                        foreach (IManUser imUsr in imUsrs)
                        {
                            var spFullName = searchStr.Split(',');

                            if (spFullName[0].Equals(imUsr.FullName.SplitNGet(',', 0), StringComparison.OrdinalIgnoreCase))
                            {
                                wsUsrs.Add(IM.Mgr.WsUtility.GetWsUser(imUsr));
                            }
                        }
                    }
                    else
                    {
                        foreach (IManUser imUsr in imUsrs)
                        {
                            wsUsrs.Add(IM.Mgr.WsUtility.GetWsUser(imUsr));
                        }
                    }
                }
                else if (usrSearchBy == UsrSearchBy.Email)
                {
                    if (isExactSrch)
                    {
                        foreach (IManUser imUsr in imUsrs)
                        {
                            if (imUsr.Name.Equals(searchStr, StringComparison.OrdinalIgnoreCase))
                            {
                                wsUsrs.Add(IM.Mgr.WsUtility.GetWsUser(imUsr));
                            }
                        }
                    }
                    else
                    {
                        if (srchIncludeDomain)
                        {
                            foreach (IManUser imUsr in imUsrs)
                            {
                                if (imUsr.Name.Equals(searchStr, StringComparison.OrdinalIgnoreCase))
                                {
                                    wsUsrs.Add(IM.Mgr.WsUtility.GetWsUser(imUsr));
                                }
                            }
                        }
                        else
                        {
                            foreach (IManUser imUsr in imUsrs)
                            {
                                wsUsrs.Add(IM.Mgr.WsUtility.GetWsUser(imUsr));
                            }
                        }
                    }
                }

                //foreach (IManUser imUsr in imUsrs)
                //{
                //    if(srchIncludeDomain)
                //    {
                //        if(imUsr.Name.Equals(searchStr, StringComparison.OrdinalIgnoreCase))
                //        {
                //            wsUsrs.Add(IM.Mgr.WsUtility.GetWsUser(imUsr));
                //        }
                //    }
                //    else
                //    {
                //        wsUsrs.Add(IM.Mgr.WsUtility.GetWsUser(imUsr));
                //    }
                //}
            }

            return(wsUsrs);
        }
Ejemplo n.º 4
0
 public static List<WsUser> SearchUsr(string searchStr, UsrSearchBy usrSearchBy, bool isExactSrch = false, ImDbType imDbType = ImDbType.Active)
 {
     return IM.Mgr.WsUsrMgmt.SearchUsr(searchStr, usrSearchBy, isExactSrch, imDbType);
 }
Ejemplo n.º 5
0
        public static List<WsUser> SearchUsr(string searchStr, UsrSearchBy usrSearchBy, bool isExactSrch = false, ImDbType imDbType = ImDbType.Active)
        {
            //--V469-583-S
            //IManDatabase imDb = ImSession.GetInstance.GetDb(imDbType);
            IManDatabase imDb = IManageSession.Db(imDbType);
            //--V469-583-E

            IManUsers imUsrs = null;
            bool srchIncludeDomain = false;

            List<WsUser> wsUsrs = new List<WsUser>();

            if (usrSearchBy == UsrSearchBy.Name)
            {
                //if (isExactSrch)
                //{
                //    imUsrs = imDb.SearchUsers(searchStr, imSearchAttributeType.imSearchExactMatch, true);
                //}
                //else
                //{
                //    imUsrs = imDb.SearchUsers(searchStr, imSearchAttributeType.imSearchFullName, true);
                //}

                imUsrs = imDb.SearchUsers(searchStr, imSearchAttributeType.imSearchFullName, true);
            }
            else if (usrSearchBy == UsrSearchBy.Email)
            {
                var spEmail = searchStr.Split('@');
                if (spEmail.Length == 1)
                {
                    //searchStr = email;
                }
                else if (spEmail.Length == 2)
                {
                    if (string.IsNullOrWhiteSpace(spEmail[1])
                        || spEmail[1].StartsWith("kpmg", StringComparison.OrdinalIgnoreCase)
                        || spEmail[1].StartsWith("kpmg.com", StringComparison.OrdinalIgnoreCase))
                    {
                        srchIncludeDomain = true;
                        searchStr = spEmail[0];
                    }
                    else
                    {
                        //searchStr = email;
                    }
                }
                else
                {
                    //searchStr = email;
                }

                //if (isExactSrch)
                //{
                //    imUsrs = imDb.SearchUsers(searchStr, imSearchAttributeType.imSearchExactMatch, true);
                //}
                //else
                //{
                //    imUsrs = imDb.SearchUsers(searchStr, imSearchAttributeType.imSearchID, true);
                //}

                imUsrs = imDb.SearchUsers(searchStr, imSearchAttributeType.imSearchID, true);

            }

            if (imUsrs !=  null)
            {
                if (usrSearchBy == UsrSearchBy.Name)
                {
                    if (isExactSrch)
                    {
                        foreach (IManUser imUsr in imUsrs)
                        {
                            var spFullName = searchStr.Split(',');

                            if (spFullName[0].Equals(imUsr.FullName.SplitNGet(',', 0), StringComparison.OrdinalIgnoreCase))
                            {
                                wsUsrs.Add(IM.Mgr.WsUtility.GetWsUser(imUsr));
                            }
                        }
                    }
                    else
                    {
                        foreach (IManUser imUsr in imUsrs)
                        {
                            wsUsrs.Add(IM.Mgr.WsUtility.GetWsUser(imUsr));
                        }
                    }
                }
                else if (usrSearchBy == UsrSearchBy.Email)
                {
                    if (isExactSrch)
                    {
                        foreach (IManUser imUsr in imUsrs)
                        {
                            if (imUsr.Name.Equals(searchStr, StringComparison.OrdinalIgnoreCase))
                            {
                                wsUsrs.Add(IM.Mgr.WsUtility.GetWsUser(imUsr));
                            }
                        }
                    }
                    else
                    {
                        if (srchIncludeDomain)
                        {
                            foreach (IManUser imUsr in imUsrs)
                            {
                                if (imUsr.Name.Equals(searchStr, StringComparison.OrdinalIgnoreCase))
                                {
                                    wsUsrs.Add(IM.Mgr.WsUtility.GetWsUser(imUsr));
                                }
                            }
                        }
                        else
                        {
                            foreach (IManUser imUsr in imUsrs)
                            {
                                wsUsrs.Add(IM.Mgr.WsUtility.GetWsUser(imUsr));
                            }
                        }
                    }
                }

                //foreach (IManUser imUsr in imUsrs)
                //{
                //    if(srchIncludeDomain)
                //    {
                //        if(imUsr.Name.Equals(searchStr, StringComparison.OrdinalIgnoreCase))
                //        {
                //            wsUsrs.Add(IM.Mgr.WsUtility.GetWsUser(imUsr));
                //        }
                //    }
                //    else
                //    {
                //        wsUsrs.Add(IM.Mgr.WsUtility.GetWsUser(imUsr));
                //    }
                //}
            }

            return wsUsrs;
        }
Ejemplo n.º 6
0
 public static List <WsUser> SearchUsr(string searchStr, UsrSearchBy usrSearchBy, bool isExactSrch = false, ImDbType imDbType = ImDbType.Active)
 {
     return(IM.Mgr.WsUsrMgmt.SearchUsr(searchStr, usrSearchBy, isExactSrch, imDbType));
 }