示例#1
0
        /// <summary>
        /// 判断是否有重用户名用户
        /// </summary>
        /// <param name="OID">当前用户OID</param>
        /// <param name="col">判断字段</param>
        /// <param name="val">判断字段的值</param>
        /// <returns></returns>
        public object GetIsExist(string OID, string col, string val)
        {
            bool IsExist = false;

            if (col == "UserName")
            {
                List <Base_UserInfo> ExistList = _service.FindBy(op => op.UserName == val).ToList();
                if (ExistList.Count > 0)
                {
                    if (string.IsNullOrEmpty(OID))
                    {
                        IsExist = true;
                    }
                    else if (ExistList[0].OID == OID)
                    {
                        IsExist = false;
                    }
                    else
                    {
                        IsExist = true;
                    }
                }
                else
                {
                    IsExist = false;
                }
            }
            else if (col == "EMAIL")
            {
                List <Base_UserInfo> ExistList = _service.FindBy(op => op.EMAIL == val).ToList();
                if (ExistList.Count > 0)
                {
                    if (string.IsNullOrEmpty(OID))
                    {
                        IsExist = true;
                    }
                    else if (ExistList[0].OID == OID)
                    {
                        IsExist = false;
                    }
                    else
                    {
                        IsExist = true;
                    }
                }
                else
                {
                    IsExist = false;
                }
            }
            return(IsExist);
        }
示例#2
0
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <returns></returns>
        public object GetUserMess()
        {
            string        userName  = Tools.SessionHelper.GetSession <Base_UserInfo>(Tools.SessionHelper.SessinoName.CurUser).UserName;
            List <string> igorelist = new List <string>()
            {
                "Orgs", "Roles"
            };
            Base_UserInfo UserInfo = _userInfoBll.FindBy(t => t.UserName == userName).ToList <Base_UserInfo>().FirstOrDefault();

            if (UserInfo != null)
            {
                return(Common.NewtonJsonHelper.Deserialize <object>(NewtonJsonHelper.Serialize(UserInfo, igorelist), null));
            }
            return(Common.NewtonJsonHelper.Deserialize <object>(NewtonJsonHelper.Serialize("{}", null), null));
        }