Example #1
0
        /// <summary>
        /// 用户退出
        /// </summary>
        /// <param name="UserInfoId"></param>
        public void ApplicationExit(string UserInfoId)
        {
            List <RealLoginUserInfo> rlList = BaseEntityFac.GetEntityByField <RealLoginUserInfo>("UserInfoId", UserInfoId);

            if (rlList != null && rlList.Count > 0)
            {
                BaseEntityFac.NoTransactionOPEntitys <RealLoginUserInfo>(rlList, EOPType.Delete);
            }
        }
Example #2
0
 /// <summary>
 /// 删除基础数据
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="itemList"></param>
 /// <returns></returns>
 public bool DeleteBaseData(List <UserRoleRelationship> itemList)
 {
     return(BaseEntityFac.NoTransactionOPEntitys <UserRoleRelationship>(itemList, EOPType.Delete));
 }
Example #3
0
        /// <summary>
        /// 用户登录验证
        /// </summary>
        /// <param name="userCode"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public LoginStatus Login(string userCode, string password)
        {
            LoginStatus result = LoginStatus.Failed;

            try
            {
                if (string.IsNullOrWhiteSpace(userCode))
                {
                    return(LoginStatus.UserIsNull);
                }

                if (string.IsNullOrWhiteSpace(password))
                {
                    return(LoginStatus.PasswordIsNull);
                }

                List <UserInfo> itemList = BaseEntityFac.GetEntityByField <UserInfo>("EmployeeNum", userCode);

                if (itemList != null && itemList.Count > 0)
                {
                    UserInfo item = itemList.FirstOrDefault();

                    //检查用户是否锁定
                    if (item.LockStatus == (int)LockStatus.Lock)
                    {
                        return(LoginStatus.Failed);
                    }

                    if (item.UserPasswd.CompareTo(password) == 0)
                    {
                        result = LoginStatus.Sucess;

                        #region 记录实时用户登录信息


                        List <RealLoginUserInfo> rlList = BaseEntityFac.GetEntityByField <RealLoginUserInfo>("UserInfoId", item.UserInfoId);
                        if (rlList == null || rlList.Count == 0)
                        {
                            List <RealLoginUserInfo> insertList = new List <RealLoginUserInfo>();
                            RealLoginUserInfo        rl         = new RealLoginUserInfo();
                            rl.UserInfoId          = item.UserInfoId;
                            rl.RealLoginUserInfoId = BusinessHelper.CreateGUID();
                            rl.LastTime            = BusinessHelper.GetServerTime();

                            insertList.Add(rl);

                            BaseEntityFac.NoTransactionOPEntitys(insertList, EOPType.Insert);
                        }
                        #endregion
                    }
                    else
                    {
                        result = LoginStatus.PasswordError;
                    }
                }
                else
                {
                    result = LoginStatus.UserNotExist;
                }
            }
            catch (Exception ex)
            {
                BusinessHelper.DebugLog(ex.Message);
            }


            return(result);
        }
Example #4
0
 /// <summary>
 /// 实体 增删改操作
 /// </summary>
 /// <param name="itemList"></param>
 /// <param name="eopType"></param>
 /// <returns></returns>
 public bool NoTransactionOPEntitys <T>(List <T> itemList, EOPType eopType) where T : class
 {
     return(BaseEntityFac.NoTransactionOPEntitys <T>(itemList, eopType));
 }